.ean-weather-widget {
  --wx-card-bg: #eef2f6;
  --wx-surface: rgba(255, 255, 255, 0.82);
  --wx-surface-strong: rgba(255, 255, 255, 0.94);
  --wx-border: rgba(15, 23, 42, 0.08);
  --wx-border-strong: rgba(15, 23, 42, 0.12);
  --wx-shadow:
    0 10px 28px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.05);

  --wx-text: #1f2937;
  --wx-muted: #6b7280;
  --wx-hero-fg: #ffffff;
  --wx-hero-muted: rgba(255, 255, 255, 0.82);

  --wx-grad-base: linear-gradient(135deg, #1f4568 0%, #5c89ad 52%, #8db5cd 100%);
  --wx-grad-cold: linear-gradient(135deg, #244563 0%, #5d83aa 45%, #a8c8dc 100%);
  --wx-grad-warm: linear-gradient(135deg, #8f4d18 0%, #c97b28 45%, #efb25d 100%);
  --wx-grad-hot: linear-gradient(135deg, #8c3417 0%, #d35a1e 42%, #f2a24a 100%);
  --wx-grad-rain: linear-gradient(135deg, #2f3f53 0%, #50667f 45%, #8aa0b6 100%);

  --wx-rain-bg: rgba(59, 130, 246, 0.12);
  --wx-rain-fg: #1d4ed8;

  --wx-wind-bg: rgba(100, 116, 139, 0.14);
  --wx-wind-fg: #334155;

  --wx-uv-mod-bg: rgba(245, 158, 11, 0.14);
  --wx-uv-mod-fg: #b45309;

  --wx-uv-high-bg: rgba(249, 115, 22, 0.16);
  --wx-uv-high-fg: #c2410c;

  --wx-good-bg: rgba(34, 197, 94, 0.12);
  --wx-good-fg: #15803d;

  width: 100%;
}

.ean-weather-card {
  overflow: hidden;
  position: relative;
  border: 1px solid var(--wx-border);
  border-radius: 18px;
  background: var(--wx-card-bg);
  box-shadow: var(--wx-shadow);
  color: var(--wx-text);
}

.ean-weather-card.is-loading {
  opacity: 0.96;
}

.ean-weather-hero {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  background: var(--wx-grad-base);
  background-size: 240% 240%;
  animation: wxGradientShift 10s ease-in-out infinite;
  color: var(--wx-hero-fg);
}

.ean-weather-card.is-cold .ean-weather-hero {
  background: var(--wx-grad-cold);
}

.ean-weather-card.is-warm .ean-weather-hero {
  background: var(--wx-grad-warm);
}

.ean-weather-card.is-theme-dawn .ean-weather-hero {
  filter: saturate(1.04) brightness(1.03);
}

.ean-weather-card.is-theme-day .ean-weather-hero {
  filter: saturate(1.08) brightness(1.02);
}

.ean-weather-card.is-theme-dusk .ean-weather-hero {
  filter: saturate(0.98) brightness(0.96);
}

.ean-weather-card.is-theme-night .ean-weather-hero {
  filter: saturate(0.82) brightness(0.78);
}

.ean-weather-card.is-hot .ean-weather-hero {
  background: var(--wx-grad-hot);
}

.ean-weather-card.is-raining .ean-weather-hero {
  background: var(--wx-grad-rain);
}

.ean-weather-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.06) 38%, rgba(255,255,255,0.00) 62%),
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.00) 42%);
  background-size: 220% 220%, 100% 100%;
  animation: wxHeroSheen 14s linear infinite;
  pointer-events: none;
}

.ean-weather-hero::after {
  content: "";
  position: absolute;
  inset: auto -15% -35% auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.ean-weather-card.is-sunny .ean-weather-hero::before {
  background:
    linear-gradient(120deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.09) 38%, rgba(255,255,255,0.00) 62%),
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.00) 42%),
    radial-gradient(circle at 88% 12%, rgba(255,240,190,0.34) 0%, rgba(255,220,130,0.12) 24%, rgba(255,255,255,0.00) 52%);
  background-size: 220% 220%, 100% 100%, 100% 100%;
  animation: wxHeroSheen 14s linear infinite, wxSunPulse 4.5s ease-in-out infinite;
  pointer-events: none;
}

.ean-weather-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ean-weather-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--wx-hero-muted);
}

.ean-weather-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  color: #fff;
  white-space: nowrap;
}

.ean-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 0 0 0 rgba(255,255,255,0.32);
  animation: wxLivePulse 1.6s infinite;
}

.ean-weather-status-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.ean-weather-hero-main {
  display: grid;
  gap: 5px;
}

.ean-weather-temp-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.ean-weather-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: rgba(255,255,255,0.90);
  transform: translateY(1px);
}

.ean-weather-temp {
  font-size: 46px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #fff;
  transition: transform 0.25s ease;
}

.ean-weather-card.is-temp-pop .ean-weather-temp {
  animation: wxTempPop 0.35s ease;
}

.ean-weather-feels {
  font-size: 14px;
  font-weight: 700;
  color: var(--wx-hero-muted);
}

