/*
 * AchieveAI — Shared Site Header & Navigation
 * Used on homepage, blog, and other public theme surfaces.
 */

.landing-header,
.site-header {
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.85rem 0;
    background: rgba(5, 8, 13, 0.78);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(77, 124, 254, 0.12);
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.site-header--fixed {
    position: fixed;
}

.site-header--sticky {
    position: sticky;
    z-index: 9999;
}

.landing-header.scrolled,
.site-header.scrolled {
    padding: 0.55rem 0;
    background: rgba(5, 8, 13, 0.92);
    border-bottom-color: rgba(77, 124, 254, 0.18);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.34);
}

/* Logo */
.landing-header .logo-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1;
    transition: font-size 0.3s ease;
}

.landing-header .logo-achieve { color: #ffffff; }

.landing-header .logo-ai {
    background: linear-gradient(135deg, #4D7CFE, #00ffa2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-header.scrolled .logo-text { font-size: 1.5rem; }

.landing-logo-img {
    transition: width 0.3s ease, height 0.3s ease;
}

.landing-header.scrolled .landing-logo-img {
    width: 1.75rem;
    height: 1.75rem;
}

/* Nav row */
.landing-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Nav links — identical treatment for <a> and <button> */
.landing-header .nav-link,
.site-header .nav-link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 0.9rem;
    margin: 0;
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.landing-header .nav-link:hover,
.landing-header .nav-link:focus-visible,
.site-header .nav-link:hover,
.site-header .nav-link:focus-visible,
.nav-dropdown.is-open .nav-dropdown__trigger {
    color: #e7ecff;
    background: rgba(77, 124, 254, 0.1);
    border-color: rgba(77, 124, 254, 0.28);
    box-shadow: none;
    outline: none;
}

/* Blog dropdown */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown__trigger {
    /* Keep button chrome identical to .nav-link anchors */
    font: inherit;
    color: inherit;
    background: transparent;
}

.nav-dropdown__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.7rem;
    height: 0.7rem;
    font-size: 0.55rem;
    line-height: 1;
    transition: transform 0.22s ease;
    opacity: 0.7;
}

.nav-dropdown.is-open .nav-dropdown__chevron {
    transform: rotate(180deg);
}

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 13.5rem;
    padding: 0.4rem;
    border-radius: 1rem;
    background: rgba(8, 12, 19, 0.96);
    border: 1px solid rgba(77, 124, 254, 0.18);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 20;
}

.nav-dropdown.is-open .nav-dropdown__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown__item {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.72rem;
    color: #cbd5e1;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown__item:hover {
    color: #f8fbff;
    background: rgba(77, 124, 254, 0.1);
}

.nav-dropdown__item-title {
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.2;
}

.nav-dropdown__item-desc {
    font-size: 0.72rem;
    color: #7f8ea3;
    font-weight: 500;
}

.nav-dropdown__item:hover .nav-dropdown__item-desc {
    color: #9fb0c7;
}

/* CTA — no countdown; same height family as nav pills */
.header-cta {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 1.05rem;
    border: 1px solid rgba(203, 244, 232, 0.24);
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(0, 255, 162, 0.96) 0%, rgba(77, 124, 254, 0.95) 100%);
    color: #071017;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow:
        0 10px 24px rgba(77, 124, 254, 0.18),
        0 6px 16px rgba(0, 255, 162, 0.1);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.header-cta__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    white-space: nowrap;
}

.header-cta:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(53, 255, 208, 1) 0%, rgba(111, 150, 255, 0.98) 100%);
    box-shadow:
        0 14px 32px rgba(77, 124, 254, 0.26),
        0 10px 24px rgba(0, 255, 162, 0.14);
}

.header-cta-countdown {
    display: none !important;
}

.mobile-menu-details,
.mobile-header-menu {
    display: none;
}

/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 767px) {
    .landing-header,
    .site-header {
        padding: 0.66rem 0;
        background:
            linear-gradient(180deg, rgba(7, 11, 18, 0.88), rgba(7, 11, 18, 0.74)),
            radial-gradient(circle at 18% 0%, rgba(77, 124, 254, 0.14), transparent 34%),
            radial-gradient(circle at 86% 0%, rgba(0, 255, 162, 0.09), transparent 30%);
        border-bottom: 1px solid rgba(125, 151, 255, 0.14);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(20px) saturate(1.18);
        -webkit-backdrop-filter: blur(20px) saturate(1.18);
    }

    .landing-header.scrolled,
    .site-header.scrolled {
        padding: 0.56rem 0;
        background:
            linear-gradient(180deg, rgba(7, 11, 18, 0.94), rgba(7, 11, 18, 0.86)),
            radial-gradient(circle at 18% 0%, rgba(77, 124, 254, 0.12), transparent 34%);
        border-bottom-color: rgba(77, 124, 254, 0.16);
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    }

    .landing-header__inner {
        position: relative;
        min-height: 3rem;
    }

    .landing-header__inner::before {
        content: '';
        position: absolute;
        left: 1rem;
        right: 1rem;
        bottom: -0.55rem;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(77, 124, 254, 0.32), rgba(0, 255, 162, 0.18), transparent);
        pointer-events: none;
    }

    .landing-logo-link {
        flex-shrink: 0;
    }

    .landing-logo-img,
    .landing-header.scrolled .landing-logo-img {
        width: 2.05rem;
        height: 2.05rem;
    }

    .header-cta {
        min-height: 2.25rem;
        height: 2.25rem;
        padding: 0 0.9rem;
        border-radius: 0.85rem;
        font-size: 0.72rem;
    }

    .header-cta__label {
        font-size: 0.72rem;
    }

    .mobile-menu-details {
        position: relative;
        display: block;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.2rem;
        min-height: 2.2rem;
        padding: 0;
        border-radius: 0.78rem;
        color: #dce7fb;
        background: rgba(77, 124, 254, 0.08);
        border: 1px solid rgba(77, 124, 254, 0.18);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
        line-height: 1;
        transition: border-color 0.2s ease, background 0.2s ease;
        cursor: pointer;
        list-style: none;
    }

    .mobile-menu-toggle::-webkit-details-marker {
        display: none;
    }

    .mobile-menu-details[open] .mobile-menu-toggle {
        background: rgba(77, 124, 254, 0.13);
        border-color: rgba(0, 255, 162, 0.18);
    }

    .mobile-header-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 0.7rem);
        width: min(78vw, 18.5rem);
        display: none;
        flex-direction: column;
        gap: 0.15rem;
        padding: 0.55rem;
        border-radius: 1rem;
        background: rgba(8, 12, 19, 0.96);
        border: 1px solid rgba(77, 124, 254, 0.16);
        box-shadow:
            0 18px 40px rgba(0, 0, 0, 0.34),
            0 0 0 1px rgba(255, 255, 255, 0.025) inset;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 2;
    }

    .mobile-menu-details[open] .mobile-header-menu {
        display: flex;
    }

    .mobile-header-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 2.45rem;
        padding: 0.65rem 0.8rem;
        border-radius: 0.72rem;
        color: #cbd5e1;
        font-size: 0.86rem;
        font-weight: 650;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-header-menu a:hover {
        color: #f8fbff;
        background: rgba(77, 124, 254, 0.09);
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-header,
    .site-header,
    .nav-link,
    .header-cta,
    .nav-dropdown__menu,
    .nav-dropdown__chevron {
        transition: none !important;
    }
}
