/* ========================================
   NAVIGATION - Premium Refined Design
   Frosted glass with scroll-aware transitions
   ======================================== */

/* Header Shell - Initial: transparent, blends with hero */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(
        180deg,
        rgba(240, 247, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition:
        background 0.4s ease,
        backdrop-filter 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease;
    animation: slideInFromTop 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scrolled: Frosted glass materializes */
.header.scrolled {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(250, 252, 255, 0.88) 100%
    );
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid rgba(167, 109, 93, 0.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 4px 20px rgba(91, 58, 41, 0.06),
        0 8px 40px rgba(91, 58, 41, 0.03);
}

.header .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .header .container {
        padding: 0 20px;
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
    padding: 12px 0;
}

@media (max-width: 768px) {
    .header-inner {
        height: 76px;
        padding: 10px 0;
    }
}

/* ========================================
   LOGO - Text-based brand mark
   Matches hero styling: First (regular) + BabyLook (italic, colored)
   ======================================== */
.header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.header .logo:hover {
    opacity: 0.85;
}

/* Hide the old logo image */
.header .logo-img {
    display: none;
}

/* Text logo container */
.header .logo-text {
    display: flex;
    align-items: baseline;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* "First" part - regular weight, navy color */
.header .logo-text .logo-first {
    color: #3d2e28;
}

/* "BabyLook" part - italic, warm accent */
.header .logo-text .logo-babylook {
    font-style: italic;
    color: #A76D5D;
}

@media (max-width: 480px) {
    .header .logo-text {
        font-size: 1.25rem;
    }
}


/* ========================================
   MAIN NAVIGATION - Scroll links with underline hover
   Distinct from page navigation buttons
   ======================================== */
.header .nav {
    display: none;
    align-items: center;
    gap: 8px;
}

@media (min-width: 1024px) {
    .header .nav {
        display: flex;
    }
}

/* Nav item - underline hover for scroll links */
.header .nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #5a4a42;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

/* Underline animation */
.header .nav a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #5B3A29;
    border-radius: 1px;
    transition: width 0.25s ease;
}

.header .nav a:hover {
    color: #5B3A29;
}

.header .nav a:hover::after {
    width: 100%;
}

/* Nav icon styling */
.header .nav a .nav-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    opacity: 0.6;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.header .nav a:hover .nav-icon {
    opacity: 1;
}

/* ========================================
   HEADER ACTIONS - Unified button styling
   All action buttons have same size and weight
   ======================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: #e6ddd6;
    margin: 0 4px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Shared button base for all header action items */
.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #5B3A29;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    background: #F9E8D2;
    color: #A76D5D;
}

.header-action-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    opacity: 0.7;
    flex-shrink: 0;
}

.header-action-btn:hover svg {
    opacity: 1;
}

/* Language Switch */
.lang-switch {
    position: relative;
    display: none;
}

@media (min-width: 900px) {
    .lang-switch {
        display: block;
    }
}

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b5d55;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lang-switch-btn:hover {
    color: #5B3A29;
}

.lang-switch.active .lang-switch-btn {
    color: #5B3A29;
}

.lang-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    opacity: 0.7;
}

.lang-switch-btn:hover .lang-icon,
.lang-switch.active .lang-icon {
    opacity: 1;
}