.ean-weather-location {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}

.ean-weather-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.wx-pill {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--wx-border);
  border-radius: 999px;
  background: var(--wx-surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  color: var(--wx-text);
  backdrop-filter: blur(4px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.wx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: 0.86;
}

.wx-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wx-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
  color: var(--wx-muted);
  white-space: nowrap;
}

.wx-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.wx-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.wx-pill.is-humidity-comfort {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.12);
}

.wx-pill.is-pressure-steady {
  background: rgba(148, 163, 184, 0.10);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.12);
}

.wx-pill.is-raining {
  background: var(--wx-rain-bg);
  color: var(--wx-rain-fg);
  border-color: rgba(29, 78, 216, 0.16);
}

.wx-pill.is-windy,
.wx-pill.is-gusty {
  background: var(--wx-wind-bg);
  color: var(--wx-wind-fg);
  border-color: rgba(51, 65, 85, 0.12);
}

.wx-pill.is-uv-moderate {
  background: var(--wx-uv-mod-bg);
  color: var(--wx-uv-mod-fg);
  border-color: rgba(180, 83, 9, 0.12);
}

.wx-pill.is-uv-high {
  background: var(--wx-uv-high-bg);
  color: var(--wx-uv-high-fg);
  border-color: rgba(194, 65, 12, 0.12);
  box-shadow: 0 0 12px rgba(249,115,22,0.25);
  animation: wxHeatPulse 3s ease-in-out infinite;
}

.wx-pill.is-good {
  background: var(--wx-good-bg);
  color: var(--wx-good-fg);
  border-color: rgba(21, 128, 61, 0.12);
}

.ean-weather-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 12px 12px;
}

.ean-weather-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--wx-border);
  border-radius: 999px;
  background: var(--wx-surface-strong);
  color: var(--wx-muted);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ean-weather-mini-stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.ean-weather-mini-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--wx-muted);
  white-space: nowrap;
}

.ean-weather-card[data-hide-footer="1"] .ean-weather-footer,
.ean-weather-card[data-hide-solar="1"] .ean-weather-mini-stat-solar,
.ean-weather-card[data-hide-last-rain="1"] .ean-weather-mini-stat-last-rain,
.ean-weather-card[data-hide-updated="1"] .ean-weather-status {
  display: none;
}

.ean-weather-widget[data-compact="1"] .ean-weather-hero {
  padding: 14px 14px 12px;
}

.ean-weather-widget[data-compact="1"] .ean-weather-temp {
  font-size: 40px;
}

.ean-weather-widget[data-compact="1"] .ean-weather-grid {
  gap: 8px;
  padding: 10px;
}

.ean-weather-widget[data-compact="1"] .wx-pill {
  min-height: 40px;
  padding: 9px 10px;
}

.ean-weather-widget[data-compact="1"] .wx-label {
  font-size: 11px;
}

.ean-weather-widget[data-compact="1"] .wx-value {
  font-size: 12px;
}

.ean-weather-card.is-connected .ean-weather-status {
  background: rgba(255,255,255,0.10);
}

.ean-weather-card.is-disconnected .ean-weather-status {
  background: rgba(0,0,0,0.10);
}

.ean-weather-card.is-disconnected .ean-live-dot {
  animation: none;
  opacity: 0.55;
}

.wx-pill.is-windy .wx-icon svg,
.wx-pill.is-gusty .wx-icon svg {
  animation: wxWindDrift 2.1s ease-in-out infinite;
}

.wx-pill.is-raining .wx-icon svg {
  animation: wxRainPulse 1.8s ease-in-out infinite;
}

.wx-pill.is-uv-moderate .wx-icon svg,
.wx-pill.is-uv-high .wx-icon svg,
.ean-weather-card.is-sunny .ean-weather-mini-stat-solar .wx-icon svg {
  animation: wxSunIconSpin 8s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes wxGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes wxHeroSheen {
  0%   { background-position: 0% 0%, 0% 0%, 0% 0%; }
  100% { background-position: 130% 0%, 0% 0%, 0% 0%; }
}

@keyframes wxSunPulse {
  0%, 100% { opacity: 0.22; transform: scale(1); }
  50%      { opacity: 0.46; transform: scale(1.18); }
}

@keyframes wxLivePulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.34); }
  70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

@keyframes wxWindDrift {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50%      { transform: translateX(3px) rotate(2deg); }
}

@keyframes wxRainPulse {
  0%, 100% { opacity: 0.72; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(1px); }
}

@keyframes wxSunIconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes wxHeatPulse {
  0%,100% { box-shadow: 0 0 6px rgba(249,115,22,0.2); }
  50%     { box-shadow: 0 0 16px rgba(249,115,22,0.4); }
}

@keyframes wxTempPop {
  0%   { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 420px) {
  .ean-weather-grid {
    grid-template-columns: 1fr;
  }

  .ean-weather-status {
    max-width: 100%;
  }

  .ean-weather-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ean-weather-title {
    font-size: 12px;
  }

  .ean-weather-temp {
    font-size: 42px;
  }
}
