/* ============================================
   Life Stage Selector - Glassmorphism Styles
   ============================================ */

/* === OVERLAY BACKDROP === */
.life-stage-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.life-stage-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === MAIN SELECTOR CARD === */
.life-stage-selector {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    width: 90%;
    max-width: 580px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    box-shadow:
        0 8px 32px rgba(0, 71, 171, 0.15),
        0 24px 80px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    padding: 2.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.life-stage-selector.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* === GRADIENT BORDER EFFECT === */
.life-stage-selector::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.6) 0%,
        rgba(0, 71, 171, 0.4) 50%,
        rgba(16, 185, 129, 0.6) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.life-stage-selector:hover::before {
    opacity: 1;
}

/* === FLOATING PARTICLES/BOKEH EFFECT === */
.life-stage-selector::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(0, 71, 171, 0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-3%, 3%) rotate(2deg); }
    50% { transform: translate(-5%, 5%) rotate(0deg); }
    75% { transform: translate(-3%, 3%) rotate(-2deg); }
}

/* === SELECTOR HEADER === */
.life-stage-header {
    text-align: center;
    margin-bottom: 2rem;
}

.life-stage-header .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.6));
        transform: scale(1.05);
    }
}

.life-stage-header h2 {
    font-family: var(--font-display, 'Fraunces', Georgia, serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary, #1F2937);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.life-stage-header p {
    color: var(--color-text-secondary, #64748B);
    font-size: 1rem;
    margin: 0;
}

/* === LIFE STAGE OPTIONS GRID === */
.life-stage-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 480px) {
    .life-stage-options {
        grid-template-columns: 1fr;
    }
}

/* === INDIVIDUAL OPTION CARD === */
.life-stage-option {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    overflow: hidden;
}

.life-stage-option::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--option-color, #3B82F6) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.life-stage-option:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--option-color, #3B82F6);
}

.life-stage-option:hover::before {
    opacity: 0.08;
}

.life-stage-option:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.12);
}

.life-stage-option .option-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.life-stage-option:hover .option-emoji {
    transform: scale(1.15);
}

