/* ============================================
   Weather Effects Overlay
   Subtle, atmospheric particles over the chat area
   based on live weather conditions.
   ============================================ */

#weather-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#weather-fx.active {
  opacity: 1;
}

/* ---- Rain ---- */
.wx-drop {
  position: absolute;
  top: -20px;
  width: 1.5px;
  border-radius: 0 0 1px 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-river-light, #5b8ab8) 30%,
    var(--color-river, #2d5a8f) 100%
  );
  opacity: 0;
  animation: wx-rain-fall linear infinite;
}

@keyframes wx-rain-fall {
  0% {
    transform: translateY(0) rotate(8deg);
    opacity: 0;
  }
  5% {
    opacity: var(--wx-opacity, 0.08);
  }
  90% {
    opacity: var(--wx-opacity, 0.08);
  }
  100% {
    transform: translateY(calc(100vh + 20px)) rotate(8deg);
    opacity: 0;
  }
}

/* ---- Snow ---- */
.wx-flake {
  position: absolute;
  top: -10px;
  width: var(--wx-size, 4px);
  height: var(--wx-size, 4px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: wx-snow-drift linear infinite;
  filter: blur(0.5px);
}

@keyframes wx-snow-drift {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  5% {
    opacity: var(--wx-opacity, 0.1);
  }
  25% {
    transform: translateY(25vh) translateX(var(--wx-sway, 15px));
  }
  50% {
    transform: translateY(50vh) translateX(0);
  }
  75% {
    transform: translateY(75vh) translateX(calc(var(--wx-sway, 15px) * -1));
  }
  90% {
    opacity: var(--wx-opacity, 0.1);
  }
  100% {
    transform: translateY(calc(100vh + 10px)) translateX(var(--wx-sway, 15px));
    opacity: 0;
  }
}

/* ---- Wind ---- */
.wx-gust {
  position: absolute;
  left: -120px;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, var(--wx-opacity, 0.06)) 30%,
    rgba(255, 255, 255, var(--wx-opacity, 0.06)) 70%,
    transparent 100%
  );
  opacity: 0;
  animation: wx-wind-sweep ease-in-out infinite;
}

@keyframes wx-wind-sweep {
  0% {
    transform: translateX(0) scaleX(0.6);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateX(10vw) scaleX(0.8);
  }
  50% {
    opacity: 1;
    transform: translateX(55vw) scaleX(1);
  }
  90% {
    opacity: 1;
    transform: translateX(100vw) scaleX(0.8);
  }
  100% {
    transform: translateX(110vw) scaleX(0.6);
    opacity: 0;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  #weather-fx {
    display: none;
  }
}
