/*-----------------------------------------------
 * WEATHER ANIMATIONS
 * 
 * Contents:
 * 1. Base Animation Elements
 * 2. Rain Animation
 * 3. Snow Animation
 * 4. Cloud Animation
 * 5. Lightning Animation
 * 6. Sun Animation
 * 7. Stars Animation
 * 8. Fog Animation
 * 9. Wind Animation
 *-----------------------------------------------*/

/*-----------------------------------------------
 * 1. BASE ANIMATION ELEMENTS
 *-----------------------------------------------*/
/* Generic animation element */
.animation-element {
    position: absolute;
    pointer-events: none;
}

/*-----------------------------------------------
 * 2. RAIN ANIMATION
 *-----------------------------------------------*/
.droplet {
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6));
    border-radius: 0 0 5px 5px;
    position: absolute;
    animation: rain linear infinite;
}

@keyframes rain {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px));
        opacity: 0;
    }
}

/*-----------------------------------------------
 * 3. SNOW ANIMATION
 *-----------------------------------------------*/
.snowflake {
    color: white;
    font-size: 1em;
    position: absolute;
    animation: snow linear infinite;
}

@keyframes snow {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/*-----------------------------------------------
 * 4. CLOUD ANIMATION
 *-----------------------------------------------*/
.cloud {
    background: white;
    border-radius: 50%;
    position: absolute;
    opacity: 0.7;
    animation: cloud linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    background: white;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
}

@keyframes cloud {
    0% {
        transform: translateX(-150px);
    }
    100% {
        transform: translateX(calc(100vw + 150px));
    }
}

/*-----------------------------------------------
 * 5. LIGHTNING ANIMATION
 *-----------------------------------------------*/
.lightning {
    position: absolute;
    width: 5px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white, rgba(255, 255, 255, 0));
    animation: lightning ease-in-out infinite;
}

@keyframes lightning {
    0%, 100% {
        opacity: 0;
    }
    48%, 52% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

@keyframes lightningFlash {
    0%, 100% {
        opacity: 0;
    }
    49.9%, 51.1% {
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    50.1%, 50.2% {
        opacity: 0.1;
    }
    50.3% {
        opacity: 0.3;
    }
    84.9%, 85.1% {
        opacity: 0;
    }
    85% {
        opacity: 0.2;
    }
}

/*-----------------------------------------------
 * 6. SUN ANIMATION
 *-----------------------------------------------*/
.sun {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ffeb3b, rgba(255, 235, 59, 0.6), rgba(255, 235, 59, 0));
    border-radius: 50%;
    animation: sun 20s linear infinite;
}

@keyframes sun {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/*-----------------------------------------------
 * 7. STARS ANIMATION
 *-----------------------------------------------*/
.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: white;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/*-----------------------------------------------
 * 8. FOG ANIMATION
 *-----------------------------------------------*/
.fog {
    position: absolute;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    border-radius: 50% / 100%;
    animation: fog linear infinite;
}

@keyframes fog {
    0% {
        transform: translateX(-100%) translateY(0);
    }
    100% {
        transform: translateX(100vw) translateY(0);
    }
}

/*-----------------------------------------------
 * 9. WIND ANIMATION
 *-----------------------------------------------*/
@keyframes windMove {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateX(calc(100vw + 200px)) rotate(0deg);
        opacity: 0;
    }
}

/*-----------------------------------------------
 * 10. UTILITY ANIMATIONS
 *-----------------------------------------------*/
/* Loading spinner animation */
@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Bootstrap Icons spin animation */
@keyframes bi-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Fade in animation for content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert flashing animation */
@keyframes flash-alert {
    0%, 100% {
        background-color: rgba(255, 200, 200, 0.95);
        box-shadow: 0 0 15px rgba(211, 47, 47, 0.4);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.85);
        box-shadow: 0 0 5px rgba(211, 47, 47, 0.2);
    }
}

/* Pulse animation for map elements */
@keyframes alertPulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading pulse animation */
@keyframes pulse-loading {
    0%, 100% {
        transform: scale(1);
        background-color: #999;
    }
    50% {
        transform: scale(1.05);
        background-color: #777;
    }
}