/* 23G — Hava durumu animasyonları (anlamlı, duruma özel) */

.weather-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.weather-panel__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.weather-scene-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.02em;
}

.weather-scene-badge--clear { background: rgba(255, 200, 80, 0.2); border-color: rgba(255, 220, 120, 0.35); }
.weather-scene-badge--rain,
.weather-scene-badge--drizzle,
.weather-scene-badge--showers,
.weather-scene-badge--showers-heavy,
.weather-scene-badge--rain-light { background: rgba(100, 160, 255, 0.2); border-color: rgba(140, 190, 255, 0.35); }
.weather-scene-badge--snow,
.weather-scene-badge--snow-light,
.weather-scene-badge--snow-showers { background: rgba(220, 235, 255, 0.15); border-color: rgba(200, 220, 255, 0.35); }
.weather-scene-badge--thunderstorm { background: rgba(120, 100, 200, 0.25); border-color: rgba(180, 160, 255, 0.4); }

.weather-wind-chip {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  opacity: 0.9;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  display: inline-block;
  width: fit-content;
  position: relative;
  z-index: 2;
}

.weather-wind-chip--moderate,
.weather-wind-chip--strong {
  background: rgba(78, 207, 143, 0.12);
  border: 1px solid rgba(78, 207, 143, 0.25);
}

