/* ==========================================================================
   SCALE — UNIFIED HEADER
   The same glassmorphic pill header used on the marketing home page,
   rendered by Scale_AI_Header::render() on every plugin page (login,
   signup, pricing, dashboard, setup wizard, etc).

   Scoped to .s-header* / .s-mobile* so theme styles can't leak in or out.
   ========================================================================== */

:root {
    --sh-navy:   #131f2f;
    --sh-navy-2: #0e1825;
    --sh-pink:   #ff5b8d;
    --sh-cream:  #ead6c6;
    --sh-steel:  #85a2b3;
}

/* The header gets injected at the top of the shortcode markup; it's a fixed
   pill that floats over whatever else is on the page. We use position:fixed
   (not position:absolute) so it stays visible while the rest of the page
   scrolls — same behavior as the home page. */
.s-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 1280px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 24px;
    z-index: 9999;
    border-radius: 100px;
    background: rgba(19, 31, 47, 0.45);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(234, 214, 198, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(234, 214, 198, 0.08);
    transition: background 0.4s ease, border-color 0.4s ease;
    font-family: 'Inter Tight', system-ui, -apple-system, Segoe UI, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* When the user has scrolled away from the very top, we tighten the glass
   so the bar reads as "active / over content". */
.s-header.is-scrolled {
    background: rgba(14, 24, 37, 0.78);
    border-color: rgba(234, 214, 198, 0.14);
}

/* When the page is using the cream-canvas plugin theme (most plugin pages
   do — see scale-theme.css), the header sits over a light background.
   We slightly bump the navy opacity so the contrast stays crisp. */
body.scale-cream-bg .s-header {
    background: rgba(19, 31, 47, 0.85);
    border-color: rgba(19, 31, 47, 0.18);
    box-shadow:
        0 12px 36px rgba(19, 31, 47, 0.18),
        inset 0 1px 0 rgba(234, 214, 198, 0.08);
}

.s-header__logo {
    display: inline-flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
    text-decoration: none;
}

.s-header__logo-img {
    width: 110px;
    height: auto;
    display: block;
    object-fit: contain;
}

.s-header__nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
}

.s-header__menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.s-header__menu a {
    color: var(--sh-cream);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 100px;
    position: relative;
    transition: color 0.3s ease;
    display: inline-block;
}

/* Soft hover pill — same animation curve as the marketing site. */
.s-header__menu a::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 100px;
    background: rgba(234, 214, 198, 0.10);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.s-header__menu a:hover::before {
    opacity: 1;
    transform: scale(1);
}
.s-header__menu a span {
    position: relative;
    z-index: 1;
}

.s-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--sh-pink);
    color: var(--sh-navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.3s ease;
    flex-shrink: 0;
}
.s-header__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 91, 141, 0.4);
}
.s-header__cta svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}
.s-header__cta:hover svg {
    transform: translateX(3px);
}

/* Hamburger — hidden on desktop, visible below 1024px. */
.s-header__toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}
.s-header__toggle span {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 1.5px;
    background: var(--sh-cream);
    border-radius: 2px;
    transition: top 0.4s cubic-bezier(0.7, 0, 0.2, 1),
                opacity 0.4s ease,
                transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
}
.s-header__toggle span:nth-child(1) { top: 17px; }
.s-header__toggle span:nth-child(2) { top: 22px; }
.s-header__toggle span:nth-child(3) { top: 27px; }

.s-header__toggle.is-open span:nth-child(1) {
    top: 22px;
    transform: rotate(45deg);
}
.s-header__toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
}
.s-header__toggle.is-open span:nth-child(3) {
    top: 22px;
    transform: rotate(-45deg);
}

/* ---- Mobile drawer ---- */
.s-mobile {
    position: fixed;
    inset: 0;
    background: rgba(14, 24, 37, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    font-family: 'Inter Tight', system-ui, sans-serif;
}
.s-mobile.is-open {
    opacity: 1;
    pointer-events: auto;
}
.s-mobile__inner { text-align: center; padding: 24px; }
.s-mobile__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.s-mobile__list li {
    margin: 8px 0;
    overflow: hidden;
}
.s-mobile__list a {
    display: inline-block;
    color: var(--sh-cream);
    text-decoration: none;
    font-size: 32px;
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    padding: 8px 0;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1),
                color 0.3s ease;
}
.s-mobile.is-open .s-mobile__list a { transform: translateY(0); }

.s-mobile__list li:nth-child(1) a { transition-delay: 0.10s; }
.s-mobile__list li:nth-child(2) a { transition-delay: 0.18s; }
.s-mobile__list li:nth-child(3) a { transition-delay: 0.26s; }
.s-mobile__list li:nth-child(4) a { transition-delay: 0.34s; }
.s-mobile__list li:nth-child(5) a { transition-delay: 0.42s; }

.s-mobile__list a:hover { color: var(--sh-pink); }

.s-mobile__cta {
    display: inline-flex;
    margin-top: 32px;
    padding: 14px 32px;
    background: var(--sh-pink);
    color: var(--sh-navy);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}
.s-mobile.is-open .s-mobile__cta {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   PAGE PADDING — the .sa-shell and .scaleai containers handle their own
   top padding inside scale-theme.css so the fixed header doesn't overlap
   their content. We don't add any padding rules from this file.
   ========================================================================== */

/* ==========================================================================
   MOBILE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1023px) {
    .s-header__nav,
    .s-header__cta { display: none; }
    .s-header__toggle { display: block; }

    .s-header {
        padding: 0 8px 0 20px;
        height: 62px;
    }
    .s-header__logo-img { width: 95px; }
}

@media (max-width: 768px) {
    .s-header {
        top: 12px;
        width: calc(100% - 24px);
        height: 58px;
        padding: 0 6px 0 18px;
    }
    .s-header__logo-img { width: 90px; }
    .s-mobile__list a { font-size: 26px; }
}

/* RTL: nudge the toggle's hamburger lines to the visual right edge. */
[dir="rtl"] .s-header__toggle span { left: auto; right: 12px; }
