/* === CLIMA === */
.weather-row {
  display: flex;
  gap: 2rem;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-wrap: wrap;
}
.weather-main {
  min-width: 200px;
  text-align: center;
  flex: 1;
}
.weather-current {
  font-size: 1.2rem;
  margin-top: 0.5rem;
}
.weather-emoji {
  font-size: 2.5rem;
  display: block;
}
.weather-temp {
  font-size: 2.2rem;
  font-weight: bold;
  margin-top: 0.2rem;
}
.weather-desc {
  font-size: 1rem;
  color: #666;
}
.weather-charts {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.weather-charts canvas {
  max-width: 100%;
}
.no-data {
  color: #999;
  font-style: italic;
  margin-top: 1rem;
}
.spinner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  color: #555;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}







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

.weather-graphs {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.weather-hourly-graph,
.weather-daily-graph {
  flex: 1 1 48%;
  min-width: 300px;
}
@media (max-width: 600px) {
  .weather-graphs {
    flex-direction: column;
  }
}




/* === DISEÑO GENERAL PORTAL === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}
.container {
  max-width: 97%;
  margin: 0 auto;
  padding: 0 20px;
}
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
  font-size: 2.5em;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.subtitle {
  font-size: 1.2em;
  opacity: 0.9;
}
.search-container {
  background: white;
  padding: 2rem 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.search-form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  gap: 10px;
}
.search-input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}
.search-input:focus {
  border-color: #667eea;
}
.search-btn {
  padding: 12px 30px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}
.search-btn:hover {
  background: #5a67d8;
}
.main-content {
  max-width: 97%;
  margin: 0 auto;
  padding: 2rem 0;
}
.section {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
}
.section-header {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  padding: 1rem 1.5rem;
  font-size: 1.4em;
  font-weight: bold;
}
.section-content {
  padding: 1.5rem;
}
.full-width {
  grid-column: 1 / -1;
}
.search-results {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .search-form {
    flex-direction: column;
  }
  h1 {
    font-size: 2em;
  }
}

/* INCIDENTES + MAPA: alineados y ocupando todo el ancho */
.incidencias-mapa-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
  /* No justify-content: center para que ocupen todo el ancho */
}

.incidencias-section, .mapa-section {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

/* Responsive: solo en móvil pequeño se apilan */
@media (max-width: 900px) {
  .incidencias-mapa-container {
    flex-direction: column;
    gap: 1rem;
  }
}

/* === ESTILO PARA LISTA DE INCIDENCIAS === */
.incidencias-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-right: 8px;
}

.incidencia-celda {
  background: #fbe4e4;
  border: 1.5px solid #9c5656;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

/* OCULTAR CARRUSEL SI YA NO LO USAS */
.carousel-container, .carousel-track, .carousel-item {
  display: none !important;
}



.weather-isla-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: nowrap;
}

/* Bloque de temperatura e icono */
.weather-main-info {
  flex: 0 0 150px;
  text-align: center;
}

/* Gráfico horario */
.weather-hourly-graph {
  flex: 1 1 auto;
  min-width: 250px;
}

/* Gráfico diario o tabla */
.weather-daily-graph {
  flex: 1 1 auto;
  min-width: 250px;
}

.weather-daily-graph .tabla-pronostico {
  width: 100%;
  border-collapse: collapse;
}

.weather-daily-graph .tabla-pronostico td,
.weather-daily-graph .tabla-pronostico th {
  text-align: center;
  padding: 4px;
}

/* Vista móvil */

@media (max-width: 768px) {
  .weather-isla-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  .weather-isla-header > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .weather-hourly-graph {
    width: 100%;
    overflow-x: auto;
  }

  .weather-hourly-graph canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
  }

  .weather-daily-graph {
    width: 100%;
    overflow-x: auto;
  }

  .weather-daily-graph canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
  }

  body {
    overflow-x: hidden;
  }
}





