/* ============================================
   BroTiming — Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240, 240, 245, 0.6);
    --text-tertiary: rgba(240, 240, 245, 0.4);
    
    --accent-purple: #6C63FF;
    --accent-pink: #FF6B9D;
    --accent-blue: #4FC3F7;
    --accent-green: #66BB6A;
    --accent-yellow: #FFD54F;
    --accent-orange: #FF8A65;
    --accent-red: #EF5350;
    
    --gradient-primary: linear-gradient(135deg, #6C63FF, #FF6B9D);
    --gradient-green: linear-gradient(135deg, #43A047, #66BB6A);
    --gradient-yellow: linear-gradient(135deg, #F9A825, #FFD54F);
    --gradient-orange: linear-gradient(135deg, #E64A19, #FF8A65);
    --gradient-red: linear-gradient(135deg, #C62828, #EF5350);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Ambient Background --- */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -150px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-pink);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-blue);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.02); }
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    background: var(--bg-card-hover);
}

/* --- Screens --- */
#app {
    position: relative;
    z-index: 1;
}

.screen {
    display: none;
    animation: fadeSlideIn 0.6s ease-out;
}

.screen.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SETUP SCREEN
   ============================================ */
.setup-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    gap: var(--space-xl);
}

.logo-section {
    text-align: center;
    animation: fadeSlideIn 0.8s ease-out;
}

.logo-icon {
    margin-bottom: var(--space-md);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.app-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.app-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: var(--space-xs);
    font-weight: 300;
}

/* Setup Card */
.setup-card {
    width: 100%;
    max-width: 420px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    animation: fadeSlideIn 0.8s ease-out 0.2s both;
}

.setup-step label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.date-input, .text-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.date-input:focus, .text-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

/* Cycle slider */
.cycle-slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.cycle-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    outline: none;
}

.cycle-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.4);
    transition: transform var(--transition-fast);
}

.cycle-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.cycle-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.4);
}

.cycle-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 80px;
    text-align: right;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* Primary Button */
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 16px 32px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-spring), box-shadow var(--transition-base), opacity var(--transition-base);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.45);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Science badge */
.science-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    font-size: 0.8rem;
    color: var(--text-secondary);
    animation: fadeSlideIn 0.8s ease-out 0.4s both;
}

