/* ================================================================
   Meteo OpenData v2.0 — CSS
   Stili per: widget full, widget compact, grafico temperatura,
   previsioni orarie 24h, allerta vento.
================================================================ */

.meteo-widget {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #37474F;
  line-height: 1.4;
  max-width: 960px;
  margin: 0 auto;
}

/* ── Loading / Error ─────────────────────────────────────────── */
.meteo-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 40px; color: #90A4AE;
}
.meteo-spinner {
  width: 36px; height: 36px;
  border: 3px solid #E0E0E0; border-top-color: #42A5F5;
  border-radius: 50%;
  animation: meteo-spin 0.8s linear infinite;
}
@keyframes meteo-spin { to { transform: rotate(360deg); } }
.meteo-error {
  padding: 20px; background: #FFF8E1;
  border-left: 4px solid #FFB300; border-radius: 8px; color: #5D4037;
}

/* ── Header: città + condizioni attuali ──────────────────────── */
.meteo-header {
  background: linear-gradient(135deg, #E3F2FD 0%, #E8F5E9 100%);
  border-radius: 12px 12px 0 0;
  padding: 20px 24px;
  border-bottom: 1px solid #E0E0E0;
}
.meteo-location {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #607D8B; margin-bottom: 16px;
}
.meteo-city { font-size: 16px; font-weight: 600; color: #263238; }
.meteo-current { display: flex; align-items: center; gap: 20px; }
.meteo-cur-icon { width: 72px; height: 72px; flex-shrink: 0; }
.meteo-cur-icon svg { width: 100%; height: 100%; }
.meteo-cur-temp { font-size: 52px; font-weight: 300; color: #1A237E; line-height: 1; }
.meteo-cur-meta { flex: 1; }
.meteo-cur-label { font-size: 17px; font-weight: 500; color: #37474F; }
.meteo-cur-feels { font-size: 13px; color: #78909C; margin-top: 2px; }
.meteo-cur-extra { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: #546E7A; }

/* ── Griglia 7 giorni ────────────────────────────────────────── */
.meteo-days {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: #fff;
  border: 1px solid #E0E0E0; border-top: none;
  overflow: hidden;
}
.meteo-day {
  padding: 14px 8px; text-align: center;
  border-right: 1px solid #F0F4F8;
  transition: background .15s;
}
.meteo-day:last-child { border-right: none; }
.meteo-day:hover { background: #F5F9FF; }
.meteo-day--today { background: #EEF6FF; border-top: 3px solid #42A5F5; }
.meteo-day-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #607D8B; margin-bottom: 8px; }
.meteo-day--today .meteo-day-name { color: #1565C0; }
.meteo-day-icon { width: 44px; height: 44px; margin: 0 auto 6px; }
.meteo-day-icon svg { width: 100%; height: 100%; }
.meteo-day-label { font-size: 10px; color: #90A4AE; margin-bottom: 8px; min-height: 28px; display: flex; align-items: center; justify-content: center; line-height: 1.3; }
.meteo-day-temps { font-size: 14px; margin-bottom: 6px; white-space: nowrap; }
.meteo-max { font-weight: 700; color: #BF360C; }
.meteo-sep { color: #B0BEC5; }
.meteo-min { font-weight: 400; color: #1565C0; }
.meteo-day-rain { font-size: 10px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meteo-day-wind { font-size: 10px; color: #78909C; }

/* ── Allerta vento ───────────────────────────────────────────── */
.meteo-wind--warning { color: #E65100 !important; font-weight: 600; }
.meteo-wind--danger  { color: #B71C1C !important; font-weight: 700; }
.meteo-wind-legend {
  display: flex; gap: 20px; padding: 8px 16px;
  font-size: 11px; color: #78909C;
  background: #FAFAFA; border: 1px solid #E0E0E0; border-top: none;
}

/* ── Grafico temperatura ─────────────────────────────────────── */
.meteo-chart {
  background: #fff;
  border: 1px solid #E0E0E0; border-top: none;
  padding: 16px 24px 8px;
}
.meteo-chart-title, .meteo-section-title {
  font-size: 13px; font-weight: 600; color: #546E7A;
  margin-bottom: 12px; letter-spacing: .3px;
}
.meteo-chart-bars {
  display: flex; align-items: flex-end; justify-content: space-around;
  gap: 4px; padding: 4px 0;
}
.meteo-chart-col {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex: 1;
}
.meteo-chart-stack {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; min-height: 70px; justify-content: flex-end;
}
.meteo-chart-bar {
  width: 60%; min-height: 4px; border-radius: 3px 3px 0 0;
  transition: height .4s ease;
}
.meteo-chart-bar--max { background: #EF9A9A; border-radius: 4px 4px 0 0; }
.meteo-chart-bar--min { background: #90CAF9; border-radius: 0; }
.meteo-chart-val { font-size: 10px; font-weight: 600; line-height: 1.2; }
.meteo-chart-val--max { color: #BF360C; }
.meteo-chart-val--min { color: #1565C0; }
.meteo-chart-day { font-size: 10px; color: #90A4AE; margin-top: 4px; font-weight: 600; text-transform: uppercase; }

/* ── Previsioni orarie ───────────────────────────────────────── */
.meteo-hourly {
  background: #fff;
  border: 1px solid #E0E0E0; border-top: none;
  padding: 16px 24px;
}
.meteo-hourly-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.meteo-hourly-scroll::-webkit-scrollbar { height: 4px; }
.meteo-hourly-scroll::-webkit-scrollbar-track { background: #F5F5F5; }
.meteo-hourly-scroll::-webkit-scrollbar-thumb { background: #CFD8DC; border-radius: 2px; }
.meteo-hourly-inner {
  display: flex; gap: 4px;
  min-width: max-content; padding-bottom: 4px;
}
.meteo-hour {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 8px;
  min-width: 60px; text-align: center;
  border-radius: 8px;
  transition: background .15s;
}
.meteo-hour:hover { background: #F0F4F8; }
.meteo-hour-time { font-size: 11px; font-weight: 700; color: #607D8B; }
.meteo-hour-icon { width: 32px; height: 32px; }
.meteo-hour-icon svg { width: 100%; height: 100%; }
.meteo-hour-temp { font-size: 14px; font-weight: 600; color: #263238; }
.meteo-hour-prob { font-size: 10px; color: #42A5F5; }
.meteo-hour-wind { font-size: 10px; color: #78909C; }

/* ── Footer ──────────────────────────────────────────────────── */
.meteo-footer {
  margin-top: 10px; font-size: 11px; color: #B0BEC5;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 4px;
}
.meteo-footer a { color: #90A4AE; text-decoration: none; }
.meteo-footer a:hover { text-decoration: underline; }
.meteo-footer-brand {
  font-size: 11px; font-weight: 600; color: #78909C; letter-spacing: 0.2px;
}
.meteo-footer-brand a { color: #42A5F5 !important; font-weight: 700; }
.meteo-footer-brand a:hover { color: #1E88E5 !important; text-decoration: underline; }
.meteo-footer-data { font-size: 11px; color: #B0BEC5; }

/* ════════════════════════════════════════════════════════════════
   WIDGET COMPATTO (sidebar)
════════════════════════════════════════════════════════════════ */
.meteo-widget--compact { max-width: 300px; }

.meteo-compact {
  background: linear-gradient(135deg, #E3F2FD 0%, #E8F5E9 100%);
  border-radius: 12px;
  border: 1px solid #E0E0E0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.meteo-compact-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.meteo-compact-icon { width: 48px; height: 48px; flex-shrink: 0; }
.meteo-compact-icon svg { width: 100%; height: 100%; }
.meteo-compact-city { font-size: 13px; font-weight: 700; color: #263238; margin-bottom: 2px; }
.meteo-compact-temp { font-size: 22px; font-weight: 300; color: #1A237E; }
.meteo-compact-label { font-size: 12px; color: #607D8B; font-weight: 400; }
.meteo-compact-extra { font-size: 11px; color: #78909C; margin-top: 3px; }

.meteo-compact-days { display: flex; gap: 4px; }
.meteo-compact-day {
  flex: 1; text-align: center; padding: 8px 4px;
  background: rgba(255,255,255,.6); border-radius: 8px;
}
.meteo-compact-dayname { font-size: 10px; font-weight: 700; color: #607D8B; text-transform: uppercase; margin-bottom: 4px; }
.meteo-compact-dayicon { width: 28px; height: 28px; margin: 0 auto 4px; }
.meteo-compact-dayicon svg { width: 100%; height: 100%; }
.meteo-compact-daytemps { font-size: 11px; white-space: nowrap; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  .meteo-days { grid-template-columns: repeat(4,1fr); }
  .meteo-day:nth-child(n+5) { border-top: 1px solid #F0F4F8; }
  .meteo-cur-temp { font-size: 40px; }
  .meteo-chart { padding: 12px 12px 8px; }
  .meteo-hourly { padding: 12px; }
}
@media (max-width: 480px) {
  .meteo-days { grid-template-columns: repeat(2,1fr); }
  .meteo-header { padding: 16px; }
  .meteo-current { gap: 12px; }
  .meteo-cur-icon { width: 56px; height: 56px; }
  .meteo-wind-legend { flex-direction: column; gap: 4px; }
}

/* ================================================================
   WIDGET CARD — [meteo_card]
   Orizzontale: colonna sinistra condizioni attuali + 6 giorni
================================================================ */
.meteo-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 14px;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

/* Colonna sinistra — condizioni attuali */
.meteo-card-current {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 24px;
  min-width: 160px;
  background: linear-gradient(160deg, #E3F2FD 0%, #E8F5E9 100%);
  border-right: 1px solid #E0E0E0;
  flex-shrink: 0;
}
.meteo-card-loc {
  font-size: 12px;
  font-weight: 700;
  color: #607D8B;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meteo-card-now {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meteo-card-cur-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.meteo-card-cur-icon svg { width: 100%; height: 100%; }
.meteo-card-temp {
  font-size: 36px;
  font-weight: 300;
  color: #1A237E;
  line-height: 1;
}
.meteo-card-desc {
  font-size: 12px;
  font-weight: 500;
  color: #455A64;
  margin-top: 3px;
}
.meteo-card-feels {
  font-size: 11px;
  color: #90A4AE;
  margin-top: 2px;
}

/* Divisore verticale */
.meteo-card-divider {
  width: 1px;
  background: #ECEFF1;
  flex-shrink: 0;
}

/* Colonne giorni */
.meteo-card-days {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.meteo-card-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  border-right: 1px solid #F5F5F5;
  gap: 5px;
  transition: background .15s;
}
.meteo-card-day:last-child { border-right: none; }
.meteo-card-day:hover { background: #F9FBFF; }
.meteo-card-day--today {
  background: #F0F7FF;
  border-top: 3px solid #42A5F5;
}
.meteo-card-day-label {
  font-size: 11px;
  color: #78909C;
  text-align: center;
  letter-spacing: .3px;
}
.meteo-card-day--today .meteo-card-day-label { color: #1565C0; }
.meteo-card-day-label strong { color: #37474F; }
.meteo-card-day--today .meteo-card-day-label strong { color: #1565C0; }
.meteo-card-day-icon {
  width: 38px;
  height: 38px;
}
.meteo-card-day-icon svg { width: 100%; height: 100%; }
.meteo-card-day-temps {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
}
.meteo-card-arrow { font-size: 10px; }
.meteo-card-arrow--up { color: #EF5350; }
.meteo-card-arrow--dn { color: #42A5F5; }
.meteo-card-tmax { font-weight: 700; color: #BF360C; }
.meteo-card-tmin { color: #1565C0; }
.meteo-card-day-rain {
  font-size: 10px;
  color: #90A4AE;
}

/* Responsive */
@media (max-width: 680px) {
  .meteo-card { flex-direction: column; }
  .meteo-card-current {
    border-right: none;
    border-bottom: 1px solid #E0E0E0;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
  }
  .meteo-card-loc { margin-bottom: 0; }
  .meteo-card-days {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .meteo-card-day:nth-child(n+4) { border-top: 1px solid #F5F5F5; }
}
@media (max-width: 400px) {
  .meteo-card-days { grid-template-columns: repeat(2, 1fr); }
}
