/* ===========================
   Header - Fully Responsive
   =========================== */

.site-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1rem, 3vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* ===========================
   Logo - Fully Responsive
   =========================== */
.logo {
    display: flex;
    align-items: center;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #FF8C1A;
    text-decoration: none;
    letter-spacing: 1px;
    z-index: 1001;
    background: linear-gradient(90deg, #FFB347 0%, #FF8C1A 50%, #FFD580 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.85;
}

.logo-img {
    height: clamp(50px, 8vw, 65px);
    width: auto;
    margin-right: clamp(8px, 2vw, 10px);
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

/* ===========================
   Navigation - Desktop
   =========================== */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 2.2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    text-decoration: none;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 500;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    color: #1e293b;
    letter-spacing: 0.2px;
    position: relative;
    transition: color 0.25s ease;
    padding: 8px 0;
    display: block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Hover underline animation */
.main-nav a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    left: 0;
    bottom: -4px;
    background: linear-gradient(90deg, #007bff, #00b4d8);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    width: 100%;
}

.main-nav a:hover {
    color: #007bff;
}

/* CTA button in navigation */
.main-nav .cta-button {
    background: linear-gradient(135deg, #4285f4, #007bff);
    color: #fff !important;
    padding: clamp(0.5rem, 1.5vw, 0.6rem) clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: all 0.25s ease;
    border: none;
    white-space: nowrap;
}

.main-nav .cta-button::after {
    display: none;
}

.main-nav .cta-button:hover {
    background: linear-gradient(135deg, #007bff, #00b4d8);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

/* ===========================
   Mobile Toggle Button
   =========================== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
}

.nav-bar {
    width: 25px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    display: block;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Animated hamburger to X */
.nav-toggle.active .nav-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active .nav-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .nav-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Tablet & Mobile Navigation (max-width: 960px)
   =========================== */
@media (max-width: 960px) {
    .nav-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: #ffffff;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
        padding: 80px 0 40px 0;
        z-index: 999;
    }

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

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

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .main-nav li:last-child {
        border-bottom: none;
        margin-top: 20px;
    }

    .main-nav a {
        padding: 16px 12px;
        font-size: 1rem;
        width: 100%;
    }

    .main-nav a::after {
        display: none;
    }

    .main-nav .cta-button {
        width: 100%;
        text-align: center;
        display: block;
        padding: 14px 20px;
    }

    /* Overlay backdrop */
    body.nav-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        animation: fadeIn 0.3s ease;
    }

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

/* ===========================
   Small Tablet (max-width: 768px)
   =========================== */
@media (max-width: 768px) {
    .header-container {
        padding: 0.6rem 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-img {
        height: 50px;
    }

    .main-nav {
        width: min(300px, 80vw);
    }
}

/* ===========================
   Mobile (max-width: 480px)
   =========================== */
@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem 0.75rem;
    }

    .logo {
        font-size: 1.125rem;
        letter-spacing: 0.5px;
    }

    .logo-img {
        height: 45px;
        margin-right: 8px;
    }

    .main-nav {
        width: min(280px, 90vw);
        padding: 70px 0 30px 0;
    }

    .main-nav ul {
        padding: 0 16px;
    }

    .main-nav a {
        padding: 14px 10px;
        font-size: 0.95rem;
    }

    .nav-toggle {
        padding: 6px;
    }

    .nav-bar {
        width: 22px;
    }
}

/* ===========================
   Extra Small Mobile (max-width: 360px)
   =========================== */
@media (max-width: 360px) {
    .header-container {
        padding: 0.5rem 0.5rem;
    }

    .logo {
        font-size: 1rem;
    }

    .logo-img {
        height: 40px;
    }

    .main-nav {
        width: 90vw;
    }
}

/* ===========================
   Large Desktop (min-width: 1440px)
   =========================== */
@media (min-width: 1440px) {
    .header-container {
        max-width: 1400px;
    }

    .main-nav ul {
        gap: 2.5rem;
    }

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

/* ===========================
   Sticky Header Enhancement
   =========================== */
.site-header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ===========================
   Touch Device Optimizations
   =========================== */
@media (hover: none) and (pointer: coarse) {
    .main-nav a {
        padding: 16px 12px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .nav-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .main-nav .cta-button {
        min-height: 48px;
    }
}

/* ===========================
   Accessibility Improvements
   =========================== */
.main-nav a:focus,
.nav-toggle:focus,
.logo:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #007bff;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 1002;
}

.skip-link:focus {
    top: 0;
}

/* ===========================
   Reduced Motion
   =========================== */
@media (prefers-reduced-motion: reduce) {
    .main-nav,
    .nav-bar,
    .main-nav a::after,
    .logo-img,
    .main-nav .cta-button {
        transition: none;
    }

    .main-nav.open {
        transition: none;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .site-header {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #000;
    }

    .nav-toggle,
    .main-nav {
        display: none;
    }

    .logo {
        color: #000;
        -webkit-text-fill-color: #000;
    }
}

/* ===========================
   High Contrast Mode
   =========================== */
@media (prefers-contrast: high) {
    .site-header {
        border-bottom: 2px solid #000;
    }

    .main-nav a {
        color: #000;
    }

    .main-nav a:hover {
        text-decoration: underline;
    }
}
