/* ========================================
   TOP NAVIGATION STYLES
======================================== */
.top-navigation {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 140px; /* Below header */
    z-index: 500;
    width: 100%;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    position: relative;
}

.nav-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4) 0;
}

.nav-menu {
    display: flex;
    justify-content: center; /* Center the navigation items */
    list-style: none;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.nav-menu::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    color: var(--color-gray-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    white-space: nowrap;
    font-weight: 500;
    font-size: var(--text-sm);
    border: 1px solid transparent;
    min-height: 44px; /* Ensure minimum touch target size */
}

.nav-link:hover {
    background: var(--color-gray-50);
    color: var(--color-primary);
    border-color: var(--color-gray-200);
    transform: translateY(-1px);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.nav-icon {
    width: 16px;
    text-align: center;
    font-size: var(--text-sm);
}

.nav-text {
    font-weight: 500;
}

.progress-indicator {
    height: 3px;
    background: var(--color-gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    width: 14%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    right: var(--space-6);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-3);
    cursor: pointer;
    z-index: 600;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    align-items: center;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--color-gray-600);
    border-radius: 1px;
    transition: var(--transition-base);
}

.mobile-menu-toggle:hover .hamburger-line {
    background: var(--color-primary);
}

/* Mobile Navigation */
@media (max-width: 1024px) {
    .nav-menu {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-2);
    }
    
    .nav-link {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
    
    .nav-icon {
        width: 14px;
        font-size: var(--text-xs);
    }
}

@media (max-width: 768px) {
    .top-navigation {
        top: 100px; /* Adjusted for smaller header */
    }
    
    .nav-container {
        padding: 0 var(--space-4);
    }
    
    .nav-content {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        z-index: 1100;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-xl);
        padding: var(--space-6);
        overflow-y: auto;
    }
    
    .nav-content.open {
        left: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: var(--space-2);
        overflow-x: visible;
        justify-content: flex-start;
        flex-wrap: nowrap;
        padding-bottom: 0;
    }
    
    .nav-link {
        justify-content: flex-start;
        padding: var(--space-4);
        font-size: var(--text-base);
        white-space: normal;
        text-align: left;
    }
    
    .nav-icon {
        width: 20px;
        font-size: var(--text-base);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-base);
    }
    
    .mobile-nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }
    
    /* Animated hamburger */
    .mobile-menu-toggle.open .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.open .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.open .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-3);
    }
    
    .nav-content {
        padding: var(--space-4);
        width: 100%;
        left: -100%;
    }
    
    .nav-content.open {
        left: 0;
    }
    
    .nav-link {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }
}

/* Smooth scrolling for navigation menu */
.nav-menu {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.nav-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Active state animation */
.nav-item.active .nav-link {
    animation: activeNavItem 0.3s ease-out;
}

@keyframes activeNavItem {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}