/* ============================================
   DASHBOARD SCREEN
   ============================================ */

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.mini-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.partner-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* Hero Card */
.hero-card {
    margin: var(--space-lg);
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    overflow: hidden;
    position: relative;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.hero-phase-ring {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-day {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.ring-phase {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ring-emoji {
    font-size: 1.5rem;
    margin-top: 4px;
    animation: pulse 2s ease-in-out infinite;
}

.hero-info {
    flex: 1;
}

.hero-score {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-md);
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.score-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    transition: color var(--transition-base);
}

.score-value.score-excellent { color: var(--accent-green); }
.score-value.score-good { color: var(--accent-blue); }
.score-value.score-ok { color: var(--accent-yellow); }
.score-value.score-risky { color: var(--accent-orange); }
.score-value.score-bad { color: var(--accent-red); }

.hero-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Section Headers */
.section-header {
    padding: var(--space-xl) var(--space-lg) var(--space-md);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}

.section-sub {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Question Grid */
.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
    padding: 0 var(--space-lg);
}

.question-card {
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.question-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.question-card:active {
    transform: translateY(0) scale(0.98);
}

.question-card .q-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.question-card .q-title {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
}

.question-card .q-score {
    margin-top: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.question-card .q-mini-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: var(--space-sm);
    overflow: hidden;
}

.question-card .q-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease-out;
}

/* ============================================
   ANSWER MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-xl);
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.modal-emoji {
    font-size: 3rem;
    text-align: center;
    margin-bottom: var(--space-md);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-lg);
}

.modal-score-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    margin-bottom: var(--space-sm);
}

.modal-score-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-score-text {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.modal-verdict {
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    margin: var(--space-md) 0;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    display: inline-block;
    width: 100%;
}

.modal-verdict.verdict-excellent {
    background: rgba(102, 187, 106, 0.15);
    color: var(--accent-green);
}

.modal-verdict.verdict-good {
    background: rgba(79, 195, 247, 0.15);
    color: var(--accent-blue);
}

.modal-verdict.verdict-ok {
    background: rgba(255, 213, 79, 0.15);
    color: var(--accent-yellow);
}

.modal-verdict.verdict-risky {
    background: rgba(255, 138, 101, 0.15);
    color: var(--accent-orange);
}

.modal-verdict.verdict-bad {
    background: rgba(239, 83, 80, 0.15);
    color: var(--accent-red);
}

.modal-explanation {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.modal-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    background: rgba(108, 99, 255, 0.08) !important;
    border-color: rgba(108, 99, 255, 0.2) !important;
}

.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.modal-tip p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-best-days h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.best-days-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.best-day-chip {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(102, 187, 106, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(102, 187, 106, 0.25);
    display: flex;
    align-items: center;
    gap: 6px;
}

.best-day-chip:hover {
    background: rgba(102, 187, 106, 0.25);
}

.remind-me-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remind-me-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   CALENDAR
   ============================================ */
.calendar-container {
    margin: 0 var(--space-lg) var(--space-lg);
    padding: var(--space-lg);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.cal-month-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-width: 380px;
    margin: 0 auto;
}

.cal-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    padding: var(--space-sm) 0;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: default;
    position: relative;
    transition: all var(--transition-fast);
}

.cal-day:not(.empty) {
    cursor: pointer;
}

.cal-day.empty {
    visibility: hidden;
}

.cal-day.today {
    outline: 2px dashed var(--accent-purple);
    outline-offset: -2px;
    font-weight: 700;
}

.cal-day.selected {
    box-shadow: 0 0 0 2px var(--accent-pink), 0 4px 12px rgba(255, 107, 157, 0.4);
    font-weight: 800;
    transform: scale(1.1);
    z-index: 2;
}

/* Date Info Bar when selecting past/future dates */
.date-info-bar {
    margin: var(--space-md) var(--space-lg) 0;
    padding: 12px var(--space-md);
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    animation: fadeSlideIn 0.3s ease-out;
}

.date-info-bar span strong {
    color: var(--accent-pink);
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-display);
    text-decoration: none;
    transition: color var(--transition-fast);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(79, 195, 247, 0.1);
}

.text-btn:hover {
    color: var(--text-primary);
    background: rgba(79, 195, 247, 0.2);
}


.cal-day.phase-menstruation {
    background: rgba(156, 39, 176, 0.2);
    color: #CE93D8;
}

.cal-day.phase-early-follicular {
    background: rgba(102, 187, 106, 0.12);
    color: #A5D6A7;
}

.cal-day.phase-follicular {
    background: rgba(102, 187, 106, 0.25);
    color: var(--accent-green);
}

.cal-day.phase-ovulation {
    background: rgba(102, 187, 106, 0.35);
    color: #81C784;
    font-weight: 700;
}

.cal-day.phase-early-luteal {
    background: rgba(255, 213, 79, 0.2);
    color: var(--accent-yellow);
}

.cal-day.phase-mid-luteal {
    background: rgba(255, 138, 101, 0.2);
    color: var(--accent-orange);
}

.cal-day.phase-pms {
    background: rgba(239, 83, 80, 0.2);
    color: var(--accent-red);
}

.cal-day.phase-pp1 {
    background: rgba(211, 47, 47, 0.2);
    color: #EF5350;
}

.cal-day.phase-pp2 {
    background: rgba(245, 124, 0, 0.2);
    color: #FF9800;
}

.cal-day.phase-pp3 {
    background: rgba(251, 192, 45, 0.2);
    color: #FDD835;
}

.cal-day:hover:not(.empty) {
    transform: scale(1.15);
    z-index: 2;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.green { background: var(--accent-green); }
.legend-dot.yellow { background: var(--accent-yellow); }
.legend-dot.orange { background: var(--accent-orange); }
.legend-dot.red { background: var(--accent-red); }
.legend-dot.purple { background: #CE93D8; }

/* ============================================
   SCIENCE CARDS
   ============================================ */
.science-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
    padding: 0 var(--space-lg);
}

.science-card {
    padding: var(--space-lg);
    transition: transform var(--transition-spring);
}

.science-card:hover {
    transform: translateY(-4px);
}

.sci-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.science-card h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.science-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.science-card cite {
    display: block;
    margin-top: var(--space-sm);
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.doi-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.68rem;
    color: var(--accent-blue);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.doi-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Hormone Chart */
.hormone-chart {
    margin: 0 var(--space-lg) var(--space-lg);
    padding: var(--space-lg);
}

.hormone-chart canvas {
    width: 100%;
    height: auto;
    display: block;
}

.hormone-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-md);
    justify-content: center;
}

.h-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.h-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Disclaimer */
.disclaimer {
    margin: var(--space-xl) var(--space-lg);
    padding: var(--space-lg);
    border-color: rgba(255, 213, 79, 0.2) !important;
    background: rgba(255, 213, 79, 0.05) !important;
}

.disclaimer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* ============================================
   EMPATHY CARD
   ============================================ */
.empathy-card {
    margin: 0 var(--space-lg) var(--space-md);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.empathy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF6B9D, #6C63FF);
    opacity: 0.5;
}

.empathy-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.empathy-header h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
}

