/* Navigation Component Styles */
/* CSS custom properties aligned with design system */
:root {
    --mobile-breakpoint: 768px;

    /* Design System Colors */
    --navigation-bg: #f8f9fc;
    --primary-color: #0066cc;
    --primary-color-rgb: 0, 102, 204; /* Matches #0066cc for use in rgba() */
    --primary-hover: #0052a3;
    --accent-color: #10b981;

    /* Text Colors from Design System */
    --text-color-primary: #1f2937;
    --text-color-secondary: #4b5563;
    --text-color-tertiary: #6b7280;

    /* Legacy compatibility */
    --text-color: #1f2937;
    --text-color-light: #6b7280;

    /* Backgrounds */
    --background-overlay: rgba(0, 0, 0, 0.5);
    --menu-bg-mobile: #ffffff;

    /* Borders & Shadows */
    --border-color: #e1e8f0;
    --shadow-light: 0 2px 4px rgba(var(--primary-color-rgb), 0.08);
    --shadow-medium: 0 4px 16px rgba(var(--primary-color-rgb), 0.12);

    /* Spacing */
    --container-max-width: 1200px;
    --spacing-sm: 8px;
    --spacing-md: 20px;
    --spacing-lg: 30px;

    /* Hamburger Menu Dimensions (WCAG Accessibility) */
    --hamburger-touch-target: 44px; /* WCAG 2.1 Level AAA touch target */
    --hamburger-padding: 8px;
    --hamburger-line-width: 28px;
    --hamburger-line-height: 2.5px;

    /* Typography from Design System */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

.navigation {
    position: relative;
    padding: var(--spacing-md);
    background: var(--navigation-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.navigation-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Navigation logo styles */
.nav-logo {
    flex-shrink: 0;
}

.logo-link {
    display: block;
    text-decoration: none;
}

.nav-logo-image {
    height: 50px;
    max-width: 250px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.logo-link:hover .nav-logo-image {
    opacity: 0.8;
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: var(--hamburger-touch-target);
    height: var(--hamburger-touch-target);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--hamburger-padding);
    box-sizing: border-box;
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-line {
    width: var(--hamburger-line-width);
    height: var(--hamburger-line-height);
    background: var(--text-color-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    box-shadow: 0 1px 2px rgba(31, 41, 55, 0.2);
}

/* Hamburger button hover effect */
.hamburger-menu:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.hamburger-menu:hover .hamburger-line {
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(var(--primary-color-rgb), 0.3);
}

/* Hamburger animation when active */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation menu styles */
.nav-menu {
    display: block; /* Visible by default on desktop */
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color-primary);
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: 1rem;
    padding: var(--spacing-sm) 16px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

.nav-link:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* Mobile styles */
@media (max-width: 768px) {
    .navigation {
        padding: 15px var(--spacing-md);
    }
    
    .navigation-container {
        position: relative;
    }
    
    /* Smaller logo on mobile */
    .nav-logo-image {
        height: 40px;
        max-width: 200px;
    }
    
    /* Override desktop display:none with higher specificity */
    .navigation .hamburger-menu {
        display: flex; /* Show hamburger on mobile */
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* Mobile menu overlay */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        /* Fallback background for browsers without backdrop-filter */
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 252, 0.98) 100%);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Apply backdrop blur only if supported for progressive enhancement */
    @supports (backdrop-filter: blur(12px)) {
        .nav-menu {
            backdrop-filter: blur(12px);
        }
    }

    .nav-menu.active {
        transform: translateX(0);
        box-shadow: -4px 0 24px rgba(var(--primary-color-rgb), 0.08);
    }

    .nav-links {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: var(--spacing-lg);
    }

    .nav-link {
        font-family: var(--font-primary);
        font-size: 1.125rem; /* 18px */
        font-weight: var(--font-weight-semibold);
        padding: 16px 24px;
        border: 2px solid var(--border-color);
        background: white;
        color: var(--text-color-primary);
        border-radius: 12px;
        min-width: 220px;
        min-height: 44px; /* WCAG touch target */
        box-shadow: 0 2px 12px rgba(var(--primary-color-rgb), 0.08);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .nav-link:hover,
    .nav-link:active {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
        color: white;
        border-color: var(--primary-color);
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.25);
    }
}

/* Desktop styles - hide mobile menu styles */
@media (min-width: 769px) {
    .navigation-container {
        justify-content: space-between;
    }
    
    .nav-menu {
        display: block;
        position: static;
        background: none;
        transform: none;
    }
    
    .hamburger-menu {
        display: none;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Focus styles for accessibility */
.hamburger-menu:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .navigation .hamburger-menu .hamburger-line {
        background: var(--text-color-primary);
        box-shadow: 0 1px 2px rgba(31, 41, 55, 0.2);
    }

    .navigation .hamburger-menu:hover .hamburger-line {
        background: var(--primary-color);
    }

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

    .nav-link:hover {
        background: rgba(var(--primary-color-rgb), 0.08);
        color: var(--primary-color);
    }
    
    @media (max-width: 768px) {
        .nav-menu {
            background: rgba(0, 0, 0, 0.95);
        }
        
        .nav-link {
            background: #333;
            border-color: #555;
            color: #fff;
        }
        
        .nav-link:hover {
            background: var(--primary-color);
            border-color: var(--primary-color);
        }
    }
}