/* Base styles */
:root {
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Audiowide', cursive;
}

body {
    font-family: var(--font-primary);
    overflow-x: hidden;
}

/* Site title styling */
.site-title {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: #fd7e14 !important; /* Orange color for Travnook title */
}

/* Sidebar styling */
#sidebar-wrapper {
    min-height: 100vh;
    width: 250px;
    margin-left: -250px;
    transition: margin 0.25s ease-out;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1rem 1.25rem;
    font-size: 1.2rem;
}

#sidebar-wrapper .list-group {
    width: 250px;
}

#sidebar-wrapper .list-group-item {
    border-left: 0;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    margin: 0.025rem;
    width: calc(100% - 2px);
    margin-right: 1px; /* Creates space on the right side */
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem;
}

.sidebar-subheading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    padding: 0.5rem 1.25rem;
}

/* Content area */
#page-content-wrapper {
    min-width: 100vw;
    transition: margin-left 0.25s ease-out;
}

body.sb-sidenav-toggled #wrapper #sidebar-wrapper {
    margin-left: 0;
}

.content-container {
    padding: 20px;
}

/* Forms styling */
.form-group {
    margin-bottom: 1rem;
}

.required label::after {
    content: " *";
    color: #dc3545;
}

/* Cards styling */
.card {
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    font-weight: 500;
}

/* Request list styling */
.request-list .request-item {
    transition: all 0.2s;
}

.request-list .request-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem;
}

.status-in_review {
    background-color: #6c757d;
    color: white;
}

.status-accepted {
    background-color: #28a745;
    color: white;
}

.status-rejected {
    background-color: #dc3545;
    color: white;
}

.status-in_progress {
    background-color: #17a2b8;
    color: white;
}

.status-awaiting_info {
    background-color: #ffc107;
    color: black;
}

.status-info_added {
    background-color: #007bff;
    color: white;
}

.status-completed {
    background-color: #28a745; /* Changed to green */
    color: white;
}

.status-incomplete {
    background-color: #dc3545; /* Red for incorrect/incomplete */
    color: white;
}

/* Add the new visa status badge styling */
.status-visa_awaiting {
    background-color: #ff9800;  /* Orange */
    color: white;
}

.status-visa_accepted {
    background-color: #e83e8c;  /* Changed to pink */
    color: white;
}

.status-visa_rejected {
    background-color: #f44336;  /* Red */
    color: white;
}

/* Highlight rows with specific statuses */
.request-list .request-item.row-completed {
    background-color: rgba(40, 167, 69, 0.1) !important; /* Green background for completed */
}

.request-list .request-item.row-awaiting_info {
    background-color: rgba(255, 193, 7, 0.1) !important; /* Yellow background for awaiting info */
}

/* Messages styling */
.message-list {
    height: 400px;
    overflow-y: auto;
}

.message-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.message-sent {
    background-color: #d1e7ff;
    margin-left: 2rem;
}

.message-received {
    background-color: #f1f1f1;
    margin-right: 2rem;
}

.message-timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Reference docs styling */
.doc-card {
    transition: all 0.2s;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Request logs styling */
.request-logs {
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    padding: 0.5rem;
    border-left: 3px solid #dee2e6;
    margin-bottom: 0.5rem;
}

.log-timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Mobile responsiveness */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }
    
    body.sb-sidenav-toggled #wrapper #sidebar-wrapper {
        margin-left: -250px;
    }
}

/* SLA Breach Styles */
.sla-breach-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.sla-breach-alert {
    border-left: 4px solid #dc3545;
}

/* Update the request list item hover styles */
.request-list .request-item.sla-breached {
    border-left: 3px solid #dc3545;
}

.request-list .request-item.sla-breached:hover {
    border-left-width: 5px;
}

/* Make SLA badge more noticeable in both themes */
body.light-theme .badge.sla-breach-badge,
body.dark-theme .badge.sla-breach-badge {
    background-color: #dc3545 !important;
    color: white !important;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    animation: pulse 2s infinite;
}

/* Dashboard styles */
.dashboard-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.icon-box {
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
}

.status-count-item {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.status-count-item:hover {
    transform: translateX(5px);
}

/* Filter form styles */
.filter-form {
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: 8px;
}

.filter-form .form-control, 
.filter-form .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.filter-form .form-control:focus, 
.filter-form .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--accent-color-rgb), 0.25);
}

/* Dark theme customizations for dashboard */
body.dark-theme .icon-box {
    background-color: var(--sidebar-hover) !important;
}

/* Purple badge for both themes */
.bg-purple {
    background-color: #6f42c1 !important;
    color: white !important;
}

body.dark-theme .bg-purple {
    background-color: #7e57c2 !important;
}

/* Make urgent rows more visible in dark mode */
body.dark-theme .table-danger,
body.dark-theme tr.table-danger td {
    background-color: rgba(200, 35, 51, 0.3) !important;
    color: #fff !important;
    font-weight: 500;
}

/* Dashboard table customizations */
.dashboard-table thead th {
    background-color: var(--sidebar-bg);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.user-stats-table tr:hover td {
    background-color: var(--sidebar-hover);
}

/* Make sure SLA breached rows stand out */
.sla-breached td {
    font-weight: 500 !important;
}

body.dark-theme .sla-breached td {
    font-weight: 500 !important;
    color: #f8d7da !important;
}

/* Make the visa status badges stand out */
.visa-status {
    position: relative;
}

.visa-status::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff9800;
    animation: pulse 2s infinite;
}

/* Styling for the visa follow-up modal */
.visa-followup-container {
    border-left: 3px solid #ff9800;
    padding-left: 10px;
    margin-bottom: 15px;
}

.visa-status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.visa-status-pending {
    background-color: #ffecb3;
    color: #ff6f00;
}

