/* ============================= */
/* Bootstrap-Style Navigation - Using variables.css */
/* ============================= */

/* ============================= */
/* Base Navbar Styles */
/* ============================= */

.navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 
                0 1px 20px rgba(0, 0, 0, 0.03);
    transition: var(--transition-fast);
    padding: 0;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-height: 64px;
}

/* Brand/Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: #000000 !important; /* Changed to black */
    font-weight: 600;
    font-size: var(--text-lg);
    transition: var(--transition-fast);
    padding: var(--spacing-sm) 0;
    opacity: 0.95;
}

.navbar-brand:hover {
    color: var(--primary) !important;
    opacity: 1;
}

.brand-icon {
    font-size: var(--text-2xl);
}

/* Navbar Toggler */
.navbar-toggler {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(var(--primary-rgb), 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.navbar-toggler:hover {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.navbar-toggler:active {
    transform: scale(0.98);
}

.navbar-toggler:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.navbar-toggler-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 4px;
}

.navbar-toggler-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

/* Toggler Animation */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon span:nth-child(2) {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navbar Collapse */
.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

/* Desktop - Always Visible */
@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
}

/* Mobile - Collapsible */
@media (max-width: 991px) {
    .navbar-toggler {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px) saturate(200%);
        -webkit-backdrop-filter: blur(25px) saturate(200%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .navbar-collapse.show {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Navbar Nav */
.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing-xs);
}

@media (min-width: 992px) {
    .navbar-nav {
        flex-direction: row;
        margin-left: auto;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--primary) transparent;
    }
    
    .navbar-nav::-webkit-scrollbar {
        height: 4px;
    }
    
    .navbar-nav::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .navbar-nav::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: var(--radius-full);
    }
    
    .navbar-nav::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }
}

@media (max-width: 991px) {
    .navbar-nav {
        flex-direction: column;
        padding: var(--spacing) 0;
        gap: 0;
    }
}

/* Nav Items */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 16px;
    color: #000000 !important; /* Changed to black */
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition-fast);
    white-space: nowrap;
    opacity: 0.95;
    cursor: pointer !important; /* Ensure cursor is pointer */
    pointer-events: auto !important; /* Ensure links are clickable */
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary) !important;
    opacity: 1;
    text-decoration: none;
}

/* Make sure all links are clickable */
.nav-link,
.dropdown-item,
.navbar-brand {
    pointer-events: auto !important;
    cursor: pointer !important;
}

@media (max-width: 991px) {
    .nav-link {
        padding: 12px var(--spacing);
        font-size: var(--text-base);
        opacity: 0.98;
        color: #000000 !important; /* Changed to black */
    }
}

/* Dropdown */
.dropdown-toggle::after {
    content: '▾';
    font-size: 10px;
    opacity: 0.8;
    margin-left: var(--spacing-xs);
    transition: var(--transition-fast);
    color: #000000; /* Changed to black */
}

/* Desktop: Clickable dropdown toggle */
@media (min-width: 992px) {
    .dropdown-toggle {
        cursor: pointer;
        position: relative;
    }
    
    /* Only show dropdown on hover, but keep toggle clickable */
    .nav-item.dropdown:hover .dropdown-toggle::after {
        transform: rotate(180deg);
        color: var(--primary);
    }
    
    /* Ensure dropdown toggle is clickable */
    .dropdown-toggle[href] {
        pointer-events: auto;
        cursor: pointer;
    }
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 1px 3px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    z-index: 100;
    list-style: none;
    padding: var(--spacing-sm);
    margin: var(--spacing-sm) 0 0 0;
    display: none;
}

/* Desktop Dropdown Hover - Fixed to allow clickable parent link */
@media (min-width: 992px) {
    .nav-item.dropdown {
        position: relative;
    }
    
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        animation: slideDown 0.2s ease forwards;
    }
    
    /* Make sure the dropdown doesn't interfere with clicking the parent link */
    .dropdown-menu {
        pointer-events: auto;
    }
    
    /* Fix: Ensure parent link is clickable even when dropdown is visible */
    .dropdown-toggle {
        position: relative;
        z-index: 101;
    }
}

/* Mobile Dropdown Click */
@media (max-width: 991px) {
    .dropdown-menu {
        position: absolute;
        left: 0;
        right: 0;
        margin: var(--spacing-xs) var(--spacing);
        padding: var(--spacing-sm);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        border-radius: var(--radius-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    
    .nav-item.dropdown.show .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-item.dropdown .dropdown-toggle::after {
        margin-left: auto;
    }
    
    .nav-item.dropdown.show .dropdown-toggle::after {
        transform: rotate(180deg);
        color: var(--primary);
    }
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    color: #000000 !important; /* Changed to black */
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    white-space: nowrap;
    opacity: 0.95;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary) !important;
    padding-left: 18px;
    opacity: 1;
    text-decoration: none;
}

@media (max-width: 991px) {
    .dropdown-item {
        padding: 10px var(--spacing);
        font-size: var(--text-base);
        opacity: 0.98;
        color: #000000 !important; /* Changed to black */
    }
    
    .dropdown-item:hover {
        padding-left: calc(var(--spacing) + 4px);
        opacity: 1;
        color: var(--primary) !important;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.nav-link:focus,
.dropdown-item:focus,
.navbar-brand:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Small Mobile Adjustments */
@media (max-width: 480px) {
    .navbar-container {
        padding: 0 var(--spacing);
        min-height: 56px;
    }
    
    .navbar-brand {
        font-size: var(--text-base);
        opacity: 0.98;
        color: #000000 !important; /* Changed to black */
    }
    
    .brand-icon {
        font-size: var(--text-xl);
    }
    
    .navbar-toggler {
        width: 40px;
        height: 40px;
    }
    
    .navbar-toggler-icon span {
        width: 20px;
    }
}