/* ===== VARIABLES ===== */
:root {
  --bg-deep: #0a0c14;
  --bg-soft: #11131f;
  --bg-elevated: rgba(18,22,33,0.95);
  --bg-elevated-soft: rgba(22,26,38,0.85);
  --accent: #2de38b;
  --accent-soft: #3be59a;
  --accent-glow: rgba(45, 227, 139, 0.25);
  --accent-warn: #f59e0b;
  --accent-danger: #ef4444;
  --text-main: #f0f3f8;
  --text-soft: #b0b9ce;
  --text-muted: #7e879f;
  --border-soft: rgba(65, 80, 110, 0.25);
  --border-strong: rgba(100, 120, 160, 0.3);
  --glass: rgba(15, 20, 30, 0.8);
  --glass-strong: rgba(12, 17, 27, 0.95);
  --shadow-main: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  --shadow-soft: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 18px;
  --transition-fast: 0.2s ease;
  --transition-med: 0.3s ease;
  --card-bg: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] {
  --bg-deep: #f5f7fc;
  --bg-soft: #eef2f6;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #f8fafd;
  --accent: #0f8b5c;
  --accent-soft: #1a9e6b;
  --accent-glow: rgba(15, 139, 92, 0.2);
  --text-main: #1e2434;
  --text-soft: #3a4055;
  --text-muted: #6b7287;
  --border-soft: rgba(180, 190, 210, 0.4);
  --border-strong: rgba(120, 140, 170, 0.3);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-strong: #ffffff;
  --shadow-main: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
  --shadow-soft: 0 15px 30px -10px rgba(0, 0, 0, 0.1);
  --card-bg: rgba(0, 0, 0, 0.02);
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--bg-deep);
  overflow-x: hidden;
}
html { overflow-y: auto; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-y: auto;
  position: relative;
  line-height: 1.5;
}

.side-nav { display: none !important; }

/* ===== BACKGROUND ===== */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.3;
  will-change: transform;
}

/* ===== APP SHELL ===== */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.6fr 1.2fr;
  grid-template-rows: 80px auto auto;
  gap: 12px;
  padding: 12px;
  min-height: 100vh;
  max-width: 1800px;
  margin: 0 auto;
  align-content: start;
}

/* ===== TOP BAR ===== */
.top-bar {
  grid-column: 1 / 3;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 0.9fr);
  align-items: center;
  padding: 0 30px;
  gap: 20px;
}

.search-bunker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  padding: 10px 18px;
}
.search-bunker input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  width: 100%;
}
.search-bunker input::placeholder { color: var(--text-muted); }

.top-logo {
  font-family: 'Orbitron';
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  gap: 8px;
}
.top-logo span:first-child { color: var(--text-main); }
.top-logo span:last-child { color: var(--accent); }

.top-right {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-self: end;
}

.theme-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.theme-btn {
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.5;
  line-height: 1;
}
.theme-btn.active {
  opacity: 1;
  background: var(--accent-glow);
  box-shadow: 0 0 12px var(--accent);
}
.theme-btn:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.settings-icon {
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.8;
}
.settings-icon:hover {
  opacity: 1;
  transform: rotate(90deg);
  background: var(--accent-glow);
}

/* ===== MAIN MONITOR ===== */
.main-monitor {
  grid-column: 1;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-main);
  padding: 35px 35px 30px 35px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}
.left-col { display: flex; flex-direction: column; gap: 20px; }
.location-group { margin-bottom: 5px; }

.city {
  font-size: 60px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -0.02em;
}
.condition {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  margin-top: 5px;
}

