/* ============================================
   EID AL-ADHA GREETING - STYLES
   For Lolo 🌙
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --emerald-light: #a7f3d0;
    --emerald: #10b981;
    --emerald-dark: #059669;
    --teal: #0d9488;
    --teal-dark: #0f766e;
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --gold-pale: #fef3c7;
    --deep-green: #064e3b;
    --cream: #fefce8;
    --white: #ffffff;
    --purple-accent: #7c3aed;
    --rose-accent: #f43f5e;
    --shadow: rgba(16, 185, 129, 0.3);
    --glow: rgba(245, 158, 11, 0.5);
    --glow-green: rgba(16, 185, 129, 0.5);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #0c1220 0%, #0a1628 20%, #091e1a 40%, #0d1f2d 60%, #0c1a15 80%, #0c1220 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === STARS BACKGROUND === */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.5); }
}

/* === FLOATING BACKGROUND ELEMENTS === */
.floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    bottom: -50px;
    font-size: 20px;
    opacity: 0;
    animation: floatUp linear infinite;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.25;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg) scale(0.3);
        opacity: 0;
    }
}

/* === SCREENS === */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* ============================================
   SCREEN 1: INTRO
   ============================================ */
.intro-container {
    text-align: center;
    padding: 2rem;
}

/* Lantern Animation */
.lantern {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    position: relative;
    animation: lanternSwing 3s ease-in-out infinite;
}

.lantern-body {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lantern-icon {
    font-size: 4rem;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.6));
}

.lantern-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes lanternSwing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes glowPulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
}

/* Intro Title */
.intro-title {
    font-family: 'Amiri', serif;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    direction: rtl;
}

.shimmer {
    background: linear-gradient(
        120deg,
        var(--emerald) 0%,
        var(--gold) 25%,
        var(--emerald-light) 50%,
        var(--gold-light) 75%,
        var(--emerald) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerMove 3s linear infinite;
}

@keyframes shimmerMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.intro-subtitle {
    margin-bottom: 0.3rem;
}

.eid-en {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 300;
    color: var(--emerald-light);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.intro-name {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--gold-pale);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.name-highlight {
    color: var(--gold);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    font-weight: 700;
}

.intro-text {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Open Button */
.btn-open {
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px var(--shadow);
}

.btn-open:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 45px var(--glow-green);
}

.btn-open:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    margin-left: 0.5rem;
    display: inline-block;
    animation: crescentFloat 2s ease-in-out infinite;
}

@keyframes crescentFloat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
}

.btn-sparkle {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 60%
    );
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ============================================
   SCREEN 2: JOURNEY
   ============================================ */
.journey-container {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
}

.journey-messages {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.journey-msg {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.3rem, 4vw, 2rem);
    opacity: 0;
    transform: translateY(30px);
    animation: msgAppear 0.8s ease forwards;
    line-height: 1.4;
    font-weight: 300;
}

.journey-msg.fade-out {
    animation: msgFadeOut 0.5s ease forwards;
}

@keyframes msgAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes msgFadeOut {
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

.journey-msg .emoji {
    font-size: 2em;
    display: block;
    margin-top: 0.5rem;
}

.journey-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 3rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--emerald), var(--gold), var(--emerald-light));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ============================================
   SCREEN 3: THE QUESTION
   ============================================ */
.question-container {
    padding: 2rem;
    width: 90%;
    max-width: 550px;
}

.question-card {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.08), rgba(245, 158, 11, 0.08));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 30px;
    padding: clamp(2rem, 5vw, 3rem);
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 80px rgba(245, 158, 11, 0.03);
    position: relative;
    overflow: visible;
}

.question-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), transparent, rgba(245, 158, 11, 0.2));
    z-index: -1;
    opacity: 0.5;
}

.crescent-beat {
    font-size: clamp(3rem, 10vw, 5rem);
    animation: crescentBeat 2s ease-in-out infinite;
    display: block;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.5));
}

@keyframes crescentBeat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(5deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
}

.question-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--emerald-light);
    margin-bottom: 0.2rem;
    font-weight: 300;
}

.question-name {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    background: linear-gradient(135deg, var(--gold), var(--emerald-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.question-subtitle {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Buttons Container */
.buttons-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 80px;
    position: relative;
}

/* YES Button */
.btn-yes {
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    border: none;
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    position: relative;
    z-index: 5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-yes:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

/* NO Button */
.btn-no {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 5;
    user-select: none;
}

/* Attempt Counter */
.attempt-counter {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    min-height: 1.5em;
    font-style: italic;
}

/* ============================================
   SCREEN 4: CELEBRATION
   ============================================ */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.celebration-container {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 50;
}

.celebration-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.eid-calligraphy {
    font-family: 'Amiri', serif;
    font-size: clamp(3rem, 10vw, 5rem);
    background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--emerald-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    direction: rtl;
    animation: calligraphyGlow 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 30px rgba(245, 158, 11, 0.3));
}

@keyframes calligraphyGlow {
    0% { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.3)); }
    100% { filter: drop-shadow(0 0 40px rgba(245, 158, 11, 0.6)); }
}

.celebration-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 2rem;
    font-weight: 700;
}

.letter-pop {
    display: inline-block;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    animation: letterPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background: linear-gradient(135deg, var(--gold), var(--emerald-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes letterPop {
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.celebration-message {
    margin-bottom: 2rem;
}

.love-text {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--emerald-light);
    margin-bottom: 0.3rem;
    animation: eidGlow 2s ease-in-out infinite alternate;
    font-weight: 300;
}

.love-text-sub {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--emerald);
    animation: eidGlow 2s ease-in-out infinite alternate 0.5s;
    font-weight: 300;
}

@keyframes eidGlow {
    from { text-shadow: 0 0 10px var(--glow); }
    to { text-shadow: 0 0 30px var(--glow), 0 0 60px rgba(245, 158, 11, 0.2); }
}

.eid-union {
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    margin-top: 1rem;
    animation: crescentFloat 3s ease-in-out infinite;
    color: var(--gold-light);
}

/* Love Meter */
.love-meter {
    max-width: 350px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.love-meter-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.love-meter-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.love-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--emerald), var(--teal), var(--gold), var(--gold-light));
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: meterShine 2s linear infinite;
}

@keyframes meterShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.love-meter-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--emerald), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Eid Blessing */
.eid-blessing {
    font-family: 'Amiri', serif;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: var(--gold-light);
    margin-bottom: 2rem;
    direction: rtl;
    opacity: 0.9;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Restart Button */
.btn-restart {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-restart:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ============================================
   GEOMETRIC ISLAMIC PATTERN OVERLAY
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .question-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .buttons-container {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-yes, .btn-no {
        width: 80%;
    }
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px) rotate(-2deg); }
    40% { transform: translateX(10px) rotate(2deg); }
    60% { transform: translateX(-5px) rotate(-1deg); }
    80% { transform: translateX(5px) rotate(1deg); }
}

/* Particle burst for No button */
.particle {
    position: fixed;
    pointer-events: none;
    font-size: 1.2rem;
    z-index: 1000;
    animation: particleBurst 1s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
    }
}
