/* =========================================
   METEOCLIMB v1.4 REV2 - VARIABLES GLOBALES
========================================= */
:root {
  --primary: #3182ce;
  --bg-body: #f0f4f8;
  --text-main: #2d3748;
  --border: #e2e8f0;
}

body {
  margin: 0;
  padding: 15px;
  background-color: var(--bg-body);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text-main);
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* --- CABECERA LOGO --- */
.logo-cabecera {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 380px;
  height: auto;
  padding: 10px 0;
}

/* =========================================
   PANEL SUPERIOR: DÍAS Y ACORDEÓN
========================================= */
.panel-superior {
  background: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Fila de días siempre visible */
.contenedor-dias-fullwidth {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none; /* Oculta scroll en Firefox */
}
.contenedor-dias-fullwidth::-webkit-scrollbar { 
  display: none; /* Oculta scroll en Chrome/Safari */
}

/* Botón para abrir/cerrar filtros */
.btn-acordeon {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
  color: #4a5568;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s;
}

.btn-acordeon:active {
  background: #e2e8f0;
}

/* =========================================
   CONTENEDOR DE FILTROS (PÍLDORAS EN 2 FILAS)
========================================= */
.contenedor-filtros {
  background: #edf2f7;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contenedor-filtros.oculto { 
  display: none; 
}

/* Filas horizontales deslizables para las píldoras */
.fila-pildoras {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.fila-pildoras::-webkit-scrollbar { display: none; }

/* Estructura base de una píldora */
.pildora-filtro, .pildora-gps {
  background: white;
  border: 1px solid #cbd5e0;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Píldora destacada para el GPS */
.pildora-gps {
  background: #319795;
  color: white;
  border: none;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 14px;
}

.pildora-gps:active {
  transform: translateY(1px);
}

/* Textos y selectores dentro de las píldoras */
.label-pildora {
  font-size: 0.8rem;
  color: #718096;
  font-weight: bold;
}

.select-invisible {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2d3748;
  cursor: pointer;
  outline: none;
  appearance: none; /* Quita la flecha por defecto del SO */
}

.flecha-select { 
  font-size: 0.6rem; 
  color: #718096; 
}

/* =========================================
   BOTONES DE TRAMOS Y ESTILOS (Dentro de píldoras)
========================================= */
.grupo-botones { 
  display: flex; 
  gap: 4px; 
}

.btn-selector {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #718096;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-selector.activo {
  background: var(--primary);
  color: white;
}

/* =========================================
   TARJETAS DE LOS DÍAS
========================================= */
.tarjeta-dia {
  flex: 1;
  min-width: 70px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: 0.2s;
}

.tarjeta-dia.activo { 
  border-color: var(--primary); 
  background: #ebf8ff; 
}

.dia-nombre { font-weight: bold; font-size: 0.85rem; color: #2d3748; }
.dia-icono { font-size: 1.4rem; margin: 2px 0; }
.dia-temp { font-size: 0.75rem; color: #4a5568; font-weight: 600; }

/* =========================================
   ZONA INFERIOR: MAPA Y RESULTADOS
========================================= */
.contenedor-principal {
  display: flex;
  gap: 15px;
  height: calc(100vh - 280px);
  min-height: 450px;
}

#mapa {
  flex: 2;
  border-radius: 12px;
  z-index: 1;
  border: 1px solid var(--border);
}

.resultados-container {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  overflow-y: auto;
}

.titulo-lista {
  margin-top: 0;
  font-size: 1.1rem;
  color: #2d3748;
  border-bottom: 2px solid var(--bg-body);
  padding-bottom: 10px;
}

.aviso-inicial { 
  color: #a0aec0; 
  text-align: center; 
  margin-top: 40px; 
  font-style: italic; 
}

/* =========================================
   ADAPTACIÓN A PANTALLAS MÓVILES
========================================= */
@media (max-width: 768px) {
  .panel-superior {
    padding: 10px;
    gap: 10px;
  }
  
  header {
    margin-bottom: 5px !important;
  }

  .logo-cabecera {
    max-width: 220px;
  }

  /* El mapa se pone arriba y la lista abajo */
  .contenedor-principal {
    flex-direction: column;
    height: auto;
    min-height: auto;
    gap: 10px;
  }

  /* Altura fija para el mapa en móvil */
  #mapa {
    height: 260px !important;
    width: 100%;
    flex: none;
    border-radius: 10px;
  }

  .resultados-container {
    height: auto;
    max-height: 500px;
  }

  .tarjeta-dia {
    min-width: 60px;
    padding: 6px 2px;
  }
}