/* FILE: assets/css/weather.css */

/* =========================
   WEATHER BOX
========================= */

.weather-box {
  border-color: rgba(255, 215, 0, .75);

  box-shadow:
    0 0 0 1px rgba(255, 215, 0, .18),
    0 0 16px rgba(255, 215, 0, .35),
    0 10px 24px rgba(0,0,0,.22);

  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* =========================
   HEADER
========================= */

.weather-header {
  margin-bottom: 8px;
  position: relative;
  padding: 0;
  text-align: center;
}

.weather-header::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;

  bottom: -4px;
  height: 2px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 215, 0, 0.95),
    transparent
  );

  box-shadow:
    0 0 6px rgba(255, 215, 0, 0.8),
    0 0 12px rgba(255, 215, 0, 0.5);
}

.weather-header-center {
  text-align: center;
}

.weather-header strong {
  display: block;
  width: 100%;
  text-align: center;
  color: #7db7ff;
  font-size: 18px;
  letter-spacing: 0.4px;
  line-height: 1.5;
}

/* =========================
   MAIN WEATHER ROW
========================= */

.weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.weather-main-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.weather-main-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.12));
}

/* =========================
   TEMP / RANGE
========================= */

.weather-temp-wrap {
  min-width: 0;
  text-align: center;
}

.weather-temp {
  display: block;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.weather-range {
  display: block;
  margin-top: 3px;
  color: #bcd4f5;
  font-size: 13px;
  text-align: center;
}

/* =========================
   STATS
========================= */

.weather-stats {
  margin-top: 8px;

  display: grid;
  gap: 6px;
}

.weather-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;

  padding: 5px 8px;
  border-radius: 10px;

  background: rgba(255,255,255,.025);
}

.weather-row img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.weather-row span:first-of-type {
  color: var(--muted);
  font-size: 13px;
}

.weather-row span:last-child {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

/* =========================
   UPDATED TIME
========================= */

.weather-updated {
  margin-top: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* =========================
   ICON STATES
========================= */

.weather-sunny {
  animation: weatherSpin 18s linear infinite;
}

.weather-cloudy {
  animation: weatherFloat 4s ease-in-out infinite;
}

.weather-partly {
  animation: weatherFloat 3.5s ease-in-out infinite;
}

.weather-rain {
  animation: weatherRainPulse 1.8s ease-in-out infinite;
}

.weather-heavy-rain {
  animation: weatherRainPulse 1.1s ease-in-out infinite;
}

.weather-snow {
  animation: weatherFloat 2.6s ease-in-out infinite;
}

.weather-fog {
  animation: weatherFade 2.5s ease-in-out infinite;
}

.weather-storm {
  animation: weatherStorm 0.9s linear infinite;
}

/* =========================
   DANGER WEATHER MODE
========================= */

.weather-danger {
  border-color: rgba(255,59,48,.85);

  box-shadow:
    0 0 0 1px rgba(255,59,48,.20),
    0 0 18px rgba(255,59,48,.45),
    0 0 28px rgba(255,59,48,.24),
    0 10px 24px rgba(0,0,0,.22);
}

.weather-danger .weather-header::after {
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 59, 48, 0.95),
    transparent
  );

  box-shadow:
    0 0 6px rgba(255, 59, 48, 0.9),
    0 0 14px rgba(255, 59, 48, 0.6);
}

/* =========================
   ANIMATIONS
========================= */

@keyframes weatherSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes weatherFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

@keyframes weatherRainPulse {
  0%,100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(125,183,255,.08));
  }

  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(125,183,255,.22));
  }
}

@keyframes weatherFade {
  0%,100% { opacity: 1; }
  50%     { opacity: .65; }
}

@keyframes weatherStorm {
  0%,100% {
    transform: translateX(0);
    filter: drop-shadow(0 0 10px rgba(255,255,255,.08));
  }

  25% {
    transform: translateX(-2px);
  }

  50% {
    transform: translateX(2px);
    filter: drop-shadow(0 0 14px rgba(255,255,255,.25));
  }

  75% {
    transform: translateX(-1px);
  }
}

/* =========================
   ACCESSIBILITY
========================= */

@media (prefers-reduced-motion: reduce) {
  .weather-main-icon {
    animation: none !important;
  }
}