/* ═══════════════════════════════════════════════════════════════════════
   Navigation v2 — Floating glassmorphic pill
   Inspired by homepage v6 Raycast aesthetic, adapted for light pages
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --nav-height: 56px;
    --nav-height-mobile: 48px;
    --nav-pill-bg: rgba(255, 255, 255, 0.82);
    --nav-pill-bg-scrolled: rgba(255, 255, 255, 0.96);
    --nav-pill-border: rgba(0, 0, 0, 0.06);
    --nav-pill-border-scrolled: rgba(0, 0, 0, 0.1);
    --nav-text: #475569;
    --nav-text-hover: #0f172a;
    --nav-accent: #2563eb;
    --nav-accent2: #7c3aed;
    --nav-cta-bg: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --nav-cta-text: #fff;
    --nav-radius: 16px;
    --nav-shadow: 0 2px 16px rgba(0, 0, 0, 0.06),
                  0 1px 3px rgba(0, 0, 0, 0.04);
    --nav-shadow-scrolled: 0 4px 24px rgba(0, 0, 0, 0.1),
                           0 1px 3px rgba(0, 0, 0, 0.06);
    --nav-font: 'DM Sans', system-ui, -apple-system, sans-serif;
    --nav-offset: calc(var(--nav-height) + 20px);
}


/* ════════════════════════════════════════════════════════════════
   1. HEADER — transparent positioning wrapper
   ════════════════════════════════════════════════════════════════ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Above page chrome (e.g. .filter-backdrop z-index 999) so login modal and
       mobile nav stay clickable; below cookie banner / marketing popups (~99997+). */
    z-index: 1100;
    padding: 8px 16px 0;
    background: none;
    border: none;
    box-shadow: none;
    pointer-events: none;
    height: auto;
    display: block;
}


/* ════════════════════════════════════════════════════════════════
   2. NAV PILL — the floating bar
   ════════════════════════════════════════════════════════════════ */
.nav-pill {
    display: flex;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    height: var(--nav-height);
    padding: 0 28px;
    background: var(--nav-pill-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--nav-pill-border);
    border-radius: var(--nav-radius);
    box-shadow: var(--nav-shadow);
    pointer-events: auto;
    font-family: var(--nav-font);
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Scroll state */
.header.is-scrolled .nav-pill {
    background: var(--nav-pill-bg-scrolled);
    box-shadow: var(--nav-shadow-scrolled);
    border-color: var(--nav-pill-border-scrolled);
}


/* ════════════════════════════════════════════════════════════════
   3. LOGO
   ════════════════════════════════════════════════════════════════ */
.nav-pill__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    margin-right: 2rem;
}
.nav-pill__logo img {
    height: 34px;
    width: auto;
    display: block;
    transition: opacity 0.2s ease;
}
.nav-pill__logo:hover img {
    opacity: 0.75;
}


/* ════════════════════════════════════════════════════════════════
   4. DESKTOP LINKS — centered
   ════════════════════════════════════════════════════════════════ */
.nav-pill__links {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nav-pill__link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.95rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 9px;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.nav-pill__link:hover {
    color: var(--nav-text-hover);
    background: rgba(0, 0, 0, 0.04);
}


/* ════════════════════════════════════════════════════════════════
   5. ACTIONS — right side
   ════════════════════════════════════════════════════════════════ */
.nav-pill__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 2rem;
}

/* Log in text link */
.nav-pill__login {
    color: var(--nav-text) !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
}
.nav-pill__login:hover {
    color: var(--nav-text-hover) !important;
    background: none !important;
}

/* Get started CTA */
.nav-pill__cta {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.3rem;
    background: var(--nav-cta-bg);
    color: var(--nav-cta-text);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    white-space: nowrap;
    font-family: var(--nav-font);
}
.nav-pill__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
    filter: brightness(1.08);
}

/* User avatar */
.nav-pill__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--nav-cta-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: var(--nav-font);
}
.nav-pill__avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}


/* ════════════════════════════════════════════════════════════════
   6. MOBILE MENU BUTTON
   ════════════════════════════════════════════════════════════════ */
.nav-pill__mobile-btn {
    width: 40px;
    height: 40px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    background: transparent;
    position: relative;
    z-index: 200;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
}

