/* =========================================
   PUBLIC HEADER STYLES (Strict Separation)
   ========================================= */

/* --- GLOBAL BASE STYLES --- */
.navbar {
    background-color: #121212;
    border-bottom: 1px solid #333;
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
    padding: 0;
    margin-right: 2rem;
}

/* Utilities */
.text-cyan {
    color: var(--primary-cyan) !important;
}

/* =========================================
   DESKTOP VIEW (min-width: 992px)
   ========================================= */
@media (min-width: 992px) {

    /* Force hide mobile elements */
    .offcanvas-custom, 
    .navbar-toggler {
        display: none !important;
    }

    /* Desktop Navigation Links */
    .nav-link {
        color: #a0a0a0 !important;
        font-weight: 500;
        font-size: 0.9rem;
        padding: 0.5rem 1rem !important;
        transition: all 0.2s;
        border-radius: 6px;
        margin: 0 2px;
    }

    .nav-link:hover, .nav-link.link-active {
        color: var(--primary-cyan) !important;
        background: linear-gradient(180deg, transparent 0%, rgba(75, 171, 219, 0.1) 100%);
        border-bottom: 2px solid var(--primary-cyan);
        border-radius: 4px 4px 0 0;
    }

    /* Desktop Dropdown */
    .navbar .dropdown-menu {
        background: #121212;
        border: 1px solid #333;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        margin-top: 0; /* Changed from 1rem to 0 to minimize gap */
        padding: 0.5rem 0;
        min-width: 240px;
        display: none; /* Default hidden */
        animation: fadeIn 0.2s ease;
        position: absolute;
        top: 100%;
        left: auto;
        right: 0;
    }

    /* Bridge pseudo-element to keep hover active between button and menu */
    .navbar .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -15px; /* Bridges the gap */
        left: 0;
        width: 100%;
        height: 15px;
        background: transparent;
    }

    /* Show dropdown on hover or toggle */
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
    }

    .dropdown-header {
        color: #666;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 0.75rem 1.25rem 0.5rem;
    }

    .dropdown-item {
        color: #a0a0a0;
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        transition: all 0.2s;
    }

    .dropdown-item:hover {
        background: rgba(75, 164, 219, 0.1);
        color: #fff;
        padding-left: 1.5rem;
    }

    .dropdown-item i {
        width: 20px;
        margin-right: 10px;
        text-align: center;
    }

    .dropdown-divider {
        border-color: #333;
        margin: 0.5rem 0;
    }

    /* Account Button */
    .btn.dropdown-toggle {
        display: flex;
        align-items: center;
        background: transparent;
        border: 1px solid var(--primary-cyan);
        color: var(--primary-cyan);
        transition: all 0.3s;
    }

    .btn.dropdown-toggle:hover {
        background: var(--primary-cyan);
        color: #000;
        box-shadow: 0 0 15px rgba(75, 171, 219, 0.4);
    }
}

/* =========================================
   MOBILE VIEW (max-width: 991.98px)
   ========================================= */
@media (max-width: 991.98px) {

    /* Force hide desktop elements */
    .collapse.navbar-collapse {
        display: none !important;
    }

    /* Navbar Toggler */
    .navbar-toggler {
        display: block !important;
        background: transparent;
        border: none;
        color: #fff;
        width: 44px;
        height: 44px;
        padding: 0;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        font-size: 1.1rem;
        outline: none;
        transition: all 0.3s ease;
        box-shadow: none !important;
    }

    .navbar-toggler:hover, .navbar-toggler:focus {
        color: var(--primary-cyan);
    }

    /* Bento Grid Menu Icon */
    .bento-menu-icon {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        width: 24px;
        height: 24px;
        margin: 0 auto;
    }

    .bento-menu-icon span {
        display: block;
        width: 6px;
        height: 6px;
        background-color: #fff;
        border-radius: 1px;
        transition: all 0.2s ease;
    }

    .navbar-toggler:hover .bento-menu-icon span,
    .navbar-toggler:focus .bento-menu-icon span,
    .navbar-toggler[aria-expanded="true"] .bento-menu-icon span {
        background-color: var(--primary-cyan);
        box-shadow: 0 0 8px var(--primary-cyan);
    }

    /* Offcanvas Sidebar */
    .offcanvas-custom {
        background-color: #121212;
        width: 85%; /* Responsive width */
        max-width: 320px;
        border-left: 1px solid #333;
        color: #fff;
        display: block; /* Ensure it's capable of showing when toggled */
    }

    .offcanvas-header {
        border-bottom: 1px solid #333;
        padding: 1rem 1.5rem;
    }

    .offcanvas-title {
        font-family: 'Rajdhani', sans-serif;
        font-weight: 700;
        letter-spacing: 2px;
        font-size: 1.1rem;
    }



    /* Mobile Links */
    .nav-group-title {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #666;
        padding: 1.5rem 1.5rem 0.5rem;
    }

    .nav-item-custom {
        display: flex;
        align-items: center;
        padding: 0.85rem 1.5rem;
        color: #a0a0a0;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.95rem;
        border-left: 3px solid transparent;
        transition: all 0.2s;
    }

    .nav-item-custom:hover, .nav-item-custom.link-active {
        background: linear-gradient(90deg, rgba(75, 171, 219, 0.1) 0%, transparent 100%);
        color: #fff;
        border-left-color: var(--primary-cyan);
    }



    .nav-item-custom.link-active i {
        color: var(--primary-cyan);
        filter: drop-shadow(0 0 8px rgba(75, 171, 219, 0.4));
    }

    .nav-item-custom i {
        width: 24px;
        margin-right: 12px;
        font-size: 1.1rem;
        color: #555;
        text-align: center;
    }

    .nav-item-custom:hover i {
        color: var(--primary-cyan);
    }

    .badge-custom {
        margin-left: auto;
        background-color: var(--primary-cyan);
        color: #000;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 4px 8px;
        border-radius: 12px;
    }

    /* Footer Actions */
    .menu-footer-actions {
        margin-top: auto;
        padding: 1.5rem;
        background-color: #0a0a0a;
        border-top: 1px solid #333;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
