@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Montserrat:wght@200;300;400;500&display=swap');

:root {
    /* Premium Light Palette */
    --color-bg-base: #faf8f9; /* Pearl white / soft cream */
    --color-primary: #e5989b; /* Rose gold / blush */
    --color-primary-glow: rgba(229, 152, 155, 0.4);
    --color-secondary: #b5838d; /* Muted mauve */
    --color-accent: #ffb4a2; /* Soft peach */
    --color-text-main: #2b2d42; /* Deep charcoal */
    --color-text-muted: #6c757d; /* Medium grey */
    
    /* Light Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-highlight: rgba(255, 255, 255, 1);
    --glass-shadow: 0 25px 50px rgba(0, 0, 0, 0.05);
    
    /* Fonts */
    --font-ui: 'Montserrat', sans-serif;
    --font-romantic: 'Great Vibes', cursive;
}

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

body {
    font-family: var(--font-ui);
    color: var(--color-text-main);
    background-color: var(--color-bg-base);
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling for SPA feel */
    position: relative;
    font-weight: 300;
}

/* Atmospheric Backgrounds */
.bg-gradient {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(255, 180, 162, 0.4), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(229, 152, 155, 0.4), transparent 50%);
    z-index: -3;
}

.bg-stars {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Soft rose-gold specks floating like pollen/dust */
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, var(--color-primary), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 40px 70px, var(--color-accent), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, var(--color-primary), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 90px 40px, var(--color-accent), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, var(--color-primary), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 160px 120px, var(--color-accent), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 250px 250px;
    animation: starry-drift 60s infinite linear;
    z-index: -2;
    opacity: 0.3;
}

.bg-aurora {
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, rgba(255, 180, 162, 0.15) 0%, rgba(229, 152, 155, 0.15) 50%, rgba(181, 131, 141, 0.15) 100%);
    filter: blur(80px);
    animation: aurora-swirl 20s infinite alternate ease-in-out;
    z-index: -1;
    pointer-events: none;
}

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

/* Typography Enhancements */
.romantic-title {
    font-family: var(--font-romantic);
    font-size: 4.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 5px 15px rgba(229, 152, 155, 0.3);
    line-height: 1.2;
}

.giant-title {
    font-size: 6.5rem;
    animation: pulse-glow 3s infinite alternate ease-in-out;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.section-title {
    font-family: var(--font-romantic);
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.quote-text {
    font-family: var(--font-romantic);
    font-size: 2.5rem;
    color: var(--color-text-main);
    text-align: center;
    margin: 2rem 0;
    opacity: 0.9;
}

.italic { font-style: italic; }
.text-pink { color: var(--color-primary); }

/* Layout */
.app-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 1rem;
    perspective: 1000px; /* For 3D transitions */
}

.screen {
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    align-items: center;
    animation: smoothFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    padding: 1rem;
}

.screen::-webkit-scrollbar { width: 0; } /* Hide scrollbar for elegance */

.screen.active {
    display: flex;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);
    border-radius: 30px;
    padding: 3.5rem;
    box-shadow: var(--glass-shadow);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.glass-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

/* Elegant Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-main);
    padding-left: 1rem;
    letter-spacing: 0.5px;
}

input[type="text"], input[type="number"], input[type="date"] {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 50px; /* Pill shape */
    padding: 1.2rem 1.5rem;
    color: var(--color-text-main);
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 400;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

input:focus, textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 20px var(--color-primary-glow), 0 4px 15px rgba(0,0,0,0.05);
}

input::placeholder, textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
    font-weight: 300;
}

/* Beautiful Buttons */
button {
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 1px;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    border: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy transition */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 10px 25px var(--color-primary-glow);
    align-self: center;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.primary-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(229, 152, 155, 0.6);
}

.primary-btn:hover::before {
    left: 150%;
}

.secondary-btn {
    background: white;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}
.secondary-btn:hover {
    background: #fff5f5;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(229, 152, 155, 0.2);
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
    margin-top: 2rem;
}

/* Opening Screen */
.opening-animation {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.glow-heart {
    font-size: 4.5rem;
    color: var(--color-primary);
    filter: drop-shadow(0 5px 15px var(--color-primary-glow));
    animation: gentle-heartbeat 2s infinite ease-in-out;
}

.left-heart { animation-delay: 0s; }
.right-heart { animation-delay: 1s; }

/* Map Visual */
.map-visual {
    width: 100%;
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 3rem;
}

.location-dot {
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 20px 4px rgba(255, 180, 162, 0.5);
    z-index: 2;
    animation: pulse-glow-accent 2.5s infinite;
}

.glowing-line {
    position: absolute;
    top: 50%;
    left: 8px;
    right: 8px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), transparent 50%, var(--color-primary));
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.6;
}

.airplane {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%) rotate(45deg);
    color: var(--color-primary);
    font-size: 1.5rem;
    animation: fly-across 4s infinite ease-in-out;
    filter: drop-shadow(0 2px 5px rgba(229, 152, 155, 0.4));
}

/* Love Letter */
.letter-container {
    width: 100%;
    position: relative;
}