.nav-pill__burger {
    display: block;
    position: relative;
    width: 20px;
    height: 2px;
    background-color: #475569;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.nav-pill__burger::before,
.nav-pill__burger::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #475569;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.nav-pill__burger::before { transform: translateY(-6px); }
.nav-pill__burger::after  { transform: translateY(6px); }

/* Burger → X */
.nav-pill__mobile-btn.active .nav-pill__burger {
    background-color: transparent;
}
.nav-pill__mobile-btn.active .nav-pill__burger::before {
    transform: translateY(0) rotate(45deg);
}
.nav-pill__mobile-btn.active .nav-pill__burger::after {
    transform: translateY(0) rotate(-45deg);
}


/* ════════════════════════════════════════════════════════════════
   7. MOBILE NAVIGATION — slide-in panel
   ════════════════════════════════════════════════════════════════ */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06),
                -16px 0 48px rgba(0, 0, 0, 0.03);
    font-family: var(--nav-font);
    pointer-events: auto;
}
.mobile-nav.active {
    transform: translateX(0);
}

/* Header */
.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.mobile-logo img { height: 32px; }

.close-menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.close-menu-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Scrollable body */
.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mobile-nav-body::-webkit-scrollbar { display: none; }

/* User card */
.mobile-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(37, 99, 235, 0.08);
}
.mobile-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}
.mobile-user-info { flex: 1; min-width: 0; }
.mobile-user-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 1px;
    line-height: 1.3;
}
.mobile-user-email {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quick actions */
.mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.mobile-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: #fafbfc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-quick-action i {
    font-size: 18px;
    color: var(--nav-accent);
}
.mobile-quick-action:hover,
.mobile-quick-action:active {
    background: #eef2ff;
    border-color: rgba(37, 99, 235, 0.15);
    color: var(--nav-accent);
}

/* Auth section */
.mobile-auth-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.mobile-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-auth-primary {
    background: var(--nav-cta-bg);
    color: #ffffff;
    border: none;
}
.mobile-auth-primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.mobile-auth-secondary {
    background: transparent;
    color: var(--nav-accent);
    border: 1.5px solid var(--nav-accent);
}
.mobile-auth-secondary:hover {
    background: rgba(37, 99, 235, 0.05);
}
.mobile-auth-divider {
    text-align: center;
    position: relative;
    margin: 4px 0;
}
.mobile-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}
.mobile-auth-divider span {
    position: relative;
    background: #ffffff;
    padding: 0 12px;
    color: #94a3b8;
    font-size: 12px;
}
.mobile-auth-google {
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.mobile-auth-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Nav sections */
.mobile-nav-section { margin-bottom: 20px; }
.mobile-nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 4px;
    margin-bottom: 8px;
}

/* Nav items */
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item:hover,
.mobile-nav-item:active {
    background: #f8fafc;
    color: var(--nav-accent);
}
.mobile-nav-item i:first-child {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: #64748b;
    transition: color 0.12s ease;
}
.mobile-nav-item:hover i:first-child {
    color: var(--nav-accent);
}
.mobile-nav-item span { flex: 1; }
.mobile-nav-arrow {
    font-size: 10px !important;
    color: #cbd5e1 !important;
    width: auto !important;
}

/* Footer */
.mobile-nav-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-footer-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.mobile-footer-link i { font-size: 13px; }
.mobile-footer-link:hover {
    background: #f8fafc;
    color: #334155;
}
.mobile-footer-logout:hover {
    background: #fef2f2;
    color: #ef4444;
}
.mobile-footer-logout:hover i {
    color: #ef4444;
}


/* ════════════════════════════════════════════════════════════════
   8. OVERLAY
   ════════════════════════════════════════════════════════════════ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}
.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ════════════════════════════════════════════════════════════════
   9. CONTENT OFFSET — push below fixed nav
   ════════════════════════════════════════════════════════════════ */
.main-content {
    padding-top: var(--nav-offset);
}


/* ════════════════════════════════════════════════════════════════
   10. RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .nav-pill__links,
    .nav-pill__actions {
        display: none;
    }
    .nav-pill__mobile-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-offset: calc(var(--nav-height-mobile) + 14px);
    }
    .header {
        padding: 6px 10px 0;
    }
    .nav-pill {
        height: var(--nav-height-mobile);
        padding: 0 18px;
        border-radius: 14px;
    }
    .nav-pill__logo img {
        height: 28px;
    }
}

@media (max-width: 400px) {
    .mobile-nav {
        width: 100%;
        max-width: 100vw;
    }
    .mobile-quick-actions { gap: 6px; }
    .mobile-quick-action {
        padding: 12px 6px;
        font-size: 10px;
    }
    .mobile-quick-action i { font-size: 16px; }
}

@media (min-width: 1025px) {
    .mobile-nav,
    .nav-pill__mobile-btn {
        display: none !important;
    }
}

/* Large-screen nav scaling — keep the floating pill proportional on big displays */
@media (min-width: 1920px) {
    .nav-pill { max-width: 1760px; }
}
@media (min-width: 2400px) {
    .nav-pill { max-width: 1960px; }
}