.empathy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.empathy-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.empathy-item .emp-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.empathy-item .emp-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.sms-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 107, 157, 0.1);
    border: 1px solid rgba(255, 107, 157, 0.3);
    color: var(--accent-pink);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sms-btn:hover {
    background: rgba(255, 107, 157, 0.2);
    border-color: rgba(255, 107, 157, 0.5);
    transform: translateY(-2px);
}

/* ============================================
   PLUS POINTS
   ============================================ */
.pluspoints-section {
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-md);
}

.pluspoints-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pluspoint-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(102, 187, 106, 0.06);
    border: 1px solid rgba(102, 187, 106, 0.12);
    transition: all var(--transition-fast);
}

.pluspoint-card:hover {
    background: rgba(102, 187, 106, 0.1);
    border-color: rgba(102, 187, 106, 0.2);
    transform: translateX(4px);
}

.pluspoint-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pluspoint-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================
   FORECAST BAR
   ============================================ */
.forecast-bar {
    display: flex;
    gap: 4px;
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--glass-border);
}

.forecast-day {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.03);
}

.forecast-day:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.forecast-day.forecast-today {
    border: 1px solid var(--accent-purple);
}

.forecast-day .f-day-name {
    font-size: 0.55rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.forecast-day .f-day-num {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 1px 0;
}

.forecast-day .f-day-score {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
}

/* ============================================
   LANGUAGE TOGGLE
   ============================================ */
.lang-toggle {
    display: flex;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
}

.lang-btn {
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.lang-btn.active {
    background: var(--gradient-primary);
    color: white;
}

/* ============================================
   CUSTOM QUESTION FORM
   ============================================ */
.custom-q-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.custom-q-form label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: block;
}

.custom-q-form select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.custom-q-form select:focus {
    border-color: var(--accent-purple);
}

.add-question-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    min-height: 120px;
}

.add-question-btn:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(108, 99, 255, 0.05);
}

.custom-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: rgba(108, 99, 255, 0.2);
    color: var(--accent-purple);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.remove-custom-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 83, 80, 0.2);
    border: none;
    color: var(--accent-red);
    font-size: 0.65rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.question-card:hover .remove-custom-btn {
    display: flex;
}

.remove-custom-btn:hover {
    background: var(--accent-red);
    color: white;
}

/* ============================================
   PILL MODE TOGGLE
   ============================================ */
.pill-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    cursor: pointer;
    transition: background var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--gradient-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.add-q-modal .modal-card {
    max-width: 380px;
}

/* ============================================
   CONDITION INFO CHIPS
   ============================================ */
.conditions-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
}

.conditions-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.condition-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.condition-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.condition-chip:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: rgba(108, 99, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.condition-chip .chip-emoji {
    font-size: 0.9rem;
}

/* ============================================
   CONDITION INFO MODAL
   ============================================ */
.condition-modal .modal-card {
    max-width: 420px;
    text-align: left;
}

.condition-modal .modal-emoji {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--space-sm);
}