.visa-status-approved {
    background-color: #c8e6c9;
    color: #2e7d32;
}

.visa-status-rejected {
    background-color: #ffcdd2;
    color: #c62828;
}

.snooze-badge {
    background-color: #e0e0e0;
    color: #616161;
}

/* Status counts on dashboard */
.status-count {
    font-size: 1.75rem;
    font-weight: 600;
}

.visa-awaiting-count {
    color: #ff9800;
}

.visa-accepted-count {
    color: #e83e8c;
}

.visa-rejected-count {
    color: #f44336;
}

.incomplete-count {
    color: #dc3545;
}

.flagged-incorrect {
    border-left: 3px solid #dc3545 !important;
}

tr.flagged-incorrect td:first-child {
    padding-left: 10px;
}

/* ========================= */
/* UPDATED PROGRESS BAR STYLES */
/* ========================= */

/* Base progress bar styling */
.progress {
    position: relative;
    height: 22px !important;
    border-radius: 6px;
    overflow: hidden !important; /* Prevent text from overflowing */
    background-color: #f0f0f0;
}

/* Style for the progress bars */
.progress-bar, .countdown-bar {
    position: relative;
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* Remove the ::after pseudo-elements that display text within the bars */
.progress-bar::after, .countdown-bar::after {
    display: none !important;
}

/* Modern color scheme for standard progress bars */
.progress-bar.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* Countdown progress bars - gradient styles */
.countdown-bar.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.countdown-bar.bg-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
}

.countdown-bar.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* Add special styling for SLA breached progress bars */
.progress-bar.sla-breached,
.countdown-bar.sla-breached {
    background: linear-gradient(45deg, #dc3545, #c82333) !important;
    background-size: 1rem 1rem !important;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    ) !important;
    animation: progress-bar-stripes 1s linear infinite, pulse 2s infinite !important;
}

/* Cell width constraint for SLA column in operations view */
.operations-sla-cell {
    min-width: 150px;
    max-width: 200px;
}

/* Dark mode adjustments */
body.dark-theme .progress {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure the visual pulse animation looks good */
@keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

@keyframes sla-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.sla-breached-indicator {
    animation: sla-pulse 2s infinite;
}

.status-duplicate {
    background-color: #008080; /* Dark teal */
    color: white; 
}

.status-cancelled {
    background-color: #9370DB; /* Dark lavender */
    color: white;
}

/* Add styling for sortable header
.sortable {
    cursor: pointer;
    position: relative;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sortable:after {
    content: '↕';
    opacity: 0.3;
    margin-left: 5px;
    font-size: 0.8em;
} */


/* Row highlighting for specific statuses */
.request-list .request-item[data-status="completed"] {
    background-color: rgba(40, 167, 69, 0.1) !important; /* Green background */
}

.request-list .request-item[data-status="awaiting_info"] {
    background-color: rgba(255, 193, 7, 0.1) !important; /* Yellow background */
}

/* Dark theme adjustments */
body.dark-theme .request-list .request-item[data-status="completed"] {
    background-color: rgba(40, 167, 69, 0.2) !important; /* Slightly stronger green */
}

body.dark-theme .request-list .request-item[data-status="awaiting_info"] {
    background-color: rgba(255, 193, 7, 0.2) !important; /* Slightly stronger yellow */
}


/* ========================= */
/* HIDE SLA BREACH STYLING FROM SALES USERS */
/* ========================= */

/* Hide SLA breach visual indicators from sales users */
body[data-user-role^="sales_"] .request-list .request-item.sla-breached {
    border-left: none !important;
    background-color: inherit !important;
}

body[data-user-role^="sales_"] .request-list .request-item.sla-breached:hover {
    border-left: none !important;
    border-left-width: 0 !important;
}

/* Hide SLA breach badges from sales users */
body[data-user-role^="sales_"] .badge[title*="SLA Breached"] {
    display: none !important;
}

/* Hide SLA breach animation from sales users */
body[data-user-role^="sales_"] .sla-breach-badge {
    display: none !important;
}

/* Hide SLA breach text styling from sales users */
body[data-user-role^="sales_"] .sla-breached td {
    font-weight: normal !important;
    color: inherit !important;
}

/* Ensure progress bars don't show SLA breach styling for sales users */
body[data-user-role^="sales_"] .progress-bar.sla-breached,
body[data-user-role^="sales_"] .countdown-bar.sla-breached {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    background-image: none !important;
    animation: none !important;
}

/* Hide SLA breach indicators in request cards for sales users */
body[data-user-role^="sales_"] .sla-breached-indicator {
    display: none !important;
}

/* Remove any red coloring from SLA breached rows for sales users */
body[data-user-role^="sales_"] .request-list .request-item.sla-breached {
    background-color: transparent !important;
}

/* Remove SLA breach styling from dark theme as well */
body.dark-theme[data-user-role^="sales_"] .sla-breached td {
    font-weight: normal !important;
    color: var(--text-color) !important;
}

body.dark-theme[data-user-role^="sales_"] .request-list .request-item.sla-breached {
    border-left: none !important;
    background-color: inherit !important;
}

body.dark-theme[data-user-role^="sales_"] .request-list .request-item.sla-breached:hover {
    border-left: none !important;
}

/* Hide the entire SLA column from sales users */
body[data-user-role^="sales_"] .operations-sla-cell {
    display: none !important;
}

/* Hide SLA column header from sales users */
body[data-user-role^="sales_"] .request-list th:last-child {
    display: none !important;
}

body[data-user-role^="sales_"] .request-list td:last-child {
    display: none !important;
}

/* Ensure normal hover behavior for sales users without SLA breach styling */
body[data-user-role^="sales_"] .request-list .request-item:hover {
    border-left: none !important;
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}