/* Site Header Component Styles */

.site-header {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo a:hover {
    opacity: 0.9;
}

.logo h1, .logo h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.main-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.main-nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Styles - Enhanced UX */
@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        backdrop-filter: blur(10px);
        background: linear-gradient(135deg, rgba(30, 64, 175, 0.95) 0%, rgba(55, 48, 163, 0.95) 100%);
    }
    
    /* Add padding to body to account for fixed header */
    body {
        padding-top: 70px;
    }

    .header-content {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .logo {
        flex: 1;
    }

    .logo h2 {
        font-size: 1.125rem;
        margin: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 32px;
        height: 32px;
        cursor: pointer;
        padding: 6px;
        border-radius: 6px;
        transition: all 0.2s ease;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }

    .mobile-menu-toggle span {
        width: 18px;
        height: 2px;
        background: white;
        border-radius: 1px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        transform-origin: center;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .main-nav {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1001;
        padding: 80px 0 2rem 0;
        overflow-y: auto;
    }

    .main-nav.mobile-open {
        right: 0;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 1.5rem;
    }

    .main-nav li {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .main-nav a {
        display: flex;
        align-items: center;
        padding: 1rem 1.25rem;
        color: var(--gray-800);
        text-decoration: none;
        border-radius: 12px;
        font-weight: 500;
        font-size: 0.95rem;
        transition: all 0.2s ease;
        border: 2px solid transparent;
        position: relative;
    }

    .main-nav a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--primary-color);
        border-radius: 0 2px 2px 0;
        transform: scaleY(0);
        transition: transform 0.2s ease;
    }

    .main-nav a:hover {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
        color: white;
        transform: translateX(4px);
        border-color: var(--primary-light);
    }

    .main-nav a:hover::before {
        transform: scaleY(1);
    }

    .main-nav a.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-light);
    }

    .main-nav a.active::before {
        transform: scaleY(1);
        background: white;
    }

    /* Mobile nav overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

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

    /* Close button in mobile nav */
    .mobile-nav-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        background: var(--gray-100);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: var(--gray-600);
        transition: all 0.2s ease;
    }

    .mobile-nav-close:hover {
        background: var(--gray-200);
        color: var(--gray-800);
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 0.5rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .logo h2 {
        font-size: 1rem;
    }

    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
        padding: 4px;
    }

    .mobile-menu-toggle span {
        width: 16px;
        height: 2px;
    }

    .main-nav {
        width: 260px;
    }

    .main-nav a {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    body {
        padding-top: 60px;
    }
}

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

/* Smooth header resize on scroll (optional enhancement) */
.site-header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.site-header.scrolled .logo h1 {
    font-size: 1.25rem;
}

/* Desktop Styles - Hide mobile elements */
@media (min-width: 769px) {
    .mobile-nav-close {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .site-header {
        background: #000;
        border-bottom: 2px solid #fff;
    }
    
    .main-nav a {
        border: 1px solid transparent;
    }
    
    .main-nav a:hover,
    .main-nav a.active {
        border-color: #fff;
        background: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .main-nav a,
    .mobile-menu-toggle span,
    .main-nav {
        transition: none;
    }
    
    .main-nav a:hover {
        transform: none;
    }
}