/**
 * Monitor del Aire - Innovax
 * Estilos CSS
 * Version: 1.2.2
 */

/* ========================================
   ESTILOS PRINCIPALES DEL CONTENEDOR
   ======================================== */
.container {
  max-width: 100% !important;
  padding: 0 !important;
}

.menu .container {
  max-width: 1200px !important;
}

.monitor-aire-container {
  max-width: 1200px;
  padding-top: 50px;
  margin: 20px auto;
  font-family: Arial, sans-serif;
}

footer.contenedor-footer {
  max-width: 1200px;
  margin: 0 auto;
}

.tab-btn:hover {
  background-color: #ff5000;
  color: #fff;
}

/* ========================================
   ESTILOS DE LAS TABS
   ======================================== */
.monitor-aire-tabs {
  display: flex;
  flex-direction: row;
  border-radius: 5px;
  overflow: hidden;
  min-height: 500px;
  padding-top: 20px;
}

.parent {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 1fr;
grid-column-gap: 0px;
grid-row-gap: 0px;
}
.tab-buttons {
  display: flex;
  flex-direction: column;
  width: 280px;
}

.tab-btn {
  padding: 10px 12px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  text-align: left;
  border: 2px solid #ff5000;
  margin-bottom: 10px;
  transition: background-color 0.3s;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
}

p.estacion-titulo {
  font-size: 25px;
  font-weight: bold;
}

.tab-btn.active {
  background-color: #ff5000;
  color: white;
  font-weight: bold;
}

.tab-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-pane h1,
.tab-pane h2,
.tab-pane h3,
.tab-pane h4,
.tab-pane h5,
.tab-pane h6 {
  margin-top: 0;
  color: #000;
  font-size: 24px;
  font-weight: bold;
}

.tab-pane p {
  line-height: 1.6;
  color: #666;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.download-btn {
  background-color: #ff5000;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background-color: #e64500;
}

.download-btn svg {
  width: 16px;
  height: 16px;
}

.date-selector {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  margin-right: 10px;
  min-width: 150px;
  transition: border-color 0.3s ease;
}

.date-selector:hover {
  border-color: #ff5000;
}

.date-selector:focus {
  outline: none;
  border-color: #ff5000;
  box-shadow: 0 0 0 2px rgba(255, 80, 0, 0.1);
}

/* ========================================
   ESTILOS RESPONSIVE (MÓVIL)
   ======================================== */
@media (max-width: 768px) {
  .monitor-aire-tabs {
    flex-direction: column;
    min-height: auto;
  }

  .tab-buttons {
    flex-direction: column;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    border-right: none;
    white-space: nowrap;
    padding: 0px 30px;
  }
  .parent {
    display: grid
;
    grid-template-columns: repeat(1, 1fr);
   
}
.child .mt-5 {

    padding: 10px;
}
.date-range-selector {
    display: flex
;
    justify-content: space-between;
    align-items: center;
}
.export-controls {

    width: 100% !important;
 
}
.carga_data_actual {
    margin-top: 30px;
    margin-bottom: 20px;
}
footer.contenedor-footer {
    padding: 20px;
}
    .tab-btn.active {
        border-right: none;
        border-bottom: 3px solid #ff5000 !important;
    }

  .tab-btn {
    min-width: 180px;
    white-space: nowrap;
    text-overflow: clip;
    font-size: 11px;
    padding: 8px 10px;
  }

  .tab-btn.active {
    border-right: none;
    border-bottom: 3px solid #0073aa;
  }

  .tab-content {
    padding: 15px;
  }

  .tab-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding-top: 20px;
  }

  .tab-header h4 {
    font-size: 18px;
    margin: 0;
  }

  .download-btn {
    padding: 10px 14px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }

  .date-selector {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
    font-size: 13px;
    padding: 10px 12px;
  }

  .contenido-dos-columnas {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
  }

  .estacion-datos {
    padding: 12px;
  }

  .estacion-datos strong {
    min-width: 140px;
    font-size: 13px;
  }

  .estacion-datos p {
    font-size: 13px;
  }

  .columna-imagen {
    max-width: 100%;
    margin: 0 auto;
  }
}

