/**
 * Kurzgesagt-Style Weather Background CSS
 * Flat design with smooth animations - Matching exact style
 */

/* ========== Container ========== */
.weather-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    transition: background-color 2s ease;
}

.weather-scene {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ========== Sunny/Clear Scene (Default) ========== */
.sunny-scene {
    background: linear-gradient(to bottom, #D4EDF7 0%, #B8E3F0 100%);
}

.sun {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: #FFB84D;
    border-radius: 50%;
}

@keyframes sun-pulse {
    /* No animation - static sun */
}

/* ========== Cloudy Scene ========== */
.cloudy-scene {
    background: linear-gradient(to bottom, #D4EDF7 0%, #B8E3F0 100%);
}

/* ========== Rainy Scene ========== */
.rainy-scene {
    background: linear-gradient(to bottom, #C4E4F0 0%, #A8D8E8 100%);
}

/* ========== Snowy Scene ========== */
.snowy-scene {
    background: linear-gradient(to bottom, #E4F4FA 0%, #C8E8F4 100%);
}

/* ========== Thunderstorm Scene ========== */
.thunderstorm-scene {
    background: linear-gradient(to bottom, #B0D0E0 0%, #98C0D8 100%);
}

/* ========== Foggy Scene ========== */
.foggy-scene {
    background: linear-gradient(to bottom, #D4EDF7 0%, #B8E3F0 100%);
}

/* ========== Night Scene ========== */
.night-scene {
    background: linear-gradient(to bottom, #1A2D42 0%, #2A3D52 100%);
}

/* Day/Night scene transitions - Slow and Subtle */
.weather-bg-container {
    transition: all 5s ease-in-out;
}

.weather-scene {
    transition: background 5s ease-in-out;
}

/* Smooth fade for sun/moon */
.sun,
.moon {
    opacity: 0;
    animation: fadeIn 3s ease-in-out forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Smooth transitions for all weather elements */
.cloud,
.star,
.raindrop,
.snowflake {
    animation-timing-function: ease-in-out;
}

/* ========== Clouds (Kurzgesagt Style) ========== */
.cloud {
    position: absolute;
    background: #FFFFFF;
    border-radius: 200px;
    width: 220px;
    height: 80px;
    animation: float-cloud linear infinite;
    opacity: 0.95;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.04));
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: #FFFFFF;
    border-radius: 50%;
}

.cloud::before {
    width: 110px;
    height: 110px;
    top: -55px;
    left: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.cloud::after {
    width: 130px;
    height: 130px;
    top: -65px;
    right: 35px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

/* Cloud variants - Kurzgesagt inspired */
.cloud-light {
    background: #FFFFFF;
    opacity: 0.92;
}

.cloud-light::before,
.cloud-light::after {
    background: #FFFFFF;
}

.cloud-medium {
    background: #E8F2F7;
    opacity: 0.95;
}

.cloud-medium::before,
.cloud-medium::after {
    background: #E8F2F7;
}

.cloud-dark {
    background: #D0DEEA;
    opacity: 0.95;
}

.cloud-dark::before,
.cloud-dark::after {
    background: #D0DEEA;
}

.cloud-very-dark {
    background: #B0BED0;
    opacity: 0.95;
}

.cloud-very-dark::before,
.cloud-very-dark::after {
    background: #B0BED0;
}

.cloud-night {
    background: #3A4F64;
    opacity: 0.75;
}

.cloud-night::before,
.cloud-night::after {
    background: #3A4F64;
}

@keyframes float-cloud {
    0% {
        transform: translateX(-250px) translateY(0px);
    }
    50% {
        transform: translateX(calc(50vw - 125px)) translateY(-8px);
    }
    100% {
        transform: translateX(calc(100vw + 250px)) translateY(0px);
    }
}

/* ========== Birds (Simple V-shapes) ========== */
.bird {
    position: absolute;
    left: -50px;
    animation: fly-bird linear infinite;
}

.bird::before,
.bird::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 3px;
    background: rgba(60, 80, 100, 0.6);
    border-radius: 3px;
    animation: flap 0.8s ease-in-out infinite;
}

.bird::before {
    transform-origin: right center;
    transform: rotate(-25deg);
}

.bird::after {
    transform-origin: left center;
    transform: rotate(25deg);
}

@keyframes fly-bird {
    0% { left: -50px; }
    100% { left: calc(100vw + 50px); }
}

@keyframes flap {
    0%, 100% { transform: scaleX(1) scaleY(1); }
    50% { transform: scaleX(1.2) scaleY(0.95); }
}

/* ========== Rain (Kurzgesagt style drops) ========== */
.raindrop {
    position: absolute;
    top: -10px;
    width: 3px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(160, 196, 224, 0.7));
    border-radius: 0 0 3px 3px;
    animation: fall-rain linear infinite;
    opacity: 0.7;
}

@keyframes fall-rain {
    0% { transform: translateY(-20px); opacity: 0.7; }
    100% { transform: translateY(100vh); opacity: 0.1; }
}

/* ========== Snow (Round, soft flakes) ========== */
.snowflake {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-radius: 50%;
    animation: fall-snow linear infinite;
    opacity: 0.85;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.snowflake::before,
.snowflake::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 3px;
    background: #FFFFFF;
    border-radius: 3px;
    top: 4.5px;
    left: 0;
}

.snowflake::after {
    transform: rotate(90deg);
}

@keyframes fall-snow {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 0.85;
    }
    100% {
        transform: translateY(100vh) translateX(40px) rotate(360deg);
        opacity: 0.2;
    }
}

/* ========== Moon (Kurzgesagt style - Simple) ========== */
.moon {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: #E8EDF2;
    border-radius: 50%;
}

.moon::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #CDD5DD;
    border-radius: 50%;
    top: 35%;
    left: 35%;
}

.moon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #CDD5DD;
    border-radius: 50%;
    bottom: 35%;
    right: 30%;
}

@keyframes moon-glow {
    /* No animation - static moon like the sun */
}

/* ========== Stars (Simple twinkling dots) ========== */
.star {
    position: absolute;
    background: #FFFFFF;
    border-radius: 50%;
    animation: twinkle 4s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ========== Lightning (Bright flash) ========== */
.lightning {
    position: absolute;
    top: 35%;
    left: 50%;
    width: 5px;
    height: 120px;
    background: #FFEB3B;
    box-shadow: 0 0 30px 10px #FFEB3B;
    opacity: 0;
    animation: flash-lightning 6s ease-in-out infinite;
    clip-path: polygon(40% 0%, 50% 25%, 60% 25%, 45% 55%, 55% 55%, 30% 100%, 45% 55%, 35% 55%, 50% 25%, 40% 25%);
    filter: brightness(1.5);
}

@keyframes flash-lightning {
    0%, 88%, 90%, 92%, 100% { opacity: 0; }
    89%, 91% { opacity: 1; }
}

/* ========== Fog (Soft drifting layers) ========== */
.fog-layer-item {
    position: absolute;
    width: 100%;
    height: 250px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 20%,
        rgba(255, 255, 255, 0.6) 80%,
        transparent 100%
    );
    animation: drift-fog linear infinite;
    border-radius: 50%;
    filter: blur(30px);
}

.fog-layer-item:nth-child(1) { top: 15%; }
.fog-layer-item:nth-child(2) { top: 35%; }
.fog-layer-item:nth-child(3) { top: 55%; }
.fog-layer-item:nth-child(4) { top: 75%; }

@keyframes drift-fog {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(150%); }
}

/* ========== Wind Lines (Subtle motion) ========== */
.wind-line {
    position: absolute;
    left: -120px;
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
    border-radius: 3px;
    animation: blow-wind linear infinite;
}

@keyframes blow-wind {
    0% { transform: translateX(-120px); opacity: 0; }
    15% { opacity: 0.7; }
    85% { opacity: 0.7; }
    100% { transform: translateX(100vw); opacity: 0; }
}

/* ========== Responsive (Mobile adjustments) ========== */
@media (max-width: 768px) {
    .sun, .moon {
        width: 90px;
        height: 90px;
        top: 6%;
        right: 8%;
    }

    .cloud {
        width: 150px;
        height: 55px;
        border-radius: 150px;
    }

    .cloud::before {
        width: 75px;
        height: 75px;
        top: -38px;
        left: 20px;
    }

    .cloud::after {
        width: 90px;
        height: 90px;
        top: -45px;
        right: 25px;
    }
}

@media (max-width: 480px) {
    .sun, .moon {
        width: 70px;
        height: 70px;
    }

    .cloud {
        width: 120px;
        height: 45px;
    }

    .cloud::before {
        width: 60px;
        height: 60px;
        top: -30px;
    }

    .cloud::after {
        width: 70px;
        height: 70px;
        top: -35px;
    }
}

/* ========== Smooth Transitions (Enhanced) ========== */
.weather-bg-container {
    transition: all 8s cubic-bezier(0.4, 0, 0.2, 1);
}

.weather-bg-container * {
    transition: opacity 4s ease-in-out,
                background 4s ease-in-out,
                background-color 4s ease-in-out,
                transform 4s ease-in-out;
}

/* Smooth crossfade between scenes */
.weather-scene {
    opacity: 0;
    animation: sceneFadeIn 6s ease-in-out forwards;
}

@keyframes sceneFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
