/* Primary Theme Colors & Overrides */
.btn-primary { background-color: #0f1646; border-color: #0f1646; }
.btn-primary:hover { background-color: #1e266d; border-color: #1e266d; }
.text-primary { color: #0f1646 !important; }
.btn-outline-primary { color: #0f1646; border-color: #0f1646; }
.btn-outline-primary:hover { background-color: #0f1646; border-color: #0f1646; color: #ffffff; }

/* Custom Spacing Overrides */
.mb-4 {
    margin-top: .5rem !important;
    margin-bottom: .5rem !important;
}

/* Sidebar Layout & Navigation */
.sidebar {
    width: 250px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease; /* Ensure smooth transition for all properties */
    z-index: 1000;
    background-color: #ffffff;
    flex-shrink: 0;
    color: #000000 !important;
}

.sidebar .nav-link {
    display: block;
    padding: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);
    font-size: var(--bs-nav-link-font-size);
    font-weight: var(--bs-nav-link-font-weight);
    color: #000000 !important;
    text-decoration: none;
    background: 0 0;
    border: 0;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
.sidebar .nav-link:hover { color: #0d6efd !important; background-color: rgba(13, 110, 253, 0.1); } /* Hover state */
.sidebar .nav-link.active { background-color: #0f1646 !important; color: #ffffff !important; } /* Active state */

/* Logout Specific Style */
.sidebar .nav-link.logout-link { color: #dc3545 !important; }
.sidebar .nav-link.logout-link:hover { background-color: rgba(220, 53, 69, 0.1); }

.sidebar .nav-link i { color: inherit; } /* Ensures icons follow text color */

/* Social Media Icon Colors */
.social-icons a { transition: transform 0.2s ease; display: inline-block; }
.social-icons a:hover { transform: scale(1.2); }
.social-icons .instagram { color: #E1306C; }
.social-icons .tiktok { color: #000000; }
.social-icons .facebook { color: #1877F2; }

/* Sidebar Mobile View */
@media (max-width: 991.98px) { 
    .sidebar { 
        margin-left: -250px; 
        position: fixed; 
        top: 0; 
        left: 0; 
        height: 100vh;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    } 
    .sidebar.active { margin-left: 0; }

    /* Sidebar Overlay for Mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
        z-index: 999; /* Below sidebar, above main content */
        opacity: 0;
        visibility: hidden;
        backdrop-filter: blur(0px);
        transition: opacity 0.4s ease, visibility 0.4s ease, backdrop-filter 0.4s ease;
    }
    .sidebar-overlay.active { /* This class will be toggled by JS */
        opacity: 1;
        visibility: visible;
        backdrop-filter: blur(4px);
    }
}

/* Sidebar Toggle for Desktop */
@media (min-width: 992px) {
    .sidebar.active { margin-left: -250px; }
}

/* Main content area to allow scrolling */
.main-content-scrollable {
    overflow-y: auto;
    height: 100%; /* Ensure it takes full height of its flex parent */
}

/* Shared UI Components */
.card { transition: transform 0.2s; }
.card:hover { transform: translateY(-5px); }

/* Login Page Specific Styles */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;
    padding: 20px;
}

.login-card {
    max-width: 420px;
    width: 100%;
    margin: auto;
    border: 1px solid rgba(15, 22, 70, 0.1);
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    animation: loginSlideUp 0.6s ease-out;
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card .card-header {
    border-bottom: none;
    padding-top: 2rem;
}

.login-card .form-control {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: all 0.2s;
}

.login-card .form-control:focus {
    border-color: #0f1646;
    box-shadow: 0 0 0 0.25rem rgba(15, 22, 70, 0.15);
}

.login-card .btn-primary {
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

/* Custom Tooltip Theme */
.tooltip {
    --bs-tooltip-bg: #0f1646;
    --bs-tooltip-color: #ffffff;
}

.password-strength-wrapper .progress {
    background-color: #e9ecef;
    border-radius: 10px;
}

.table-dark {
    --bs-table-color: #000000;
    --bs-table-bg: #ffffff;
    --bs-table-border-color: #373b3e;
    --bs-table-striped-bg: #2c3034;
    --bs-table-striped-color: #fff;
    --bs-table-active-bg: #373b3e;
    --bs-table-active-color: #fff;
    --bs-table-hover-bg: #323539;
    --bs-table-hover-color: #fff;
    color: var(--bs-table-color);
    border-color: var(--bs-table-border-color);
}

/* Sorting Indicators */
th.sortable { cursor: pointer; position: relative; }
th.sortable:hover { background-color: #f8f9fa !important; color: #0f1646 !important; }
.th-sort-asc::after { content: " \25B2"; font-size: 0.8em; }
.th-sort-desc::after { content: " \25BC"; font-size: 0.8em; }

/* Dashboard Notification Styling */
.list-group-item-action:hover { background-color: #f8f9fa; cursor: default; }

/* Pulse Animation for Notification Badge */
@keyframes badge-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
.badge-pulse {
    animation: badge-pulse 1.5s infinite;
}

/* Animation for Badge Updates */
@keyframes badge-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); filter: brightness(1.2); }
    100% { transform: scale(1); }
}

.badge-animate {
    animation: badge-pop 0.5s ease-out;
}

/* Sales Leaderboard Top Rank Highlight */
.top-rank-glow {
    background-color: #fffbef !important; /* Extremely light gold tint */
    border-left: 4px solid #ffc107 !important;
    box-shadow: inset 0 0 15px rgba(255, 193, 7, 0.05);
}