.info-stack { display: flex; flex-direction: column; gap: 12px; }
.info-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 35px;
  padding: 10px 20px;
  width: 100%;
  max-width: 320px;
  transition: all 0.2s ease;
}
.info-item:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px var(--accent-glow);
  background: rgba(45, 227, 139, 0.05);
}
.info-icon { font-size: 38px; width: 50px; text-align: center; }
.info-content { display: flex; flex-direction: column; }
.info-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.info-value {
  font-family: 'Orbitron';
  font-size: 36px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

/* ===== CÍRCULO CENTRAL ===== */
.circle-container {
  position: relative;
  width: 380px;
  height: 380px;
  margin: 0 auto;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  overflow: visible !important;
}
.dial-svg {
  position: absolute;
  top: 7.5%;
  left: 7.5%;
  width: 85%;
  height: 85%;
  transform: rotate(-90deg);
}
.dial-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.03);
  stroke-width: 8;
}
.dial-value {
  fill: none;
  stroke: url(#tempGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 230;
  filter: drop-shadow(0 0 8px #2de38b) drop-shadow(0 0 15px rgba(45, 227, 139, 0.5));
  transition: stroke-dashoffset 1.5s ease;
}
.circle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: 'Orbitron';
  background: transparent !important;
  backdrop-filter: none !important;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none !important;
  box-shadow: none !important;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
.temp-big {
  font-size: 68px;
  font-weight: 700;
  background: linear-gradient(135deg, #2de38b, #fbbf24, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(45, 227, 139, 0.7);
  line-height: 1;
}
.temp-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  margin-top: 5px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}
.temp-range {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}
.icon-3d {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 90px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
  animation: float 6s ease-in-out infinite;
  opacity: 0.9;
  pointer-events: none;
}
@keyframes float {
  0%,100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-15px) rotate(5deg); }
}
[data-theme="light"] .temp-label,
[data-theme="light"] .temp-range {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
[data-theme="light"] .icon-3d {
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.2));
}

/* ===== BLOQUE PRÓXIMOS 6 DÍAS ===== */
.forecast-block {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 16px 16px 20px 16px;
  margin: 10px 0;
}
.forecast-title {
  font-family: 'Orbitron';
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-soft);
}
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.forecast-day {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 16px 5px;
  text-align: center;
  transition: all 0.2s ease;
}
.forecast-day:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px var(--accent-glow);
  background: rgba(45, 227, 139, 0.05);
}
.day-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.day-icon { font-size: 44px; margin-bottom: 8px; }
.day-temp {
  font-family: 'Orbitron';
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* ===== ANÁLISIS COM ===== */
.analysis {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 40px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(10px);
  width: 100%;
  transition: all 0.2s ease;
}
.analysis:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px var(--accent-glow);
}
.analysis i {
  font-size: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent));
}
.analysis-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-soft);
}
.analysis-text strong {
  color: var(--accent);
  font-weight: 700;
  margin-left: 8px;
}

