/* ════════════════════════════════════════════════════════════════
   DIQUES DE CÓRDOBA — live_widgets.css
   Estilos para widgets de nivel + clima en tiempo real
   ═══════════════════════════════════════════════════════════════ */

/* ── WIDGET CONTENEDOR ─────────────────────────────────────────── */
.widget-live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0 40px;
}
@media (max-width: 800px) { .widget-live { grid-template-columns: 1fr; } }

.widget-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.widget-icon { font-size: 1.3rem; }
.widget-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; color: var(--navy); font-weight: 500;
  margin: 0; flex: 1;
}

/* fuente badges */
.fuente-badge {
  font-size: .68rem; padding: 3px 9px; border-radius: 20px;
  font-weight: 500; letter-spacing: .04em;
}
.fuente-live    { background: rgba(39,174,96,.12); color: #27ae60; border: 1px solid rgba(39,174,96,.3); }
.fuente-oficial { background: rgba(46,134,193,.1);  color: var(--mid); border: 1px solid rgba(46,134,193,.25); }

/* ── NIVEL DEL EMBALSE ─────────────────────────────────────────── */
.nivel-valor {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 14px;
}
.nivel-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.2rem; font-weight: 600; line-height: 1;
}
.nivel-unidad { font-size: 1.2rem; color: var(--muted); }

.nivel-barra-wrap { margin-bottom: 12px; }
.nivel-barra-bg {
  height: 14px; background: #e8eef4; border-radius: 8px; overflow: hidden;
  position: relative;
}
.nivel-barra-fill {
  height: 100%; border-radius: 8px;
  transition: width .8s ease;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px;
}
.nivel-barra-label { font-size: .7rem; color: white; font-weight: 600; }
.nivel-cota { font-size: .75rem; color: var(--muted); margin-top: 4px; display: block; }
.nivel-detalle { font-size: .82rem; color: var(--muted); margin-top: 6px; }

/* alertas nivel */
.nivel-alerta {
  padding: 9px 14px; border-radius: 4px; font-size: .83rem;
  margin: 10px 0; display: flex; align-items: center; gap: 8px;
}
.alerta-vertiendo { background: rgba(39,174,96,.1); color: #27ae60; border-left: 3px solid #27ae60; }
.alerta-bajo      { background: rgba(192,57,43,.08); color: #c0392b; border-left: 3px solid #c0392b; }
.alerta-lluvia    { background: rgba(46,134,193,.08); color: var(--blue); border-left: 3px solid var(--mid); }

.widget-update { font-size: .72rem; color: var(--muted); margin-top: 14px; }
.api-link { color: var(--mid); text-decoration: none; }
.api-link:hover { text-decoration: underline; }

/* ── CLIMA WIDGET ──────────────────────────────────────────────── */
.clima-actual { margin-bottom: 16px; }
.clima-main {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.clima-icon { font-size: 3rem; }
.clima-temp {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem; font-weight: 600; color: var(--navy);
  display: block; line-height: 1;
}
.clima-desc { font-size: .9rem; color: var(--muted); display: block; margin-top: 4px; }

.clima-detalles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.clima-det-item {
  display: flex; align-items: center; gap: 6px;
  font-size: .83rem; color: var(--muted);
}
.clima-det-item strong { color: var(--navy); }

/* ── PRONÓSTICO ────────────────────────────────────────────────── */
.forecast-strip {
  display: flex; gap: 4px; margin-top: 16px; overflow-x: auto; padding-bottom: 4px;
}
.fc-item {
  flex: 1; min-width: 60px;
  background: #f4f8fc; border-radius: 6px;
  padding: 10px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.fc-dia  { font-size: .72rem; font-weight: 600; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; }
.fc-icon { font-size: 1.4rem; }
.fc-max  { font-size: .88rem; font-weight: 600; color: var(--navy); }
.fc-min  { font-size: .78rem; color: var(--muted); }
.fc-rain { font-size: .68rem; color: var(--mid); }
.fc-prob { font-size: .65rem; color: var(--muted); }

.sol-strip {
  display: flex; gap: 20px; margin-top: 12px;
  font-size: .8rem; color: var(--muted);
}

/* ── PANEL NIVELES HOMEPAGE ────────────────────────────────────── */
.fuente-row {
  display: flex; align-items: center; gap: 16px;
  margin: 20px 0 32px; flex-wrap: wrap;
}
.fuente-badge-big {
  padding: 6px 16px; border-radius: 20px;
  font-size: .8rem; font-weight: 600; letter-spacing: .05em;
}
.fuente-badge-big.live    { background: rgba(39,174,96,.15); color: #27ae60; border: 1px solid rgba(39,174,96,.4); }
.fuente-badge-big.oficial { background: rgba(46,134,193,.1);  color: var(--sky); border: 1px solid rgba(46,134,193,.3); }
.fuente-ts { font-size: .78rem; color: rgba(255,255,255,.4); }

.niveles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.nivel-row-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; padding: 16px 18px;
  transition: background .2s;
}
.nivel-row-card:hover { background: rgba(255,255,255,.09); }
.nivel-row-nombre {
  font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.9);
  margin-bottom: 10px;
}
.nivel-row-datos {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.nivel-row-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 600; min-width: 70px;
}
.mini-barra-bg {
  flex: 1; height: 8px; background: rgba(255,255,255,.1);
  border-radius: 4px; overflow: hidden; min-width: 60px;
}
.mini-barra-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
.mini-pct { font-size: .78rem; font-weight: 600; min-width: 42px; text-align: right; }
.mini-badge {
  font-size: .65rem; padding: 2px 6px;
  background: rgba(39,174,96,.2); color: #68d391;
  border-radius: 20px; border: 1px solid rgba(39,174,96,.3);
}
.nivel-row-fecha { font-size: .68rem; color: rgba(255,255,255,.25); display: block; margin-top: 6px; }

/* ── DIQUE PAGE: sección live integrada ────────────────────────── */
.dique-live-section {
  background: #f4f8fc; border-top: 1px solid var(--border);
  padding: 40px 0;
}
.dique-live-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; color: var(--navy);
  margin-bottom: 20px; font-weight: 400;
}
.widget-error { color: var(--muted); font-size: .9rem; text-align: center; padding: 30px; }
