/* ============================================
   RESPONSIVE NAVIGATION SYSTEM
   Mobile/Tablet: Hamburger Menu
   Desktop: Full Horizontal Navigation
   ============================================ */

/* Top Navigation Bar - All Devices */
.nav-header {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Logo/Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 18px;
}

.nav-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* Hamburger Menu Button (Mobile/Tablet Only) */
.nav-toggle {
    width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
}

.nav-toggle:hover {
    background: var(--bg-secondary);
}

.nav-toggle:active {
    transform: scale(0.95);
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.nav-toggle.active svg {
    transform: rotate(90deg);
}

/* Close button styling */
.nav-toggle-close {
    display: none;
}

.nav-toggle.active .nav-toggle-open {
    display: none;
}

.nav-toggle.active .nav-toggle-close {
    display: block;
}

/* Desktop Navigation (Hidden on Mobile/Tablet) */
.nav-desktop {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.nav-desktop-link {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    position: relative;
}

.nav-desktop-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-desktop-link.active {
    color: var(--primary);
    background: var(--bg-gradient-subtle);
}

.nav-desktop-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: var(--spacing-md);
    right: var(--spacing-md);
    height: 2px;
    background: var(--primary);
}

/* CTA Button on Desktop */
.nav-cta {
    display: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-accent);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Slide-out Menu (Mobile/Tablet) */
.nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--menu-width);
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 999;
    -webkit-overflow-scrolling: touch;
}

.nav-menu.active {
    left: 0;
}

/* Menu Header */
.nav-menu-header {
    padding: var(--spacing-lg);
    background: var(--bg-gradient-subtle);
    border-bottom: 1px solid var(--border);
}

.nav-menu-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    color: var(--text-primary);
}

.nav-menu-brand-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.nav-menu-brand-text {
    flex: 1;
}

.nav-menu-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.nav-menu-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
    line-height: 1.4;
}

/* Navigation List */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-section-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.nav-item {
    display: block;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    min-height: var(--touch-target);
}

.nav-link:hover {
    background: var(--bg-secondary);
}

.nav-link:active {
    background: var(--bg-tertiary);
}

.nav-link.active {
    background: var(--bg-gradient-subtle);
    color: var(--primary);
    font-weight: 700;
    position: relative;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-link-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-link-icon svg {
    width: 20px;
    height: 20px;
}

.nav-link-text {
    flex: 1;
}

.nav-link-label {
    font-size: 16px;
    line-height: 1.4;
    display: block;
    font-weight: 700;
}

.nav-link-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 3px;
    display: block;
    line-height: 1.4;
    font-weight: 600;
    opacity: 0.9;
    letter-spacing: 0.01em; /* Slight spacing for clarity */
}

.nav-link-badge {
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 700 !important; /* EMERGENCY FIX: Bold badges */
    padding: 3px 8px;
    border-radius: var(--radius-full);
    margin-left: auto;
}

/* Footer Links in Menu */
.nav-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.nav-footer-links {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.nav-footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.nav-footer-link:hover {
    color: var(--primary);
}

.nav-footer-copyright {
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Overlay for Mobile Menu */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   TABLET STYLES (768px and up)
   ============================================ */
@media (min-width: 768px) {
    .nav-header {
        padding: 0 var(--spacing-lg);
    }
    
    .nav-menu {
        width: 320px;
    }
    
    .nav-brand {
        font-size: 20px;
    }
    
    .nav-brand-icon {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   DESKTOP STYLES (1024px and up)
   ============================================ */
@media (min-width: 1024px) {
    .nav-header {
        padding: 0 var(--spacing-xl);
        max-width: 1200px;
        margin: 0 auto;
        position: relative;
        left: 0;
        right: 0;
    }
    
    /* Hide mobile elements */
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-overlay {
        display: none;
    }
    
    /* Show desktop navigation */
    .nav-desktop {
        display: flex;
    }
    
    .nav-cta {
        display: block;
    }
    
    /* Desktop specific styling */
    .nav-brand-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav-brand {
        font-size: 22px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

/* Smooth transitions for menu items */
.nav-menu.active .nav-link {
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
}

.nav-menu.active .nav-link:nth-child(1) { animation-delay: 0.05s; }
.nav-menu.active .nav-link:nth-child(2) { animation-delay: 0.1s; }
.nav-menu.active .nav-link:nth-child(3) { animation-delay: 0.15s; }
.nav-menu.active .nav-link:nth-child(4) { animation-delay: 0.2s; }
.nav-menu.active .nav-link:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .nav-menu,
    .nav-overlay,
    .nav-toggle svg,
    .nav-link {
        transition: none;
        animation: none;
    }
}

/* Focus styles */
.nav-toggle:focus-visible,
.nav-link:focus-visible,
.nav-desktop-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip navigation link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 1001;
}

.skip-nav:focus {
    top: var(--spacing-sm);
}
/* Language Switcher Styles */
.language-switcher-container {
    position: relative;
    margin-left: 12px;
}

.language-switcher-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.language-switcher-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.language-switcher-button.open {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-name {
    font-weight: 500;
}

.lang-arrow {
    transition: transform 0.2s;
}

.language-switcher-button.open .lang-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 1000;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.language-option:hover {
    background: var(--bg-secondary);
}

.language-option.active {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.language-option .lang-flag {
    font-size: 20px;
}

/* Mobile floating language switcher */
.mobile-lang-switcher {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
}

.mobile-lang-switcher .language-switcher-button {
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid var(--primary);
}

.mobile-lang-switcher .language-dropdown {
    bottom: 100%;
    top: auto;
    margin-bottom: 8px;
    margin-top: 0;
}

/* Hide on mobile by default, show via JS */
@media (max-width: 767px) {
    .nav-header .language-switcher-container {
        display: none;
    }
}

/* Compact desktop language switcher */
@media (min-width: 1024px) {
    .language-switcher-container {
        margin-left: 8px;
    }
    .language-switcher-button {
        gap: 6px;
        padding: 6px 8px;
    }
    .language-switcher-button .lang-name {
        display: none; /* hide text on desktop to save space */
    }
    .language-switcher-button .lang-flag {
        font-size: 16px;
    }
}