/* ========================================
   ESTILOS DE INFORMACIÓN DE LA ESTACIÓN
   ======================================== */
.contenido-dos-columnas {
  display: flex;
  gap: 30px;
  background: #fff;
  margin-bottom: 0;
  align-items: start;
}

.columna-izquierda,
.columna-derecha {
  flex: 1;
}

/* Hacer que el contenedor del gráfico ocupe una columna flexible */
.contenido-dos-columnas > .wind-rose-container {
  flex: 1;
}
table.tabla-actual td {
    font-size: 14px;
}
.carga_data_actual div {
    color: #ff5000;
    font-weight: bold !important;
    font-size: 20px;
    margin-right: 60px;
    margin-top: -2px;
}
.estacion-datos {
    padding: 15px 0px;
}
.child .mt-5 {
    font-size: 20px;
    color: #ff5000;
    font-weight: bold;
        margin-top: 0px !important;
}

.contenido-dos-columnas h3 {
  margin: 0 0 15px 0;
  color: #ff5000;
  font-size: 16px;
  font-weight: bold;
  padding-bottom: 8px;
}

.contenido-dos-columnas p {
  margin: 0 0 10px 0;
  color: #555;
  line-height: 1.5;
}

.estacion-datos p {
  margin-bottom: 8px;
  font-size: 14px;
}

.estacion-datos p:last-child {
  margin-bottom: 0;
}

.estacion-datos strong {
  color: #000;
  font-weight: 600;
  display: inline-block;
  min-width: 160px;
}

.columna-imagen {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: block;
}

/* ========================================
   ESTILOS DE GRÁFICOS AMCHARTS
   ======================================== */
.amchart-container {
  width: 100%;
  height: 500px;
  margin: 20px 0;
  background-color: #f9f9f9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* ========================================
   ESTILOS DE ROSA DE LOS VIENTOS
   ======================================== */
.wind-rose-container {
  width: 100%;
  height: 550px;
  margin-top: -25%;
}

.export-controls {
     position: relative;
    right: 2px;
    top: -55px;
    width: 200px;
    left: 75%;
}

/* ========================================
   ESTILOS DE SECCIÓN HERO
   ======================================== */
.monitor-aire-hero-section {
  background: url(https://www.sgscm.cl/wp-content/uploads/2025/05/Monitoreo_CA.jpg)
    center/cover no-repeat;
  min-height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10%;
  width: 100%;
}

.monitor-aire-hero-section h1 {
  color: white;
  margin: 0;
  font-size: 2.5em;
}

@media only screen and (max-width: 600px) {
  .export-controls {
    position: static;
  }
  .monitor-aire-container{
    margin-top: 0 !important;
  }
}

/* ========================================
   PRELOAD: Cargando datos en tabla actual
   ======================================== */
.carga_data_actual .current-data-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  padding: 8px 0;
}

.carga_data_actual .current-data-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #ff5000;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: monitorAireSpin 0.8s linear infinite;
}

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

/* Biblioteca documental modal */
.doc-library-controls { margin: 24px 0; text-align: center; }
.doc-library-btn {background-color: #ff5000;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 400px;
    text-transform: uppercase;
    padding: 10px;
    font-weight: bold; }
.doc-library-btn:hover { background-color: #e64500; }
.doc-modal { position: fixed; inset: 0; z-index: 10000; display: none; }
.doc-modal.is-open { display: block; }
.doc-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); }
.doc-modal-dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1000px, 90vw); height: min(80vh, 700px); background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column; overflow: hidden; }
.doc-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eee; font-weight: 600; }
.doc-modal-close { background: transparent; border: none; font-size: 24px; line-height: 1; cursor: pointer; }
.doc-modal-body { flex: 1; }
.doc-modal-body iframe { width: 100%; height: 100%; }