textarea {
    width: 100%;
    min-height: 280px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 20px;
    padding: 2rem;
    color: var(--color-text-main);
    font-family: var(--font-ui);
    font-size: 1.15rem;
    line-height: 1.8;
    resize: none;
    transition: all 0.4s;
    font-weight: 400;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.letter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.5rem 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.skip-hint {
    font-style: italic;
    opacity: 0.8;
}

/* Countdown */
.countdown-container {
    display: flex;
    gap: 1.2rem;
    margin: 3rem 0;
    justify-content: center;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    min-width: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.time-box span {
    font-family: var(--font-ui);
    font-size: 3rem;
    font-weight: 300;
    color: var(--color-secondary);
    text-shadow: 0 2px 5px rgba(181, 131, 141, 0.2);
    margin-bottom: 0.5rem;
}

.time-box small {
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Memory Capsule */
.upload-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.upload-box {
    border: 2px dashed rgba(229, 152, 155, 0.3);
    border-radius: 24px;
    padding: 2.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    background: rgba(255,255,255,0.5);
    text-align: center;
}

.upload-box:hover {
    border-color: var(--color-primary);
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(229, 152, 155, 0.15);
}

.upload-box i {
    font-size: 2.5rem;
    color: var(--color-secondary);
    transition: color 0.3s;
}

.upload-box:hover i {
    color: var(--color-primary);
}

/* Final Review */
.review-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 1rem;
}
.review-content::-webkit-scrollbar { width: 4px; }
.review-content::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 10px; }

.review-item {
    background: rgba(255,255,255,0.7);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    border-left: 4px solid var(--color-secondary);
    font-size: 1.05rem;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.review-item strong {
    color: var(--color-primary);
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.review-letter {
    font-family: var(--font-romantic);
    font-size: 1.6rem;
    white-space: pre-wrap;
    background: linear-gradient(135deg, rgba(229, 152, 155, 0.1), rgba(181, 131, 141, 0.1));
    border-left: 4px solid var(--color-primary);
    padding: 2rem;
    border-radius: 16px;
    line-height: 1.6;
    text-align: center;
    color: var(--color-text-main);
}

/* Final Screen */
.final-screen {
    justify-content: center;
}

.animated-quotes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 4rem 0;
    height: 150px;
    position: relative;
    width: 100%;
}

.final-quote {
    font-family: var(--font-romantic);
    font-size: 2.8rem;
    opacity: 0;
    text-align: center;
    position: absolute;
    width: 100%;
    color: var(--color-text-main);
    text-shadow: 0 2px 10px rgba(255,255,255,0.8);
    animation: fadeSequence 5s forwards;
}

.glowing-final-btn {
    font-size: 1.3rem;
    padding: 1.5rem 3.5rem;
    opacity: 0;
    animation: fadeInFinal 2s forwards;
    pointer-events: none;
}

/* Keypress hint */
.keypress-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
    text-align: center;
    opacity: 0.8;
}

/* Animations */
@keyframes starry-drift {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-300px) rotate(2deg); }
}

@keyframes aurora-swirl {
    0% { transform: rotate(0deg) scale(1) translate(0,0); }
    50% { transform: rotate(3deg) scale(1.05) translate(1%, 1%); }
    100% { transform: rotate(-3deg) scale(1.02) translate(-1%, -1%); }
}

@keyframes smoothFadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes smoothFadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-30px) scale(0.98); }
}

@keyframes gentle-heartbeat {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 5px 15px var(--color-primary-glow)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 10px 25px var(--color-primary)); }
}

@keyframes pulse-glow {
    from { text-shadow: 0 5px 15px var(--color-primary-glow); }
    to { text-shadow: 0 10px 25px var(--color-primary), 0 15px 35px var(--color-secondary); }
}

@keyframes pulse-glow-accent {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 180, 162, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 30px rgba(255, 180, 162, 0.8); transform: scale(1.2); }
}

@keyframes fly-across {
    0% { left: 0%; transform: translateY(-50%) rotate(45deg) scale(0.8); opacity: 0; }
    20% { opacity: 1; scale: 1; }
    80% { opacity: 1; scale: 1; }
    100% { left: 100%; transform: translateY(-50%) rotate(45deg) scale(0.8); opacity: 0; }
}

@keyframes fadeSequence {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); }
    15% { opacity: 1; transform: translateY(0) scale(1); }
    85% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-20px) scale(1.05); }
}

@keyframes fadeInFinal {
    to { opacity: 1; pointer-events: auto; }
}

@keyframes floatUpFade {
    0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-120vh) scale(0.5) rotate(45deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .romantic-title { font-size: 3rem; }
    .giant-title { font-size: 4.5rem; }
    .section-title { font-size: 2.5rem; }
    .glass-panel { padding: 2rem 1.5rem; border-radius: 20px; }
    .form-row { flex-direction: column; gap: 1.5rem; }
    .countdown-container { flex-wrap: wrap; gap: 1rem; }
    .time-box { min-width: 80px; padding: 1rem; }
    .time-box span { font-size: 2.2rem; }
    .quote-text { font-size: 1.8rem; }
    .review-letter { font-size: 1.3rem; padding: 1.5rem; }
    button { width: 100%; }
}
