/* ========================================
   Valentine's Day Page for Alina
   Romantic & Elegant Theme
   ======================================== */

:root {
    /* Color palette - Romantic Valentine */
    --primary-pink: #e91e63;
    --soft-pink: #f8bbd9;
    --deep-rose: #c2185b;
    --blush: #fce4ec;
    --cream: #fff5f8;
    --gold: #d4af37;
    --gold-light: #f4e4bc;
    --text-dark: #4a2c2a;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-romantic: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 50%, #f48fb1 100%);
    --gradient-deep: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4e4bc 50%, #d4af37 100%);
    
    /* Typography */
    --font-script: 'Great Vibes', cursive;
    --font-elegant: 'Cormorant Garamond', serif;
    
    /* Shadows */
    --shadow-soft: 0 10px 40px rgba(233, 30, 99, 0.2);
    --shadow-glow: 0 0 30px rgba(233, 30, 99, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-elegant);
    background: var(--gradient-romantic);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* ========================================
   Floating Hearts Background
   ======================================== */

.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    font-size: 1.5rem;
    animation: floatUp linear infinite;
    opacity: 0.6;
    filter: drop-shadow(0 0 5px rgba(233, 30, 99, 0.3));
}

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

/* ========================================
   Main Content
   ======================================== */

.main-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
}

.hidden {
    display: none !important;
}

/* ========================================
   Envelope Scene
   ======================================== */

.envelope-scene {
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.envelope-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.tap-hint {
    font-family: var(--font-elegant);
    font-size: 1.1rem;
    color: var(--deep-rose);
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

.envelope {
    width: 280px;
    height: 180px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.envelope:hover {
    transform: scale(1.05);
}

.envelope:active {
    transform: scale(0.98);
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #fff 0%, #fce4ec 100%);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--soft-pink);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #fff 0%, #f8bbd9 100%);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform-origin: top center;
    transition: transform 0.6s ease;
    z-index: 2;
    border: 2px solid var(--soft-pink);
}

.envelope.opening .envelope-flap {
    transform: rotateX(180deg);
}

.heart-seal {
    font-size: 3rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

/* ========================================
   Letter Scene
   ======================================== */

.letter-scene {
    animation: slideUp 0.8s ease-out;
}

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

.letter {
    background: var(--white);
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--soft-pink);
    position: relative;
    overflow: hidden;
}

.letter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-gold);
}

.letter-content {
    text-align: center;
}

.title {
    font-family: var(--font-script);
    font-size: 2.8rem;
    color: var(--deep-rose);
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(194, 24, 91, 0.1);
}

.letter-text {
    margin-bottom: 30px;
}

.letter-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-style: italic;
}

.letter-text .highlight {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--primary-pink);
    font-style: normal;
    margin-top: 20px;
}

.continue-btn {
    background: var(--gradient-deep);
    color: var(--white);
    border: none;
    padding: 15px 40px;
    font-family: var(--font-elegant);
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

.continue-btn:active {
    transform: translateY(0);
}

.heart-icon {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ========================================
   Question Scene
   ======================================== */

.question-scene {
    animation: fadeIn 0.8s ease-out;
}

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

.question-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 50px 35px;
    text-align: center;
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    border: 2px solid rgba(233, 30, 99, 0.2);
    position: relative;
}

.floating-hearts-decoration {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    font-size: 1.8rem;
}

.floating-hearts-decoration span {
    animation: floatDecoration 3s ease-in-out infinite;
}

.floating-hearts-decoration span:nth-child(2) {
    animation-delay: 0.3s;
}

.floating-hearts-decoration span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes floatDecoration {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.question-title {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--deep-rose);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(194, 24, 91, 0.1);
}

.question-text {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 40px;
    font-style: italic;
    line-height: 1.6;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    min-height: 120px;
    position: relative;
}

.btn {
    padding: 16px 50px;
    font-family: var(--font-elegant);
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 200px;
}

.btn-yes {
    background: var(--gradient-deep);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
}

.btn-yes:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(233, 30, 99, 0.5);
}

.btn-no {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--soft-pink);
    position: relative;
    transition: all 0.2s ease;
}

.btn-no:hover {
    background: var(--blush);
}

.btn-no.escaping {
    position: absolute;
}

.btn-no.disappeared {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

/* ========================================
   Celebration Scene
   ======================================== */

.celebration-scene {
    animation: celebrationEntry 1s ease-out;
}

@keyframes celebrationEntry {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.celebration-content {
    text-align: center;
    padding: 20px;
}

.big-heart {
    font-size: 6rem;
    animation: bigHeartbeat 1s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(233, 30, 99, 0.5));
}

@keyframes bigHeartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
}

.celebration-title {
    font-family: var(--font-script);
    font-size: 3rem;
    color: var(--deep-rose);
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(194, 24, 91, 0.2);
}

.celebration-text {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-style: italic;
    margin-bottom: 30px;
}

.hearts-burst {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 2rem;
    margin-bottom: 30px;
}

.hearts-burst span {
    animation: burstFloat 2s ease-in-out infinite;
}

.hearts-burst span:nth-child(1) { animation-delay: 0s; }
.hearts-burst span:nth-child(2) { animation-delay: 0.2s; }
.hearts-burst span:nth-child(3) { animation-delay: 0.4s; }
.hearts-burst span:nth-child(4) { animation-delay: 0.6s; }
.hearts-burst span:nth-child(5) { animation-delay: 0.8s; }

@keyframes burstFloat {
    0%, 100% { 
        transform: translateY(0) scale(1); 
    }
    50% { 
        transform: translateY(-20px) scale(1.2); 
    }
}

.signature {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 1px 1px 2px rgba(212, 175, 55, 0.3);
}

/* ========================================
   Confetti
   ======================================== */

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

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall linear forwards;
}

.confetti.heart {
    font-size: 1.2rem;
    width: auto;
    height: auto;
}

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

/* ========================================
   Music Toggle
   ======================================== */

.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--soft-pink);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-soft);
    z-index: 200;
    transition: transform 0.3s ease;
}

.music-toggle:hover {
    transform: scale(1.1);
}

.music-toggle .music-on,
.music-toggle .music-off {
    position: absolute;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 380px) {
    .title {
        font-size: 2.2rem;
    }
    
    .letter {
        padding: 30px 20px;
    }
    
    .question-title {
        font-size: 2.8rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .celebration-title {
        font-size: 2.5rem;
    }
    
    .big-heart {
        font-size: 4rem;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    body {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}