.weather-panel__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.weather-panel__time {
  font-size: 0.78rem;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.weather-main-row {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.weather-current {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 220px;
}

.weather-temp-big {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
}

.weather-desc-big {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.weather-details-big {
  font-size: 0.92rem;
  opacity: 0.9;
}

.weather-forecast-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-left: 1.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-panel__note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.wx-sun {
  position: absolute;
}

.panel--weather::before {
  content: "🌾";
  position: absolute;
  bottom: 0.5rem;
  left: 0.75rem;
  font-size: 1.1rem;
  opacity: 0.2;
  z-index: 1;
  pointer-events: none;
}

.panel--weather {
  position: relative;
  overflow: hidden;
  border: none !important;
  min-height: 220px;
  background: linear-gradient(160deg, #1a3d52 0%, #1e4d3a 45%, #163828 100%) !important;
  transition: background 1.2s ease;
}

.panel--weather[data-weather-scene="clear"] {
  background: linear-gradient(160deg, #2a5f7a 0%, #3a8f5c 50%, #1e5c3a 100%) !important;
}

.panel--weather[data-weather-scene="partly-cloudy"] {
  background: linear-gradient(160deg, #2d5670 0%, #3a7a58 50%, #1e4a38 100%) !important;
}

.panel--weather[data-weather-scene="cloudy"],
.panel--weather[data-weather-scene="fog"] {
  background: linear-gradient(160deg, #3a4a55 0%, #354550 50%, #2a3538 100%) !important;
}

.panel--weather[data-weather-scene="drizzle"],
.panel--weather[data-weather-scene="rain-light"],
.panel--weather[data-weather-scene="rain"],
.panel--weather[data-weather-scene="showers"],
.panel--weather[data-weather-scene="showers-heavy"],
.panel--weather[data-weather-scene="thunderstorm"] {
  background: linear-gradient(160deg, #1e3345 0%, #1e3d38 50%, #152820 100%) !important;
}

.panel--weather[data-weather-scene="snow-light"],
.panel--weather[data-weather-scene="snow"],
.panel--weather[data-weather-scene="snow-showers"] {
  background: linear-gradient(160deg, #4a5a68 0%, #455560 50%, #3a4550 100%) !important;
}

.weather-scene {
  position: absolute;
  inset: 0;
}

/* Büyük durum simgesi + etiket (anlaşılır) */
.wx-pictogram {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  line-height: 1;
  opacity: 0.22;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
  animation: wx-pictogram-float 6s ease-in-out infinite;
  z-index: 1;
}

.wx-scene-caption {
  position: absolute;
  left: 1rem;
  bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.45;
  z-index: 1;
}

@keyframes wx-pictogram-float {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(calc(-50% - 6px)) scale(1.03); }
}

/* Sahne arka planı — içerik üstte */
#weather-scene-mount {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.weather-panel__content {
  position: relative;
  z-index: 2;
}

/* --- Gün / açık --- */
.weather-scene--clear {
  background: linear-gradient(180deg, #3a7ca5 0%, #5a9e6f 55%, #2d6b4a 100%);
}

.weather-scene--clear .wx-sun,
.weather-scene--partly-cloudy .wx-sun {
  position: absolute;
  top: 14%;
  left: 12%;
  width: 88px;
  height: 88px;
}

.weather-scene--partly-cloudy .wx-sun {
  width: 64px;
  height: 64px;
  opacity: 0.9;
}

.weather-scene--clear .wx-sun__core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8 0%, #f5c842 55%, transparent 72%);
  animation: wx-sun-pulse 4s ease-in-out infinite;
}

.weather-scene--clear .wx-sun__rays {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 8deg,
    rgba(255, 230, 140, 0.35) 8deg 12deg,
    transparent 12deg 20deg,
    rgba(255, 230, 140, 0.25) 20deg 24deg,
    transparent 24deg 360deg
  );
  animation: wx-sun-spin 24s linear infinite;
}

@keyframes wx-sun-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes wx-sun-spin {
  to { transform: rotate(360deg); }
}

/* --- Parçalı bulutlu --- */
.weather-scene--partly-cloudy {
  background: linear-gradient(180deg, #4a7fa8 0%, #4a8f6a 50%, #2a5c42 100%);
}

/* --- Bulutlu --- */
.weather-scene--cloudy {
  background: linear-gradient(180deg, #4a5f6e 0%, #3d5560 50%, #2a4038 100%);
}

.wx-cloud {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-cloud__puff {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50px;
  box-shadow:
    -18px 0 0 -4px rgba(255, 255, 255, 0.28),
    18px 0 0 -4px rgba(255, 255, 255, 0.28),
    0 -10px 0 -6px rgba(255, 255, 255, 0.22);
  filter: blur(1px);
}

.wx-cloud--a {
  width: 120px;
  height: 36px;
  top: 18%;
  left: -20%;
  animation: wx-cloud-drift-a 28s linear infinite;
}

.wx-cloud--b {
  width: 90px;
  height: 28px;
  top: 38%;
  right: -15%;
  animation: wx-cloud-drift-b 22s linear infinite reverse;
}

.wx-cloud--c {
  width: 140px;
  height: 40px;
  top: 8%;
  left: 40%;
  animation: wx-cloud-drift-c 35s linear infinite;
}

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

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

@keyframes wx-cloud-drift-c {
  0% { transform: translateX(-30px); }
  50% { transform: translateX(30px); }
  100% { transform: translateX(-30px); }
}

/* --- Sis --- */
.weather-scene--fog {
  background: linear-gradient(180deg, #6b7d85 0%, #5a6d75 40%, #3d4f55 100%);
}

.wx-fog {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  filter: blur(8px);
}

.wx-fog--1 {
  bottom: 20%;
  animation: wx-fog-drift 12s ease-in-out infinite;
}

.wx-fog--2 {
  bottom: 45%;
  animation: wx-fog-drift 16s ease-in-out infinite reverse;
  opacity: 0.7;
}

@keyframes wx-fog-drift {
  0%, 100% { transform: translateX(-5%); opacity: 0.5; }
  50% { transform: translateX(5%); opacity: 0.85; }
}

/* --- Yağmur / çisenti / sağanak --- */
.weather-scene--drizzle,
.weather-scene--rain-light,
.weather-scene--rain,
.weather-scene--showers,
.weather-scene--showers-heavy,
.weather-scene--thunderstorm {
  background: linear-gradient(180deg, #2c4a5e 0%, #2a4d45 55%, #1e3328 100%);
}

.wx-rain {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0px,
    transparent 4px,
    rgba(174, 214, 255, 0.35) 4px,
    rgba(174, 214, 255, 0.35) 5px,
    transparent 5px,
    transparent 12px
  );
  background-size: 14px 28px;
  animation: wx-rain-fall 0.55s linear infinite;
  opacity: 0.65;
}

.weather-scene--drizzle .wx-rain {
  animation-duration: 0.9s;
  opacity: 0.4;
  background-size: 10px 20px;
}

.weather-scene--rain-light .wx-rain {
  animation-duration: 0.7s;
  opacity: 0.55;
}

.weather-scene--rain .wx-rain,
.weather-scene--showers .wx-rain {
  animation-duration: 0.45s;
  opacity: 0.75;
}

.weather-scene--showers-heavy .wx-rain,
.weather-scene--thunderstorm .wx-rain {
  animation-duration: 0.32s;
  opacity: 0.9;
  background-size: 12px 22px;
}

@keyframes wx-rain-fall {
  0% { background-position: 0 0; }
  100% { background-position: 14px 28px; }
}

/* --- Kar --- */
.weather-scene--snow-light,
.weather-scene--snow,
.weather-scene--snow-showers {
  background: linear-gradient(180deg, #5a6d7a 0%, #4a5d68 45%, #3a4a55 100%);
}

.wx-snow {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1.5px);
  background-size: 48px 48px, 72px 72px;
  background-position: 0 0, 24px 36px;
  animation: wx-snow-fall 6s linear infinite;
  opacity: 0.85;
}

.weather-scene--snow-light .wx-snow {
  animation-duration: 9s;
  opacity: 0.55;
}

.weather-scene--snow-showers .wx-snow {
  animation-duration: 4s;
  opacity: 0.95;
}

@keyframes wx-snow-fall {
  0% { background-position: 0 0, 24px 36px; }
  100% { background-position: 48px 96px, 72px 132px; }
}

/* --- Fırtına --- */
.weather-scene--thunderstorm {
  background: linear-gradient(180deg, #1a2838 0%, #1e2f35 50%, #152820 100%);
}

.wx-lightning {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  animation: wx-lightning-flash 5s ease-in-out infinite;
  pointer-events: none;
}

.wx-bolt {
  position: absolute;
  top: 22%;
  left: 28%;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 42px solid rgba(255, 240, 120, 0.85);
  transform: skewX(-8deg);
  filter: drop-shadow(0 0 12px rgba(255, 255, 200, 0.6));
  opacity: 0;
  animation: wx-bolt-strike 5s ease-in-out infinite;
}

@keyframes wx-bolt-strike {
  0%, 88%, 100% { opacity: 0; transform: skewX(-8deg) translateY(0); }
  90% { opacity: 1; transform: skewX(-8deg) translateY(4px); }
  92% { opacity: 0.3; }
}

@keyframes wx-lightning-flash {
  0%, 89%, 100% { background: rgba(255, 255, 255, 0); }
  90% { background: rgba(220, 235, 255, 0.12); }
  91% { background: rgba(255, 255, 255, 0.35); }
  92% { background: rgba(220, 235, 255, 0.08); }
  93% { background: rgba(255, 255, 255, 0); }
}

/* Rüzgar — panel üzerinde ince çizgiler */
.panel--weather[data-wind-level="moderate"]::after,
.panel--weather[data-wind-level="strong"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 40px,
    rgba(255, 255, 255, 0.04) 40px 41px,
    transparent 41px 80px
  );
  animation: wx-wind-sweep 2.5s linear infinite;
}

.panel--weather[data-wind-level="strong"]::after {
  animation-duration: 1.2s;
  opacity: 0.5;
}

@keyframes wx-wind-sweep {
  0% { background-position: 0 0; }
  100% { background-position: 80px 0; }
}

/* Canlı ikon (sıcaklık yanı) */
.weather-live-icon {
  position: relative;
  width: 4.75rem;
  height: 5.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.5rem;
}

.weather-live-icon__emoji {
  font-size: 3rem;
  line-height: 1;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.weather-live-icon__label {
  position: absolute;
  bottom: -0.15rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  z-index: 3;
}

.weather-live-icon__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  animation: wx-icon-ring 3s ease-in-out infinite;
}

.panel--weather[data-weather-scene="clear"] .weather-live-icon__ring,
.panel--weather[data-weather-scene="partly-cloudy"] .weather-live-icon__ring {
  box-shadow: 0 0 20px rgba(255, 200, 80, 0.35);
}

.panel--weather[data-weather-scene="rain"] .weather-live-icon__ring,
.panel--weather[data-weather-scene="rain-light"] .weather-live-icon__ring,
.panel--weather[data-weather-scene="drizzle"] .weather-live-icon__ring,
.panel--weather[data-weather-scene="showers"] .weather-live-icon__ring {
  box-shadow: 0 0 16px rgba(120, 180, 255, 0.4);
}

.panel--weather[data-weather-scene="snow"] .weather-live-icon__ring,
.panel--weather[data-weather-scene="snow-light"] .weather-live-icon__ring {
  box-shadow: 0 0 16px rgba(220, 235, 255, 0.45);
}

.panel--weather[data-weather-scene="thunderstorm"] .weather-live-icon__ring {
  animation: wx-icon-ring 1.5s ease-in-out infinite, wx-thunder-pulse 5s ease-in-out infinite;
}

@keyframes wx-icon-ring {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes wx-thunder-pulse {
  0%, 88%, 100% { border-color: rgba(255, 255, 255, 0.25); }
  90% { border-color: rgba(200, 220, 255, 0.9); }
}

/* Tahmin kartları — mini sahne */
.forecast-item--animated {
  position: relative;
  overflow: hidden;
  min-width: 100px;
  padding: 3.2rem 0.5rem 0.65rem !important;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.f-scene-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(200, 230, 215, 0.95);
  margin-bottom: 0.2rem;
}

.forecast-mini-scene {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.75rem;
  opacity: 0.7;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forecast-mini-pictogram {
  font-size: 1.65rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  z-index: 1;
}

.forecast-mini-scene.weather-scene--clear {
  background: linear-gradient(180deg, rgba(255, 200, 100, 0.35), transparent);
}

.forecast-mini-scene.weather-scene--rain,
.forecast-mini-scene.weather-scene--rain-light,
.forecast-mini-scene.weather-scene--drizzle,
.forecast-mini-scene.weather-scene--showers,
.forecast-mini-scene.weather-scene--showers-heavy {
  background: repeating-linear-gradient(115deg, transparent, rgba(174, 214, 255, 0.4) 2px, transparent 4px);
  background-size: 6px 10px;
  animation: wx-rain-fall 0.8s linear infinite;
}

.forecast-mini-scene.weather-scene--showers-heavy {
  animation-duration: 0.5s;
}

.forecast-mini-scene.weather-scene--snow,
.forecast-mini-scene.weather-scene--snow-light,
.forecast-mini-scene.weather-scene--snow-showers {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 2px);
  background-size: 12px 12px;
  animation: wx-snow-fall 5s linear infinite;
}

.forecast-mini-scene.weather-scene--snow-showers {
  animation-duration: 3s;
}

.forecast-mini-scene.weather-scene--cloudy,
.forecast-mini-scene.weather-scene--partly-cloudy {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: wx-fog-drift 8s ease-in-out infinite;
}

.forecast-mini-scene.weather-scene--fog {
  background: rgba(255, 255, 255, 0.12);
  animation: wx-fog-drift 6s ease-in-out infinite;
}

.forecast-mini-scene.weather-scene--thunderstorm {
  background: linear-gradient(180deg, rgba(100, 120, 180, 0.5), transparent);
  animation: wx-lightning-flash 4s ease-in-out infinite;
}

.f-desc {
  font-size: 0.7rem;
  opacity: 0.85;
  text-align: center;
  max-width: 5.5rem;
  line-height: 1.2;
}

/* Panel geçişi sırasında içerik */
#weather-temp-big {
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.panel--weather.wx-updating #weather-temp-big {
  opacity: 0.5;
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .weather-scene *,
  .wx-rain,
  .wx-snow,
  .wx-cloud,
  .wx-fog,
  .wx-lightning,
  .forecast-mini-scene,
  .weather-live-icon__ring,
  .panel--weather::after {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .panel--weather {
    min-height: auto !important;
    margin-bottom: 0.75rem !important;
  }

  .weather-panel__title {
    font-size: 0.95rem;
  }

  .weather-panel__time {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
  }

  .weather-main-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .weather-current {
    gap: 0.65rem;
    flex: 1 1 auto;
  }

  .weather-temp-big {
    font-size: 2rem;
  }

  .weather-desc-big {
    font-size: 0.95rem;
  }

  .weather-details-big {
    font-size: 0.8rem;
  }

  .weather-forecast-container {
    width: 100%;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 0.55rem;
    gap: 0.55rem;
    justify-content: space-between;
  }

  .weather-live-icon {
    transform: scale(0.88);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .panel--weather {
    min-height: auto !important;
    margin-bottom: 1rem !important;
  }

  .weather-temp-big {
    font-size: 2.35rem;
  }

  .weather-main-row {
    gap: 1rem;
  }

  .weather-forecast-container {
    padding-left: 0.85rem;
    gap: 0.65rem;
  }
}