/* ===== RADAR PANEL ===== */
.radar-panel {
  grid-column: 1;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-main);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: auto;
}
.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.radar-header h3 {
  font-family: 'Orbitron';
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.radar-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: rgba(10, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.radar-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #000;
  width: 100%;
  aspect-ratio: 16/9;
}
#windy-frame {
  width: 100%;
  height: 100%;
  border: 0;
}
.radar-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(45, 227, 139, 0.08) 0px, rgba(45, 227, 139, 0.08) 2px, transparent 2px, transparent 8px);
  mix-blend-mode: overlay;
  animation: radarScan 5s linear infinite;
  pointer-events: none;
}
@keyframes radarScan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ===== DATA PANEL ===== */
.data-panel {
  grid-column: 2;
  grid-row: 2 / 4;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-main);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  height: 100%;
  min-height: 600px;
}
.data-panel-header {
  margin-bottom: 5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.data-panel-header h2 {
  font-family: 'Orbitron';
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2px 0;
}
.data-panel-header span { font-size: 11px; color: var(--text-soft); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: transparent;
  padding: 0;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px var(--accent-glow);
  background: rgba(45, 227, 139, 0.05);
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-card .stat-label i,
.stat-card .stat-label .emoji {
  font-size: 22px;
  width: 26px;
  text-align: center;
}
.stat-card .stat-value {
  font-family: 'Orbitron';
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat-card .stat-unit {
  font-size: 10px;
  color: var(--text-soft);
  margin-left: 4px;
}

.extra-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 10px 0;
  background: transparent;
}
.extra-stat {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
}
.extra-stat:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 15px var(--accent-glow);
}
.extra-stat i {
  font-size: 24px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 6px currentColor);
}
.extra-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.extra-value {
  font-family: 'Orbitron';
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* ===== TEMPERATURA POR HORA (con recuadro interno) ===== */
.hourly-chart {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  padding: 16px;
  margin: 10px 0;
  box-shadow: var(--shadow-soft);
}

.hourly-chart .chart-header {
  margin-bottom: 15px;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-bottom: 1px dashed var(--border-soft);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hourly-chart .chart-header span:last-child {
  font-size: 12px;
  color: var(--text-soft);
}

#hourlyCanvas {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2); /* sutil fondo para destacar */
  border: 1px solid var(--border-soft);
  padding: 5px;
}

/* ===== RECOMENDACIONES ===== */
.recommendations-block {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 16px 14px;
  margin-top: 8px;
}
.recommendations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-soft);
}
.recommendations-header span:first-child {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.recommendations-header span:last-child {
  font-size: 14px;
  color: var(--text-soft);
}
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.recommendation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  transition: all var(--transition-fast);
}
.recommendation-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(45, 227, 139, 0.05);
}
.recommendation-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}
.recommendation-text {
  font-size: 11px;
}
.recommendation-text strong {
  display: block;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 12px;
}
.recommendation-text span {
  color: var(--text-soft);
  font-size: 10px;
}

/* ===== REGISTROS HISTÓRICOS (FIX) ===== */
.history-section {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 16px;
  margin-top: 10px;
}

.history-title {
  font-family: 'Orbitron';
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-soft);
}

.history-block {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.history-item {
  background: var(--card-bg);  /* Fondo sutil */
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: rgba(45, 227, 139, 0.05);
  border-color: var(--accent);
}

.history-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-value {
  font-size: 18px;
  font-family: 'Orbitron';
  font-weight: 600;
  color: var(--accent);
}

.history-sub {
  font-size: 8px;
  color: var(--text-soft);
  margin-top: 2px;
}

/* ===== BOTTOM BAR ===== */
.bottom-bar {
  grid-column: 1 / 3;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 11px;
  margin-top: 8px;
}
.bottom-left { display: flex; align-items: center; gap: 16px; }
.bottom-links { display: flex; gap: 20px; }
.bottom-links a {
  color: var(--text-soft);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.bottom-links a:hover { color: var(--accent); }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: 90%;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-main);
  padding: 16px 20px;
  z-index: 50;
}
.cookie-banner p { margin: 0 0 12px 0; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.cookie-actions { display: flex; justify-content: flex-end; gap: 12px; }
.btn {
  border-radius: 30px;
  border: 1px solid var(--border-soft);
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-primary { border-color: var(--accent); background: var(--accent); color: #020617; }

/* ===== SETTINGS ===== */
.settings-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 280px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-main);
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 18px;
  z-index: 30;
}
.settings-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}
.settings-header h4 {
  font-family: 'Orbitron';
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-soft);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.settings-close {
  font-size: 18px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.settings-close:hover { background: rgba(255, 255, 255, 0.1); }
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.settings-row label {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.settings-row label i { color: var(--accent); width: 18px; }
.theme-toggle-mini {
  display: flex;
  gap: 10px;
}
.theme-toggle-mini .theme-option {
  font-size: 20px;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.2s;
}
.theme-toggle-mini .theme-option.active { opacity: 1; text-shadow: 0 0 8px var(--accent); }
.unit-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 30px;
  padding: 6px 12px;
  color: var(--text-main);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
}

/* ===== MODALES ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: none;
}

.modal {
  background: rgba(12, 17, 27, 0.98);
  border-radius: 28px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-main);
  max-width: 400px; /* Reducido aún más */
  width: 90%;
  max-height: 90vh;
  height: auto;
  display: flex;
  flex-direction: column;
  backdrop-filter: none;
  overflow: hidden;
}

