/* ========================================
   WEATHER EFFECTS - ПОГОДНЫЕ ЭФФЕКТЫ
   ======================================== */

/* ========== СНЕЖИНКИ ========== */

.weather-effect-snow {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: snowfall linear infinite;
}

/* Разные размеры снежинок */
.snowflake.small {
    width: 3px;
    height: 3px;
    opacity: 0.6;
}

.snowflake.medium {
    width: 5px;
    height: 5px;
    opacity: 0.7;
}

.snowflake.large {
    width: 7px;
    height: 7px;
    opacity: 0.9;
}

/* Анимация падения снега */
@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(50vh) translateX(20px);
    }
    100% {
        transform: translateY(100vh) translateX(0);
    }
}

/* ========== КАПЛИ ДОЖДЯ ========== */

.weather-effect-rain {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    top: -50px;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, rgba(174, 194, 224, 0.8), rgba(174, 194, 224, 0.2));
    animation: rainfall linear infinite;
}

/* Разные размеры капель */
.raindrop.light {
    height: 12px;
    opacity: 0.5;
}

.raindrop.medium {
    height: 18px;
    opacity: 0.7;
}

.raindrop.heavy {
    height: 25px;
    opacity: 0.9;
}

/* Анимация падения дождя */
@keyframes rainfall {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100vh);
    }
}

/* ========== ЗВЕЗДЫ (ЯСНАЯ НОЧЬ) ========== */

.weather-effect-stars {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite;
}

/* Разные размеры звезд */
.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
}

.star.large {
    width: 3px;
    height: 3px;
}

/* Анимация мерцания */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* ========== МОЛНИИ (ГРОЗА) ========== */

.weather-effect-lightning {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    background: rgba(255, 255, 255, 0);
    animation: lightning 8s infinite;
}

/* Анимация вспышек молнии */
@keyframes lightning {
    0%, 10%, 11%, 100% {
        background: rgba(255, 255, 255, 0);
    }
    10.5% {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Молния с более частыми вспышками */
.weather-effect-lightning.frequent {
    animation: lightning-frequent 5s infinite;
}

@keyframes lightning-frequent {
    0%, 5%, 6%, 12%, 13%, 100% {
        background: rgba(255, 255, 255, 0);
    }
    5.5% {
        background: rgba(255, 255, 255, 0.6);
    }
    12.5% {
        background: rgba(255, 255, 255, 0.4);
    }
}

/* ========== ОПТИМИЗАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */

/* На слабых устройствах уменьшаем количество эффектов */
@media (max-width: 768px) {
    /* Меньше снежинок на мобильных */
    .snowflake:nth-child(n+20) {
        display: none;
    }
    
    /* Меньше капель дождя */
    .raindrop:nth-child(n+30) {
        display: none;
    }
    
    /* Меньше звезд */
    .star:nth-child(n+40) {
        display: none;
    }
    
    /* Упрощаем анимации */
    .snowflake {
        animation-duration: 3s !important;
    }
    
    .raindrop {
        animation-duration: 0.8s !important;
    }
}

/* На очень слабых устройствах отключаем все эффекты кроме градиента */
@media (max-width: 576px) and (prefers-reduced-motion: reduce) {
    .weather-effect-snow,
    .weather-effect-rain,
    .weather-effect-stars,
    .weather-effect-lightning {
        display: none;
    }
}

/* Режим энергосбережения - убираем анимации */
@media (prefers-reduced-motion: reduce) {
    .snowflake,
    .raindrop,
    .star {
        animation: none;
    }
}
