﻿#mainNav {
    background-color: transparent;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    transition: all 0.3s ease-in;
}

    /* Scrolled State */
    #mainNav.scrolled {
        background-color: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

.activeNavItem > a {
    color: var(--bg-color5) !important;
}

/* Nav Links Hover Effect */
.nav-link {
    position: relative;
}

    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: var(--color1, #3b82f6);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .nav-link:hover::after {
        width: 80%;
    }

/* Dropdown Styles */
.dropdown-menu {
    min-width: 220px;
    margin-top: 0;
}

.dropdown-item {
    font-weight: 500;
    transition: all 0.2s;
}

    .dropdown-item:hover, .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.05);
        transform: translateX(5px);
    }

/* Desktop Hover Logic & Animations */
@media (min-width: 992px) {
    /* Level 1 Dropdown */
    .dropdown:hover > .dropdown-menu {
        display: block;
        animation: fadeInUp 0.3s ease forwards;
    }

    /* Level 2 Dropdown (Nested) */
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
        top: 0;
        left: 100%;
        margin-top: -0.5rem;
        margin-left: 0;
        animation: fadeInUp 0.3s ease forwards;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 15px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Right-side mobile sidebar icon — same vertical position as .mobile-sidebar-toggle */
.mobile-sidebar-icon {
    position: absolute;
    top: 1rem; /* match .mobile-sidebar-toggle top */
    right: 1rem; /* place on the right */
    z-index: 999;
    background-color: var(--color4);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-decoration: none;
    transition: background-color .2s ease, transform .15s ease;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

    /* Hover / focus */
    .mobile-sidebar-icon:hover,
    .mobile-sidebar-icon:focus {
        background-color: var(--color1);
    }

/* Hide on desktop — matches toggle behavior */
@media (min-width: 992px) {
    .mobile-sidebar-icon {
        display: none !important;
    }
}

/* ===== Mobile Sidebar Toggle Widget ===== */
.mobile-sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    width: 44px;
    height: 44px;
    padding: 10px;
    background-color: var(--color4);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

    .mobile-sidebar-toggle:hover {
        background-color: var(--color1);
    }

    .mobile-sidebar-toggle:focus {
        outline: 2px solid var(--color1);
        outline-offset: 2px;
    }

    .mobile-sidebar-toggle .toggle-bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: var(--color2);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    }

    /* Animated X when active */
    .mobile-sidebar-toggle.active .toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-sidebar-toggle.active .toggle-bar:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    .mobile-sidebar-toggle.active .toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

/* Hide toggle on desktop */
@media (min-width: 992px) {
    .mobile-sidebar-toggle {
        display: none;
    }
}

/* ===== Mobile Sidebar Backdrop ===== */
.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background-color: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background-color 0.3s ease;
}

    .mobile-sidebar-backdrop.visible {
        background-color: rgba(0, 0, 0, 0.6);
        pointer-events: auto;
        backdrop-filter: blur(4px);
    }

/* ===== Mobile Sidebar ===== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1045;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--color4);
}

    .mobile-sidebar.open {
        transform: translateX(0);
    }

/* Hide sidebar on desktop */
@media (min-width: 992px) {
    .mobile-sidebar,
    .mobile-sidebar-backdrop {
        display: none !important;
    }
}

.navbarContainer{
    padding: 0.5rem 9rem;
}

.navbarLogo {
    background-color: var(--color4);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-decoration: none;
    transition: background-color .2s ease, transform .15s ease;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Sidebar Header */
.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color4);
}

.mobile-sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .mobile-sidebar-close:hover {
        background-color: var(--color4);
    }

/* Sidebar Nav */
.mobile-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

    .mobile-nav-item.active > a,
    .mobile-nav-item.active > .mobile-nav-link-wrapper > a {
        color: var(--color1) !important;
    }

.mobile-nav-link-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-link {
    display: block;
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-nav-link-without-hover {
    display: block;
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .mobile-nav-link:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }

.mobile-nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.875rem 1.25rem;
    transition: color 0.2s ease;
}

    .mobile-nav-toggle i {
        transition: transform 0.3s ease;
    }

        .mobile-nav-toggle i.rotated {
            transform: rotate(180deg);
        }

/* Sublist animation */
.mobile-nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-left: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background-color: rgba(0, 0, 0, 0.15);
    border-left: 2px solid var(--color4);
    margin-left: 1.25rem;
}

    .mobile-nav-sublist.open {
        /* max-height set by JS */
    }

    .mobile-nav-sublist .mobile-nav-link {
        font-weight: 500;
        font-size: 0.9375rem;
        padding: 0.75rem 1rem;
    }

    .mobile-nav-sublist .mobile-nav-link-without-hover {
        font-weight: 500;
        font-size: 0.9375rem;
        padding: 0.75rem 1rem;
    }

    .mobile-nav-sublist .mobile-nav-sublist {
        margin-left: 0.75rem;
    }

/* Sidebar Footer */
.mobile-sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color4);
}