.modal-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 10px 20px; /* Padding reducido */
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: rgba(12, 17, 27, 0.98);
  z-index: 1;
}

.modal-header h3 {
  font-family: 'Orbitron';
  font-size: 15px; /* Ligeramente más pequeño */
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.modal-close {
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 12px; /* Un poco más pequeño */
  padding: 0 20px 16px 20px; /* Paddings laterales reducidos */
  overflow-y: auto;
  flex: 1;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 160, 160, 0.2) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(160, 160, 160, 0.2);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 120, 0.4);
}

.modal-body strong {
  color: var(--accent);
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
}

.modal-body p {
  margin-bottom: 8px;
}

@media (min-width: 1300px) {
  .modal {
    max-width: 700px !important;
  }
}

/* ===== UTILS ===== */
.badge-ip {
  padding: 4px 10px;
  border-radius: 30px;
  border: 1px solid var(--border-soft);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.02);
}

/* ===== ANIMACIONES GLOBALES ===== */
* { transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
body { animation: fadeIn 1s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.main-monitor, .radar-panel, .data-panel {
  animation: slideUp 0.8s ease-out;
  opacity: 0;
  animation-fill-mode: forwards;
}
.main-monitor { animation-delay: 0.2s; }
.radar-panel { animation-delay: 0.4s; }
.data-panel { animation-delay: 0.6s; }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dial-value { animation: dialAnimate 1.5s ease-out forwards; }
@keyframes dialAnimate { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: var(--dial-offset); } }
@keyframes pulseGlow { from { text-shadow: 0 0 10px #2de38b; } to { text-shadow: 0 0 30px #2de38b, 0 0 50px #fbbf24; } }

/* ===== BARRA DE SCROLL PERSONALIZADA ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(160, 160, 160, 0.2);
  border-radius: 4px;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 120, 120, 0.4); }
* { scrollbar-width: thin; scrollbar-color: rgba(160, 160, 160, 0.2) transparent; }

/* ===== RESPONSIVE ===== */
@media (min-width: 1200px) {
  .main-monitor { grid-template-columns: 1fr 1fr; padding: 16px; }
  .data-panel { padding: 16px; }
}
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 80px minmax(0, 1fr); grid-template-rows: 80px auto auto auto; gap: 10px; padding: 10px; }
  .data-panel { grid-column: 1; grid-row: 4; padding: 14px; }
  .forecast-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  html, body { overflow-x: hidden; overflow-y: auto !important; height: auto !important; min-height: 100vh; width: 100%; position: relative; }
  .app-shell { display: block !important; width: 100%; padding: 8px; gap: 8px; height: auto; min-height: auto; }
  .top-bar, .main-monitor, .radar-panel, .data-panel, .bottom-bar { width: 100%; margin: 0 0 8px 0; display: block; }
  .city { font-size: clamp(32px, 8vw, 48px) !important; }
  .condition { font-size: clamp(14px, 4vw, 20px) !important; }
  .info-value { font-size: clamp(24px, 7vw, 32px) !important; }
  .row { display: flex !important; flex-direction: column !important; gap: 15px !important; }
  .right-col { order: 1 !important; width: 100% !important; }
  .left-col { order: 2 !important; width: 100% !important; }
  .circle-container { width: min(220px, 60vw) !important; height: min(220px, 60vw) !important; margin: 10px auto !important; overflow: visible !important; }
  .circle-center { width: min(140px, 45vw) !important; height: min(140px, 45vw) !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; }
  .temp-big { font-size: clamp(30px, 8vw, 40px) !important; }
  .icon-3d { right: 0 !important; bottom: -5px !important; font-size: clamp(50px, 15vw, 70px) !important; transform: scale(0.8) !important; max-width: 50% !important; }
  .info-stack { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .info-item { max-width: 100% !important; padding: 6px 8px !important; gap: 8px !important; }
  .info-icon { font-size: 24px !important; width: 32px !important; }
  .info-value { font-size: 20px !important; }
  .info-label { font-size: 9px !important; }
  .location-group { text-align: center !important; }
  .city { font-size: clamp(36px, 8vw, 48px) !important; }
  .condition { font-size: clamp(16px, 4vw, 20px) !important; }
  .analysis { padding: 12px 16px !important; }
  .analysis-text { font-size: 14px !important; }
  #hourlyCanvas { max-width: 100%; height: auto; }
  .bottom-bar { flex-wrap: wrap; justify-content: center; padding: 10px; margin-bottom: 0; }
  .bottom-links { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .bottom-links a { font-size: 9px; white-space: nowrap; }
  .data-panel { min-height: auto !important; height: auto !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; scrollbar-width: thin !important; scrollbar-color: var(--accent) transparent !important; }
  .data-panel::-webkit-scrollbar { width: 6px; }
  .data-panel::-webkit-scrollbar-track { background: transparent; }
  .data-panel::-webkit-scrollbar-thumb { background-color: var(--accent); border-radius: 3px; }
  .history-block { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; padding: 8px !important; }
  .history-item { padding: 6px !important; }
  .history-value { font-size: 16px !important; }
  .history-label { font-size: 9px !important; }
  .history-sub { font-size: 8px !important; }
  .main-monitor, .radar-panel, .data-panel { overflow-x: hidden !important; }
}

/* Ajuste para modales en pantallas muy pequeñas */
@media (max-width: 600px) {
  .modal {
    width: 92% !important;
    padding: 16px !important;
  }
}

/* ===== ELIMINAR CUALQUIER DESBORDAMIENTO HORIZONTAL ===== */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

.app-shell {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
}

.main-monitor,
.radar-panel,
.data-panel,
.forecast-block,
.hourly-chart,
.recommendations-block,
.history-section,
.stats-grid,
.extra-stats {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Asegurar que ningún hijo tenga un ancho excesivo */
* {
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* Si hay algún elemento con posición absoluta que se sale, lo limitamos */
.circle-container, .icon-3d {
  max-width: 100% !important;
}

/* ===== OCULTAR LA BARRA DE SCROLL DE LA PÁGINA (SOLO VISUAL) ===== */
html {
  overflow-y: scroll; /* Asegura que el scroll funcione */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

html::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* ===== ELIMINAR DESBORDAMIENTO HORIZONTAL ===== */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
}

.app-shell {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
}

/* Asegurar que todos los contenedores internos respeten el ancho */
.main-monitor, .radar-panel, .data-panel,
.stats-grid, .extra-stats, .hourly-chart,
.recommendations-block, .history-section, .forecast-block {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ===== ELIMINAR TODAS LAS BARRAS DE SCROLL ===== */
html, body {
  overflow: hidden !important; /* Elimina scrollbars, pero también el scroll */
  height: 100% !important;
}

.app-shell {
  height: 100% !important;
  overflow-y: auto !important; /* Scroll interno en el contenedor principal */
  overflow-x: hidden !important;
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}

.app-shell::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ===== OCULTAR BARRA DE SCROLL DEL PANEL DE DATOS ===== */
.data-panel {
  overflow-y: auto !important;   /* Mantiene el scroll funcional */
  -ms-overflow-style: none !important;  /* IE/Edge */
  scrollbar-width: none !important;      /* Firefox */
}

.data-panel::-webkit-scrollbar {
  display: none !important;      /* Chrome/Safari/Opera */
}

.data-panel {
  min-height: auto !important;
  height: auto !important;
  overflow-y: visible !important; /* Elimina el scroll interno */
}

/* ===== AJUSTES FINALES PARA MÓVIL ===== */

/* Scroll suave en dispositivos táctiles */
.app-shell {
  -webkit-overflow-scrolling: touch !important;
}

/* Espacio para la barra de navegación inferior de Android */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }
  
  @media (max-width: 800px) {
    .bottom-bar {
      padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    }
  }
}