/* ========================================================================
   WEATHER ANIMATIONS - Väderbaserade animationer för landing page
   Snö, regn, moln, solstrålar, etc.
   ======================================================================== */

/* ========================================================================
   ANIMATION CONTAINER
   ======================================================================== */

.weather-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* ========================================================================
   SNÖ ANIMATION - Förbättrad realistisk snöfall
   ======================================================================== */

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1.5rem;
    opacity: 0.8;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.9),
                 0 0 12px rgba(200, 230, 255, 0.6);
    animation: snowfall linear infinite;
    filter: blur(0.5px);
}

@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    25% {
        transform: translateY(25vh) translateX(10px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(-5px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(75vh) translateX(15px) rotate(270deg);
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) translateX(0) rotate(360deg);
        opacity: 0;
    }
}

/* Snöflingornas positioner och timing sätts nu dynamiskt i JavaScript */

/* ========================================================================
   REGN ANIMATION
   ======================================================================== */

.raindrop {
    position: absolute;
    top: -50px;
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8));
    opacity: 0.6;
    animation: rainfall linear infinite;
}

@keyframes rainfall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Regndroppars positioner och timing sätts nu dynamiskt i JavaScript */

/* ========================================================================
   MOLN ANIMATION (för molnigt väder) - Realistiska SVG filter-baserade moln
   ======================================================================== */

.cloud {
    position: absolute;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 40%, rgba(255, 255, 255, 0.3) 100%);
    border-radius: 50%;
    animation: cloudFloat linear infinite;
    filter: url(#cloudFilter);
    box-shadow:
        0 0 80px 40px rgba(255, 255, 255, 0.4),
        0 0 120px 60px rgba(255, 255, 255, 0.2),
        0 0 160px 80px rgba(255, 255, 255, 0.1);
}

/* Alternativa moln utan SVG filter för fallback */
.cloud.no-filter {
    filter: blur(8px);
}

.cloud::before {
    content: '';
    position: absolute;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    border-radius: 50%;
    filter: blur(15px);
}

.cloud::after {
    content: '';
    position: absolute;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    border-radius: 50%;
    filter: blur(20px);
}

@keyframes cloudFloat {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(calc(100vw + 400px)) translateY(-20px);
        opacity: 0;
    }
}

/* Molnens positioner, storlekar och timing sätts nu dynamiskt i JavaScript */

/* Pseudo-element storlekar som är proportionella till molnets huvudstorlek */
.cloud::before {
    width: 60%;
    height: 80%;
    top: -20%;
    left: 20%;
}

.cloud::after {
    width: 70%;
    height: 90%;
    top: -10%;
    right: 15%;
}

/* ========================================================================
   SOLSTRÅLAR ANIMATION - Förbättrad sol med glöd
   ======================================================================== */

/* Solen själv */
.sun-center {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 230, 100, 1) 0%, rgba(255, 200, 50, 0.8) 40%, rgba(255, 150, 0, 0) 70%);
    border-radius: 50%;
    box-shadow:
        0 0 40px 20px rgba(255, 220, 100, 0.6),
        0 0 80px 40px rgba(255, 200, 80, 0.4),
        0 0 120px 60px rgba(255, 180, 60, 0.2);
    animation: sunPulse 4s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.sunray {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 300px;
    height: 4px;
    background: linear-gradient(to right,
        rgba(255, 230, 100, 0) 0%,
        rgba(255, 230, 100, 0.6) 20%,
        rgba(255, 200, 80, 0.4) 50%,
        rgba(255, 180, 60, 0) 100%);
    transform-origin: 0 center;
    animation: sunrayRotate 20s linear infinite;
    filter: blur(2px);
}

@keyframes sunrayRotate {
    0% {
        transform: rotate(0deg);
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0.5;
    }
}

.sunray:nth-child(1) { animation-delay: 0s; }
.sunray:nth-child(2) { animation-delay: 2.5s; transform: rotate(45deg); }
.sunray:nth-child(3) { animation-delay: 5s; transform: rotate(90deg); }
.sunray:nth-child(4) { animation-delay: 7.5s; transform: rotate(135deg); }
.sunray:nth-child(5) { animation-delay: 10s; transform: rotate(180deg); }
.sunray:nth-child(6) { animation-delay: 12.5s; transform: rotate(225deg); }
.sunray:nth-child(7) { animation-delay: 15s; transform: rotate(270deg); }
.sunray:nth-child(8) { animation-delay: 17.5s; transform: rotate(315deg); }

/* ========================================================================
   DIMMA/FOG ANIMATION - Förbättrad realistisk dimma
   ======================================================================== */

.fog {
    position: absolute;
    width: 200%;
    height: 150px;
    background: radial-gradient(ellipse at center,
        rgba(220, 220, 230, 0.4) 0%,
        rgba(200, 200, 220, 0.3) 30%,
        rgba(180, 180, 200, 0.2) 60%,
        rgba(160, 160, 180, 0) 100%);
    animation: fogDrift 40s ease-in-out infinite;
    filter: blur(30px);
    opacity: 0.6;
}

@keyframes fogDrift {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0.4;
    }
    25% {
        transform: translateX(-10%) translateY(5px);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-20%) translateY(-5px);
        opacity: 0.5;
    }
    75% {
        transform: translateX(-30%) translateY(5px);
        opacity: 0.6;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.4;
    }
}

/* Dimmans positioner och timing sätts nu dynamiskt i JavaScript */

/* ========================================================================
   RESPONSIV DESIGN - Färre animationer på mobil
   ======================================================================== */

@media (max-width: 768px) {
    /* Färre snöflingor på mobil */
    .snowflake:nth-child(n+11) {
        display: none;
    }

    /* Färre regndroppar på mobil */
    .raindrop:nth-child(n+16) {
        display: none;
    }

    /* Färre moln på mobil */
    .cloud:nth-child(n+4) {
        display: none;
    }

    /* Färre solstrålar på mobil */
    .sunray:nth-child(n+5) {
        display: none;
    }

    /* Mindre sol på mobil */
    .sun-center {
        width: 80px;
        height: 80px;
        top: 10%;
        left: 15%;
    }

    /* Kortare solstrålar på mobil */
    .sunray {
        width: 150px;
        top: 10%;
        left: 15%;
    }

    /* Färre dimma-lager på mobil */
    .fog:nth-child(n+4) {
        display: none;
    }
}

/* ========================================================================
   PERFORMANCE OPTIMERING
   ======================================================================== */

/* Använd GPU-acceleration */
.snowflake,
.raindrop,
.cloud,
.sunray,
.fog {
    will-change: transform, opacity;
    transform: translateZ(0);
}