.lang-current {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.lang-chevron {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.lang-switch.active .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 150px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(91, 58, 41, 0.04),
                0 12px 32px rgba(91, 58, 41, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100;
    overflow: hidden;
    border: 1px solid rgba(91, 58, 41, 0.06);
}

.lang-switch.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: transparent;
    border: none;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #5a4a42;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-option:hover {
    background: #fdf6ef;
    color: #5B3A29;
}

.lang-option.active {
    background: rgba(167, 109, 93, 0.08);
    color: #5B3A29;
    font-weight: 600;
}

/* Auth Container - use display:contents so children are direct flex items */
.auth-container {
    display: none;
}

@media (min-width: 640px) {
    .auth-container {
        display: contents;
    }
}

/* When loading, hide the individual buttons instead */
.auth-container.auth-loading .auth-btn,
.auth-container.auth-loading .auth-dashboard-btn,
.auth-container.auth-loading .auth-account-wrapper {
    visibility: hidden;
}

/* Auth Buttons - Unified sizing with all header buttons */
.auth-btn,
.auth-dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #5B3A29;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover:not(:disabled),
.auth-dashboard-btn:hover {
    background: #F9E8D2;
    color: #A76D5D;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-dashboard-btn svg,
.auth-account-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    opacity: 0.7;
}

.auth-btn:hover svg,
.auth-dashboard-btn:hover svg {
    opacity: 1;
}

/* New Generation Button - sage green primary action */
.auth-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    background: linear-gradient(135deg, #8ba48b 0%, #6b8e6b 100%);
    border: none;
    border-radius: 18px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(107, 142, 107, 0.3);
}

.auth-new-btn:hover {
    background: linear-gradient(135deg, #7a937a 0%, #5a7d5a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 142, 107, 0.4);
}

.auth-new-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* Hide text on smaller screens, show only + icon */
@media (max-width: 900px) {
    .auth-new-btn span {
        display: none;
    }
    .auth-new-btn {
        width: 36px;
        padding: 0;
        justify-content: center;
    }
}

/* Account wrapper and dropdown */
.auth-account-wrapper {
    position: relative;
}

.auth-account-btn.active {
    background: #F9E8D2;
    color: #A76D5D;
}

.auth-chevron {
    width: 14px !important;
    height: 14px !important;
    margin-left: -2px;
    transition: transform 0.2s ease;
}

.auth-account-btn.active .auth-chevron {
    transform: rotate(180deg);
}

.auth-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(91, 58, 41, 0.15);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid rgba(91, 58, 41, 0.08);
}

[dir="rtl"] .auth-dropdown {
    right: auto;
    left: 0;
}

.auth-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.auth-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5a4a42;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

[dir="rtl"] .auth-dropdown-item {
    text-align: right;
}

.auth-dropdown-item:hover {
    background: #fdf6ef;
    color: #5B3A29;
}

.auth-dropdown-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    flex-shrink: 0;
}

.auth-dropdown-item:hover svg {
    opacity: 1;
}

.auth-dropdown-signout {
    color: #a85454;
}

.auth-dropdown-signout:hover {
    background: #fff5f5;
    color: #8b3a3a;
}

/* Clerk user button no longer used - using custom dropdown */

/* ========================================
   PRIMARY CTA - The star of the show
   Consistent height with nav items, premium gradient
   ======================================== */
.header-cta {
    display: none;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px;
    background: linear-gradient(135deg, #A76D5D 0%, #5B3A29 100%);
    border: none;
    border-radius: 20px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(167, 109, 93, 0.25);
    margin-left: 8px;
}

@media (min-width: 768px) {
    .header-cta {
        display: flex;
    }
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 109, 93, 0.35);
    background: linear-gradient(135deg, #2563a8 0%, #1a4178 100%);
}

.header-cta:active {
    transform: translateY(0);
}

/* ========================================
   MOBILE MENU BUTTON
   ======================================== */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #fdf6ef;
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #5B3A29;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* ========================================
   MOBILE NAVIGATION
   ======================================== */
.mobile-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: white;
    padding: 16px 20px 24px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(91, 58, 41, 0.1);
    z-index: 999;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

.mobile-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav > a {
    display: block;
    padding: 16px 0;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #5B3A29;
    text-decoration: none;
    border-bottom: 1px solid #e6ddd6;
    transition: color 0.2s ease;
}

.mobile-nav > a:hover {
    color: #A76D5D;
}

.mobile-nav-dashboard {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Language Switch */
.mobile-lang-switch {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    border-bottom: 1px solid #e6ddd6;
}

.mobile-lang-btn {
    flex: 1;
    padding: 12px 16px;
    background: #F9E8D2;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #5B3A29;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-lang-btn.active {
    background: linear-gradient(135deg, #A76D5D 0%, #5B3A29 100%);
    color: white;
}

.mobile-lang-btn:hover:not(.active) {
    background: #fdf6ef;
}

/* Mobile CTA */
.mobile-nav .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #A76D5D 0%, #5B3A29 100%);
    border: none;
    border-radius: 14px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(167, 109, 93, 0.25);
}