.condition-modal .modal-title {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.condition-detail {
    margin-bottom: var(--space-md);
}

.condition-detail h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.condition-detail p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.condition-prevalence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent-purple);
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.condition-ref {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

.condition-ref cite {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-style: italic;
    display: block;
    margin-bottom: 4px;
}

.condition-ref .doi-link {
    font-size: 0.68rem;
}

.condition-app-note {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 213, 79, 0.08);
    border: 1px solid rgba(255, 213, 79, 0.15);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: var(--space-md);
}

.condition-app-note strong {
    color: #FFD54F;
}

/* ============================================
   PERIMENOPAUSE TOGGLE
   ============================================ */
.perimeno-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

.perimeno-toggle-container .helper-text {
    margin-top: 4px;
}

/* ============================================
   UNCERTAINTY BADGE
   ============================================ */
.uncertainty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 152, 0, 0.12);
    border: 1px solid rgba(255, 152, 0, 0.25);
    color: #FFB74D;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: var(--space-sm);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.perimeno-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin: 0 var(--space-lg) var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.15);
    font-size: 0.75rem;
    color: #FFB74D;
}

.perimeno-banner .banner-emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #eeeef5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-tertiary: #8888aa;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .screen {
    background: var(--bg-primary);
}

[data-theme="light"] .glass-card {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

[data-theme="light"] .primary-btn {
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}

[data-theme="light"] .condition-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

[data-theme="light"] .condition-chip:hover {
    background: rgba(108, 99, 255, 0.08);
    border-color: rgba(108, 99, 255, 0.25);
}

[data-theme="light"] .question-card {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

[data-theme="light"] .empathy-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .modal-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .condition-app-note {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
}

[data-theme="light"] .condition-app-note strong {
    color: #e6a800;
}

[data-theme="light"] .forecast-day {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .forecast-day:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cal-day {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .cal-day:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .pluspoint-card {
    background: rgba(76, 175, 80, 0.06);
    border-color: rgba(76, 175, 80, 0.15);
}

[data-theme="light"] .perimeno-banner {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.2);
}

[data-theme="light"] .disclaimer {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] input,
[data-theme="light"] select {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(20deg);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ============================================
   ONBOARDING OVERLAY
   ============================================ */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.onboarding-container {
    max-width: 380px;
    width: 90%;
    text-align: center;
    padding: var(--space-xl);
}

.onboarding-slide {
    display: none;
    animation: slideUp 0.4s ease;
}

.onboarding-slide.active {
    display: block;
}

.onboarding-emoji {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    animation: float 3s ease-in-out infinite;
}

.onboarding-slide h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.onboarding-slide p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: var(--space-xl);
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.onboarding-dot.active {
    background: var(--accent-purple);
    width: 24px;
    border-radius: 4px;
}

.onboarding-btns {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.onboarding-skip {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.onboarding-skip:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
}

.onboarding-next {
    padding: 10px 28px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.onboarding-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   TODAY CARD (Quick Glance)
   ============================================ */
.today-card {
    margin: 0 var(--space-lg) var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(255, 107, 157, 0.1));
    border: 1px solid rgba(108, 99, 255, 0.15);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: relative;
    overflow: hidden;
}

.today-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.today-emoji {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.today-info {
    flex: 1;
    min-width: 0;
}

.today-phase {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.today-tip {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-score-badge {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
}

.today-score-badge.score-excellent { background: rgba(76, 175, 80, 0.15); color: #66BB6A; }
.today-score-badge.score-good { background: rgba(76, 175, 80, 0.1); color: #81C784; }
.today-score-badge.score-ok { background: rgba(255, 213, 79, 0.12); color: #FFD54F; }
.today-score-badge.score-risky { background: rgba(255, 152, 0, 0.12); color: #FFB74D; }
.today-score-badge.score-bad { background: rgba(239, 83, 80, 0.12); color: #EF5350; }

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.stat-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-top: 4px;
}

[data-theme="light"] .stat-card {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .today-card {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(255, 107, 157, 0.06));
    border-color: rgba(108, 99, 255, 0.12);
}

/* ============================================
   CYCLE HISTORY
   ============================================ */
.cycle-history-section {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

.cycle-history-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-sm);
    max-height: 150px;
    overflow-y: auto;
}

.history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    font-size: 0.78rem;
}

.history-entry .entry-date {
    color: var(--text-secondary);
    font-weight: 500;
}

.history-entry .entry-length {
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.history-entry .entry-remove {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(239, 83, 80, 0.15);
    border: none;
    color: var(--accent-red);
    font-size: 0.55rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.history-entry:hover .entry-remove {
    opacity: 1;
}

.add-history-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.add-history-row input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
}

.add-history-btn {
    padding: 8px 14px;
    background: rgba(108, 99, 255, 0.15);
    border: 1px solid rgba(108, 99, 255, 0.25);
    border-radius: var(--radius-md);
    color: var(--accent-purple);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.add-history-btn:hover {
    background: rgba(108, 99, 255, 0.25);
}

.history-avg {
    margin-top: var(--space-sm);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.12);
    font-size: 0.78rem;
    color: var(--accent-purple);
    font-weight: 600;
    text-align: center;
}

[data-theme="light"] .history-entry {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .history-entry {
    border-color: rgba(0, 0, 0, 0.08);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .app-title {
        font-size: 2.2rem;
    }

    .hero-card {
        flex-direction: column;
        text-align: center;
        margin: var(--space-md);
        padding: var(--space-lg);
    }

    .hero-phase-ring {
        width: 140px;
        height: 140px;
    }

    .score-value {
        font-size: 2.5rem;
    }

    .question-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 var(--space-md);
    }

    .science-cards {
        grid-template-columns: 1fr;
        padding: 0 var(--space-md);
    }

    .calendar-container {
        margin: 0 var(--space-md) var(--space-md);
    }

    .section-header {
        padding: var(--space-lg) var(--space-md) var(--space-sm);
    }

    .modal-card {
        padding: var(--space-lg);
    }

    .empathy-grid {
        grid-template-columns: 1fr;
    }

    .forecast-bar {
        gap: 3px;
    }

    .forecast-day .f-day-name {
        font-size: 0.55rem;
    }

    .forecast-day .f-day-score {
        font-size: 0.65rem;
    }

    .condition-chips {
        gap: 6px;
    }
    
    .condition-chip {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    
    .condition-modal .modal-card {
        max-width: 95vw;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .today-card {
        margin: 0 var(--space-md) var(--space-sm);
    }
    
    .today-tip {
        white-space: normal;
    }
    
    .onboarding-container {
        padding: var(--space-lg);
    }
    
    .onboarding-emoji {
        font-size: 3rem;
    }
    
    .onboarding-slide h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 380px) {
    .question-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Cal day tooltip */
.cal-day[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 10;
    color: var(--text-primary);
    pointer-events: none;
}

/* ============================================
   LIGHT THEME — Additional overrides
   ============================================ */
[data-theme="light"] .top-bar {
    background: rgba(245, 245, 250, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.08);
    color: #4a4a6a;
}

[data-theme="light"] .modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #1a1a2e;
}

[data-theme="light"] .icon-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #4a4a6a;
}

[data-theme="light"] .icon-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    color: #1a1a2e;
}

[data-theme="light"] .lang-btn {
    color: #4a4a6a;
}

[data-theme="light"] .lang-toggle {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .science-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .hormone-chart {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .date-info-bar {
    background: rgba(108, 99, 255, 0.06);
    border-color: rgba(108, 99, 255, 0.15);
}

[data-theme="light"] .orb {
    opacity: 0.15;
}

/* ============================================
   TOUCH TARGET IMPROVEMENTS
   ============================================ */
.icon-btn {
    min-width: 44px;
    min-height: 44px;
}

.modal-close {
    min-width: 44px;
    min-height: 44px;
}

/* ============================================
   CONFETTI ANIMATION
   ============================================ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confetti-fall 3s ease-in forwards;
}

.confetti-piece.circle {
    border-radius: 50%;
}

.confetti-piece.square {
    border-radius: 2px;
}

.confetti-piece.strip {
    width: 4px;
    height: 16px;
    border-radius: 2px;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }
    15% {
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) translateX(var(--sway, 50px)) rotate(360deg) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(calc(var(--sway, 50px) * -0.5)) rotate(720deg) scale(0.3);
    }
}