.life-stage-option .option-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text-primary, #1F2937);
    display: block;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.life-stage-option .option-description {
    font-size: 0.8rem;
    color: var(--color-text-secondary, #64748B);
    position: relative;
    z-index: 1;
}

/* === SELECTED STATE === */
.life-stage-option.selected {
    background: linear-gradient(135deg, var(--option-color, #3B82F6) 0%, color-mix(in srgb, var(--option-color, #3B82F6) 80%, #000) 100%);
    border-color: var(--option-color, #3B82F6);
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 24px color-mix(in srgb, var(--option-color, #3B82F6) 40%, transparent);
}

.life-stage-option.selected .option-label,
.life-stage-option.selected .option-description {
    color: #fff;
}

.life-stage-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: #fff;
    color: var(--option-color, #3B82F6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Option color variations */
.life-stage-option[data-stage="single"] { --option-color: #3B82F6; }
.life-stage-option[data-stage="engaged"] { --option-color: #EC4899; }
.life-stage-option[data-stage="parent"] { --option-color: #10B981; }
.life-stage-option[data-stage="all"] { --option-color: #6366F1; }

/* === CONTINUE BUTTON === */
.life-stage-continue {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary, #0047AB) 0%, var(--color-primary-dark, #003b8e) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.life-stage-continue:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 71, 171, 0.3);
}

.life-stage-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.life-stage-continue::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.life-stage-continue:hover:not(:disabled)::before {
    left: 100%;
}

/* === CELEBRATION CONFETTI === */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--confetti-color, gold);
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* === HEADER BADGE STYLES === */
.life-stage-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-right: 0.75rem;
}

.life-stage-badge.is-hidden {
    display: none;
}

header.scrolled .life-stage-badge {
    display: none;
}

.life-stage-badge:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.life-stage-badge .badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--stage-color, #94A3B8);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
}

.life-stage-badge .badge-label {
    font-weight: 500;
    color: var(--color-text-primary, #1F2937);
}

.life-stage-badge i {
    font-size: 0.65rem;
    color: var(--color-text-tertiary, #94A3B8);
    transition: transform 0.3s ease;
}

.life-stage-badge:hover i {
    transform: translateY(1px);
}

/* === HEADER DROPDOWN === */
.life-stage-dropdown {
    position: fixed;
    z-index: 10001;
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 8px 48px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    min-width: 180px;
    animation: dropdown-appear 0.2s ease-out;
}

@keyframes dropdown-appear {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.life-stage-dropdown .dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    text-align: left;
}

.life-stage-dropdown .dropdown-option:hover {
    background: var(--color-light-gray, #F5F7FA);
}

.life-stage-dropdown .dropdown-option.active {
    background: var(--color-primary-pale, #E6F0FF);
}

.life-stage-dropdown .dropdown-option .option-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--stage-color, #94A3B8);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.life-stage-dropdown .dropdown-option .option-label {
    flex: 1;
    font-weight: 500;
    color: var(--color-text-primary, #1F2937);
}

.life-stage-dropdown .dropdown-option i {
    color: var(--color-success, #10B981);
    font-size: 0.8rem;
}

/* === DARK MODE SUPPORT === */
body.dark-mode .life-stage-selector {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .life-stage-header h2 {
    color: var(--dark-text-primary, #f0f4f8);
}

body.dark-mode .life-stage-header p {
    color: var(--dark-text-secondary, #b8c5d6);
}

body.dark-mode .life-stage-option {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .life-stage-option .option-label {
    color: var(--dark-text-primary, #f0f4f8);
}

body.dark-mode .life-stage-option .option-description {
    color: var(--dark-text-secondary, #b8c5d6);
}

body.dark-mode .life-stage-badge {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .life-stage-badge .badge-label {
    color: var(--dark-text-primary, #f0f4f8);
}

body.dark-mode .life-stage-dropdown {
    background: var(--dark-bg-elevated, #1f2937);
}

body.dark-mode .life-stage-dropdown .dropdown-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .life-stage-dropdown .dropdown-option.active {
    background: rgba(91, 159, 255, 0.15);
}

body.dark-mode .life-stage-dropdown .dropdown-option .option-label {
    color: var(--dark-text-primary, #f0f4f8);
}

/* === HERO HIGHLIGHT STYLES === */
.hero h1 .highlight {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 5px;
    width: 100%;
    height: 8px;
    background: var(--primary);
    opacity: 0.1;
    z-index: -1;
    border-radius: 4px;
}

body.dark-mode .hero h1 .highlight {
    text-shadow: 0 2px 18px rgba(91, 159, 255, 0.28);
}

body.dark-mode .hero h1 .highlight::after {
    opacity: 0.22;
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .life-stage-selector,
    .life-stage-option,
    .life-stage-continue,
    .life-stage-badge,
    .confetti {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .life-stage-selector::after {
        animation: none;
    }

    .life-stage-header .icon {
        animation: none;
    }
}

/* === MOBILE RESPONSIVE === */

/* MOBILE: Hide life stage selector completely - show all content by default */
@media (max-width: 768px) {
    /* Hide the navbar badge/dropdown entirely on mobile */
    .life-stage-badge {
        display: none !important;
    }

    /* Hide the dropdown if somehow shown */
    .life-stage-dropdown {
        display: none !important;
    }

    /* Hide the selector modal on mobile */
    .life-stage-selector,
    .life-stage-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .life-stage-selector {
        padding: 1.75rem 1.25rem;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .life-stage-header h2 {
        font-size: 1.5rem;
    }

    .life-stage-header .icon {
        font-size: 2rem;
    }

    .life-stage-option {
        padding: 1rem 0.75rem;
    }

    .life-stage-option .option-emoji {
        font-size: 1.75rem;
    }

    .life-stage-badge {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* === ACCESSIBILITY FOCUS STYLES === */
.life-stage-option:focus-visible,
.life-stage-continue:focus-visible,
.life-stage-badge:focus-visible {
    outline: 2px solid var(--color-primary, #0047AB);
    outline-offset: 2px;
}
