/* ============================================
   NAVBAR
   Clean sidebar matching the page theme.
   ============================================ */

/* ---------------------------------------------------------
   SIDEBAR — desktop
   --------------------------------------------------------- */
.side-nav {
    width: 230px;
    flex-shrink: 0;
    height: calc(100vh - 81px); /* matches header height */
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;

    /* Subtle left-side shadow so it lifts off the main content */
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* ---------------------------------------------------------
   NAV ITEMS
   --------------------------------------------------------- */
.side-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.side-nav li a:hover {
    background: #f0f7ff;
    color: #007bff;
    transform: none; /* override admin-home2.css translateX */
}

/* Active page */
.side-nav li.active a {
    background: linear-gradient(135deg, #007bff 0%, #0056cc 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.side-nav li.active a .nav-icon {
    filter: none;
}

/* ---------------------------------------------------------
   ICONS & LABELS
   --------------------------------------------------------- */
.nav-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    /* Keep emoji crisp — no filter by default */
}

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------
   DIVIDER
   --------------------------------------------------------- */
.nav-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0.25rem;
    border-radius: 1px;
    pointer-events: none;
}

/* ---------------------------------------------------------
   SCROLLBAR (webkit) — keep it subtle
   --------------------------------------------------------- */
.side-nav::-webkit-scrollbar {
    width: 4px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.side-nav::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ---------------------------------------------------------
   MOBILE — slide-down panel
   --------------------------------------------------------- */
@media (max-width: 768px) {
    #navbar {
        position: fixed;
        top: 81px; /* height of the header */
        left: 0;
        width: 100%;
        z-index: 999;
        display: none; /* hidden until .active */
        max-height: calc(100vh - 81px);
        overflow-y: auto;
    }

    #navbar.active {
        display: block;
    }

    /* Backdrop blur/dim on body when nav is open */
    body.nav-open::after {
        content: '';
        position: fixed;
        inset: 81px 0 0 0;
        background: rgba(15, 15, 30, 0.35);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 998;
        pointer-events: none;
        animation: backdropFadeIn 0.2s ease;
    }

    @keyframes backdropFadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    .side-nav {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        padding: 0.75rem;
        border-radius: 0 0 16px 16px;
        background: #ffffff;
        animation: navSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes navSlideDown {
        from {
            opacity: 0;
            transform: translateY(-12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .side-nav ul {
        gap: 0.25rem;
    }

    .side-nav li a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .nav-divider {
        margin: 0.4rem 0.5rem;
    }
}

/* ---------------------------------------------------------
   Override conflicting rules from admin-home2.css
   --------------------------------------------------------- */

/* admin-home2.css sets side-nav a color to #ccc on a dark bg —
   override that since our sidebar is now white */
.side-nav a {
    color: #4a5568 !important;
}

.side-nav li.active a {
    color: #ffffff !important;
}

.side-nav a:hover {
    color: #007bff !important;
    transform: none !important;
}

/* admin-home2.css mobile rules force #navbar display:none/flex and
   set a dark background — reset those here */
@media (max-width: 768px) {
    #navbar {
        background: transparent !important;
        flex-direction: unset !important;
    }

    .side-nav ul li {
        border-bottom: none;
    }

    .side-nav ul li a {
        border-bottom: none;
        color: #4a5568 !important;
        text-align: left;
        padding: 0.75rem 1rem;
        display: flex;
        width: 100%;
        box-sizing: border-box;
    }

    .side-nav ul li.active a {
        color: #ffffff !important;
    }
}