/*
 * Beautiful Weather Effects (2024)
 * All effects are subtle, layered, and non-repetitive.
 * No harsh SVG tiling. All overlays blend with the background.
 */

#weather-effects-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* --- SUN --- */
.effect-sunny {
    background: linear-gradient(to bottom, #bde0fe 0%, #f1f8ff 100%);
}
.effect-sunny .sun {
    position: absolute;
    top: 130px;
    left: 80px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #fffbe6 0%, #ffe066 60%, #ffd60a 80%, rgba(255,255,255,0) 100%);
    box-shadow: 0 0 80px 30px #ffe06699, 0 0 200px 80px #ffd60a33;
    animation: sunPulse 6s ease-in-out infinite;
    z-index: 1;
}
@keyframes sunPulse {
    0%,100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* --- MOON --- */
.effect-clear-night {
    background: linear-gradient(to bottom, #232946 0%, #2d3250 100%);
}
.effect-clear-night .moon {
    position: absolute;
    top: 170px;
    right: 120px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f3e8ff 0%, #e9d5ff 60%, rgba(233,213,255,0) 80%);
    box-shadow: 0 0 40px 10px #e9d5ff66;
    z-index: 2;
}
/* Crescent shadow */
.effect-clear-night .moon::after {
    content: '';
    position: absolute;
    left: 30px;
    top: 10px;
    width: 60px;
    height: 70px;
    border-radius: 50%;
    background: rgba(35,41,70,0.7);
}

/* --- STARS --- */
.effect-clear-night .stars {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}
.effect-clear-night .star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.7;
    animation: starTwinkle 3s infinite alternate;
}
@keyframes starTwinkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --- CLOUDS (Day & Night) --- */
.effect-partly-cloudy-day {
    background: linear-gradient(to bottom, #d6e8f7 0%, #f0f6fc 100%); /* Mix of sunny #bde0fe and cloudy #bcd0e7 */
}
.effect-partly-cloudy-night {
    background: linear-gradient(to bottom, #2d3250 0%, #3a4060 100%);
}

.effect-cloudy-day, .effect-cloudy-night, .effect-rain, .effect-rain-night, .effect-storm, .effect-storm-night, .effect-snow {
    background: linear-gradient(to bottom, #bcd0e7 0%, #e6ecf5 100%);
}
.effect-cloudy-night, .effect-rain-night, .effect-storm-night, .effect-fog-night, .effect-snow-night {
    background: linear-gradient(to bottom, #232946 0%, #2d3250 100%);
}
/* The blur lives on this wrapper, not on each cloud. One filtered layer for the whole
   field costs a single rasterisation; per-cloud filters cost one layer each, re-blurred
   every frame because the clouds never stop moving. */
.weather-cloud-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    filter: blur(8px);
    z-index: 3; /* Ensure clouds are above everything */
}
.weather-cloud-layer.night {
    filter: blur(8px) brightness(0.7);
}
.weather-cloud {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    opacity: 0.7;
    box-shadow:
        60px 0 40px 0 #fff,
        120px 10px 60px 0 #e0e7ef,
        0 20px 60px 0 #e0e7ef;
    animation: cloudFloat 60s linear infinite;
    left: -400px; /* Start further off-screen */
    will-change: transform;
}
.weather-cloud.night {
    background: #e0e7ef;
    opacity: 0.4;
}
@keyframes cloudFloat {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 600px)); } /* Move further past the right edge */
}

/* --- RAIN --- */
.weather-rain {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    pointer-events: none;
    z-index: 2;
}
.weather-raindrop {
    position: absolute;
    width: 2px;
    height: 18px;
    background: linear-gradient(to bottom, #b3c6e7 0%, #5c7fa3 100%);
    border-radius: 1px;
    opacity: 0.5;
    animation: rainFall 1.2s linear infinite;
}
.effect-rain-night .weather-raindrop {
    background: linear-gradient(to bottom, #4a5568 0%, #2d3748 100%);
    opacity: 0.4;
}
@keyframes rainFall {
    0% { transform: translateY(0); opacity: 0.2; }
    80% { opacity: 0.7; }
    100% { transform: translateY(calc(100vh + 30px)); opacity: 0; }
}

/* --- SNOW --- */
.weather-snow {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    pointer-events: none;
    z-index: 2;
}
.weather-snowflake {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.7;
    filter: blur(0.5px);
    animation: snowDrift 6s linear infinite;
}
.effect-snow-night .weather-snowflake {
    opacity: 0.5;
}
@keyframes snowDrift {
    0% { transform: translateY(0) scale(1); opacity: 0.5; }
    80% { opacity: 0.8; }
    100% { transform: translateY(calc(100vh + 20px)) scale(1.2); opacity: 0; }
}

/* --- LIGHTNING --- */
/* Commented out lightning effects
.weather-lightning {
    position: absolute;
    left: 50vw;
    top: 30vh;
    width: 8px;
    height: 120px;
    background: linear-gradient(to bottom, #fff 60%, #ffe066 100%);
    border-radius: 4px;
    box-shadow: 0 0 40px 10px #fff8;
    opacity: 0;
    animation: lightningFlash 6s linear infinite;
    z-index: 10;
}
@keyframes lightningFlash {
    0%, 97%, 100% { opacity: 0; }
    98% { opacity: 1; }
    99% { opacity: 0; }
}
*/

/* --- FOG --- */
.effect-fog {
    background: linear-gradient(to bottom, #e0e7ef 0%, #f8fafc 100%);
}
.effect-fog-night {
    background: linear-gradient(to bottom, #1a202c 0%, #2d3748 100%);
}
.weather-fog {
    position: absolute;
    left: 0; right: 0; top: 60vh; height: 120px;
    background: linear-gradient(to top, #fff8 60%, #fff0 100%);
    filter: blur(8px);
    opacity: 0.7;
    z-index: 3;
}
.effect-fog-night .weather-fog {
    background: linear-gradient(to top, #2d374888 60%, #2d374800 100%);
    opacity: 0.5;
} 
