/* weather-effects.css — 天气特效 CSS 动画叠加层 */

/* ===== 叠加容器 ===== */
.weather-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

/* ===== 雨滴 ===== */
.rain-container {
  position: absolute;
  inset: 0;
  display: none;
}

.rain-container.active {
  display: block;
}

.rain-drop {
  position: absolute;
  top: -20px;
  width: 2px;
  background: linear-gradient(transparent, rgba(180, 210, 240, 0.6));
  animation: rain-fall linear infinite;
}

@keyframes rain-fall {
  0% {
    transform: translateY(-20px) rotate(15deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(100vh) rotate(15deg);
    opacity: 0;
  }
}

/* 大雨 */
.rain-drop.heavy {
  width: 3px;
  background: linear-gradient(transparent, rgba(160, 200, 230, 0.8));
  animation-duration: 0.4s;
}

/* 中雨 */
.rain-drop.medium {
  width: 2px;
  animation-duration: 0.7s;
}

/* 小雨 */
.rain-drop.light {
  width: 1.5px;
  animation-duration: 1.2s;
}

/* ===== 雪花 ===== */
.snow-container {
  position: absolute;
  inset: 0;
  display: none;
}

.snow-container.active {
  display: block;
}

.snowflake {
  position: absolute;
  top: -10px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: snow-fall linear infinite;
  filter: blur(0.5px);
}

@keyframes snow-fall {
  0% {
    transform: translateY(-10px) translateX(0px) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translateY(25vh) translateX(15px) rotate(90deg);
  }
  50% {
    transform: translateY(50vh) translateX(-10px) rotate(180deg);
  }
  75% {
    transform: translateY(75vh) translateX(20px) rotate(270deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(105vh) translateX(-15px) rotate(360deg);
    opacity: 0;
  }
}

/* ===== 闪电 ===== */
.lightning-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  pointer-events: none;
  transition: background 0.05s ease;
}

.lightning-flash.active {
  animation: lightning-bolt 2s ease infinite;
}

@keyframes lightning-bolt {
  0%, 100% { background: rgba(255, 255, 255, 0); }
  5% { background: rgba(255, 255, 255, 0.2); }
  7% { background: rgba(255, 255, 255, 0); }
  10% { background: rgba(255, 255, 255, 0.1); }
  12% { background: rgba(255, 255, 255, 0); }
  45% { background: rgba(255, 255, 255, 0); }
  50% { background: rgba(255, 255, 255, 0.25); }
  51% { background: rgba(255, 255, 255, 0); }
  53% { background: rgba(255, 255, 255, 0.12); }
  55% { background: rgba(255, 255, 255, 0); }
}

/* ===== 云层漂移 ===== */
@keyframes cloud-drift {
  0% { transform: translateX(-150%); }
  100% { transform: translateX(150%); }
}

@keyframes cloud-drift-slow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== 太阳光晕 (晴天) ===== */
@keyframes sun-glow {
  0%, 100% {
    box-shadow: 0 0 60px rgba(255, 200, 50, 0.4),
                0 0 120px rgba(255, 180, 30, 0.2);
  }
  50% {
    box-shadow: 0 0 80px rgba(255, 200, 50, 0.5),
                0 0 150px rgba(255, 180, 30, 0.3);
  }
}

/* ===== 渐变色天空主题 ===== */
.theme-sunny {
  --sky-top: #4facfe;
  --sky-bottom: #e0f0ff;
}

.theme-cloudy {
  --sky-top: #8fa4b8;
  --sky-bottom: #d0dce8;
}

.theme-overcast {
  --sky-top: #7a8a9a;
  --sky-bottom: #b0c0d0;
}

.theme-rain {
  --sky-top: #5a6a7e;
  --sky-bottom: #9aaabc;
}

.theme-snow {
  --sky-top: #a0b4c8;
  --sky-bottom: #dce4f0;
}

.theme-fog {
  --sky-top: #9a9a9a;
  --sky-bottom: #c8c8c8;
}

.theme-storm {
  --sky-top: #3a4a5e;
  --sky-bottom: #6a7a8e;
}

/* ===== 通用天气动画 ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes wave {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
