/*! countdown.css
 * Features: Sunset gradient, floating sakura petals, glowing sun, glassmorphism
 */

/* === CSS Variables === */
:root {
    --bg-gradient-start: #1a0533;
    --bg-gradient-mid: #4a1942;
    --bg-gradient-end: #ff6b35;
    --sun-color: #ffd93d;
    --sun-glow: #ff9a3c;
    --petal-pink: #ffb7c5;
    --petal-white: #fff5f5;
    --card-bg: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 255, 255, 0.25);
    --text-primary: #fff;
    --text-secondary: #ffeef0;
    --accent-color: #ff6b9d;
    --hill-back: #2d1b3d;
    --hill-mid: #1f1229;
    --hill-front: #140a1c;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(
        180deg,
        var(--bg-gradient-start) 0%,
        var(--bg-gradient-mid) 40%,
        var(--bg-gradient-end) 100%
    );
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* === Scene Container === */
#scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* === Sun Styles === */
#sun {
    position: absolute;
    top: 8%;
    left: 12%;
    width: 120px;
    height: 120px;
}

.sun-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fff 0%, var(--sun-color) 50%, var(--sun-glow) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 30px var(--sun-color),
        0 0 60px var(--sun-glow),
        0 0 100px rgba(255, 154, 60, 0.5);
    animation: sunPulse 4s ease-in-out infinite;
}

.sun-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 217, 61, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: sunGlowPulse 3s ease-in-out infinite alternate;
}

.sun-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    animation: sunRaysSpin 60s linear infinite;
}

.sun-rays::before,
.sun-rays::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(255, 217, 61, 0.6) 20%, 
        transparent 40%,
        transparent 60%,
        rgba(255, 217, 61, 0.6) 80%,
        transparent 100%
    );
}

.sun-rays::after {
    transform: translateX(-50%) rotate(45deg);
}

@keyframes sunPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes sunGlowPulse {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
}

@keyframes sunRaysSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === Hills/Landscape === */
#hills {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    min-height: 200px;
}

.hill-back { fill: var(--hill-back); }
.hill-mid { fill: var(--hill-mid); }
.hill-front { fill: var(--hill-front); }

/* === Floating Petals === */
#petals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--petal-pink);
    border-radius: 50% 0 50% 50%;
    opacity: 0.85;
    transform-origin: center center;
    animation: petalFall linear infinite;
    box-shadow: 0 2px 8px rgba(255, 183, 197, 0.3);
}

.petal:nth-child(odd) {
    background: var(--petal-white);
    width: 12px;
    height: 12px;
}

.petal:nth-child(3n) {
    background: linear-gradient(135deg, var(--petal-pink), var(--petal-white));
}

@keyframes petalFall {
    0% {
        transform: translateY(-20px) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    90% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) translateX(100px);
        opacity: 0;
    }
}

/* === Sparkles === */
#sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: sparkleGlow 2s ease-in-out infinite;
}

@keyframes sparkleGlow {
    0%, 100% { 
        opacity: 0.2;
        transform: scale(0.5);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
        box-shadow: 0 0 10px #fff, 0 0 20px var(--accent-color);
    }
}

/* === Countdown Card === */
#countdown-card {
    position: relative;
    z-index: 10;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
    animation: cardFloat 6s ease-in-out infinite, cardFadeIn 1.5s ease-out forwards;
    max-width: 90vw;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === Title === */
.countdown-title {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff 0%, var(--petal-pink) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.countdown-title.celebrate {
    animation: celebrate 0.5s ease infinite alternate;
}

@keyframes celebrate {
    from { transform: scale(1) rotate(-2deg); }
    to { transform: scale(1.05) rotate(2deg); }
}

/* === Timer Grid === */
.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.time-block {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px 20px;
    min-width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.time-block:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.time-block--accent {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(255, 107, 53, 0.2));
    border-color: var(--accent-color);
}

.time-block--accent .time-value {
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-color);
}

.time-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.time-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 600;
}

.time-separator {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    animation: separatorPulse 1s ease-in-out infinite;
}

@keyframes separatorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === Message === */
.countdown-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.9;
}

/* === Surprise Button (shown when countdown ends) === */
.surprise-container {
    margin-top: 20px;
}

.surprise-btn {
    display: inline-block;
    padding: 15px 35px;
    background: linear-gradient(135deg, var(--accent-color), #ff9a3c);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(255, 107, 157, 0.4);
    border: none;
    cursor: pointer;
}

.surprise-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.5);
}

/* === Responsive Design === */
@media (max-width: 600px) {
    #countdown-card {
        padding: 30px 25px;
        border-radius: 24px;
    }
    
    .countdown-title {
        font-size: 1.6rem;
    }
    
    .time-block {
        min-width: 60px;
        padding: 12px 14px;
    }
    
    .time-value {
        font-size: 2rem;
    }
    
    .time-separator {
        font-size: 1.8rem;
    }
    
    #sun {
        width: 80px;
        height: 80px;
        top: 5%;
        left: 8%;
    }
    
    .sun-core {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
    .countdown-timer {
        gap: 5px;
    }
    
    .time-separator {
        display: none;
    }
    
    .time-block {
        min-width: 55px;
        padding: 10px 8px;
    }
    
    .time-value {
        font-size: 1.6rem;
    }
}
