:root{
    --azul-uca:#0b3c6d;
    --celeste-uca:#7bb7df;
    --gris:#f4f6f8;
}

*{box-sizing:border-box; margin:0; padding:0; font-family: Arial, Helvetica, sans-serif;}
body{
    background:#fff; 
    color:#222;
    font-family: 'Open Sans', Arial, sans-serif;}


header{
    background:var(--azul-uca);
    color:white;
    padding:12px 24px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

header img{height:42px;}

nav ul{display:flex; gap:20px; list-style:none; font-weight:600;}

.hero{
    background:var(--celeste-uca);
    padding:40px 20px;
    text-align:center;
    color:white;
}

.hero h1{font-size:38px;}

h3{color:var(--azul-uca); margin-bottom:12px;margin-top: 12px;}


.container{
    width:80%; 
    margin:50px auto; 
    padding:0 20px;}

.intro{
    display:grid;
    grid-template-columns:1.2fr 1fr;
    gap:30px;
    align-items:center;
}

.intro img{width:100%; border-radius:14px;}

.intro p{font-size:17px; line-height:1.6;}

.explicacion{margin-top:60px;}

.explicacion h2{color:var(--azul-uca); margin-bottom:20px;}

.vars{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
    gap:20px;
}

.var{
    background:var(--gris);
    padding:18px;
    border-radius:14px;
}

.var h4{color:var(--azul-uca); margin-bottom:6px; }

.menu{
    margin-top:60px;
    background:var(--gris);
    padding:25px;
    border-radius:16px;
    margin-bottom:60px; 
    
}

.menu h2{margin-bottom:15px; color:var(--azul-uca)}

select{
    padding:10px 14px;
    border-radius:8px;
    border:1px solid #ccc;
    font-size:15px;
}

canvas{margin-top:25px;}

.intro-text h2{
    color: var(--azul-uca);
    margin-bottom: 14px;
}

.intro-text p{
    margin-bottom: 12px;
    line-height: 1.6;
}



footer{
    margin-top:70px;
    background:var(--azul-uca);
    color:white;
    text-align:center;
    padding:20px;
}

@media(max-width:900px){
    .intro{grid-template-columns:1fr;}
}

.cards{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap:15px;
    margin: 30px 0;
}

.card{
    background:white;
    padding:15px;
    border-radius:12px;
    text-align:center;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
    transition:0.3s;
}

.card:hover{
    transform: translateY(-5px);
    box-shadow:0 6px 18px rgba(0,0,0,0.15);
}

.card h4{
    margin:5px 0;
}

.card p{
    font-size:1.4em;
    font-weight:bold;
    color:#1d3557;
}

.botonera{
    text-align:center;
    margin: 25px 0;
}

.btn{
    padding:16px 30px;
    margin:0 10px;
    border:none;
    border-radius:28px;
    font-size:1.1em;
    font-weight:600;
    cursor:pointer;
    transition:0.3s;
}

.btn-g1{
    background:#f3de2c;
    color:white;
}

.btn-g2{
    background:#7cb518;
    color:white;
}

.btn-g3{
    background:#5c8001;
    color:white;
}

.btn:hover{
    transform:scale(1.07);
    filter:brightness(1.1);
}

.panel{
    margin-top:25px;
    animation: fadeIn 0.4s ease;
    
}

.oculto{
    display:none;
}



.explorador-panel {
    background:var(--gris);
    padding: 25px;
    border-radius: 16px;
    margin-top: 25px;
}

.controles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: end;
    margin-bottom: 25px;
}

.control-item label {
    display: block;
    font-weight: 600;
    color: var(--azul-uca);
    margin-bottom: 4px;
    font-size: 14px;
}

.control-item select,
.control-item input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}


.control-item {
    display: flex;
    flex-direction: column;
    justify-content:centered ; /* 👈 clave */
    height: 140px; /* 👈 todos misma altura */
}

.control-item:last-child {
    padding-top: 22px;
}
.control-item button {
    background: var(--azul-uca);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.control-item button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.grafico-panel {
    width: 100%;
    min-height: 0;     
}




.estado-aqi {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.aqi-valor {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.barra-aqi {
    display: flex;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.nivel {
    flex: 1;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.bueno { background: #00e400; }
.moderado { background: #ffff00; color: black; }
.sensible { background: #ff7e00; }
.danino { background: #ff0000; }
.muy-danino { background: #8f3f97; }
.peligroso { background: #7e0023; }

.mensaje-aqi {
    font-size: 14px;
    font-weight: 500;
}



/* ========================= */
/* GRUPO 3 DASHBOARD STYLE */
/* ========================= */

.g3-filtros{
    display:flex;
    flex-wrap:wrap;
    gap:20px;
    align-items:end;
    margin-bottom:30px;
}

.filtro{
    display:flex;
    flex-direction:column;
}

.filtro label{
    font-size:13px;
    font-weight:600;
    color:var(--azul-uca);
    margin-bottom:4px;
}

.g3-btn-primary{
    background:var(--azul-uca);
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
    font-weight:600;
    transition:0.3s;
}

.g3-btn-primary:hover{
    transform:translateY(-2px);
    box-shadow:0 4px 10px rgba(0,0,0,0.15);
}

.g3-btn-secundario{
    background:#2c6e49;
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:10px;
    cursor:pointer;
    font-weight:600;
    transition:0.3s;
}

.g3-btn-secundario:hover{
    transform:translateY(-2px);
    box-shadow:0 4px 10px rgba(0,0,0,0.15);
}

/* Tarjetas estadísticas */

.g3-stats-cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:20px;
    margin-bottom:40px;
}

.g3-stat-card{
    background:white;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 12px rgba(0,0,0,0.07);
    text-align:center;
}

.g3-stat-card h4{
    font-size:14px;
    color:#666;
    margin-bottom:8px;
}

.g3-stat-card p{
    font-size:22px;
    font-weight:bold;
    color:var(--azul-uca);
}

/* Tabla */

.g3-tabla-container{
    background:white;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 12px rgba(0,0,0,0.05);
    overflow:auto;
}

.g3-tabla-container table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}

.g3-tabla-container th{
    background:var(--azul-uca);
    color:white;
    padding:8px;
}

.g3-tabla-container td{
    padding:8px;
    border-bottom:1px solid #eee;
}

.g3-tabla-container tr:hover{
    background:#f4f6f8;
}

/* Notebook cards */

.g3-notebooks{
    margin-top:40px;
}

.notebook-cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:20px;
    margin-top:15px;
}

.notebook-card{
    background:white;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 12px rgba(0,0,0,0.07);
}

.notebook-card h4{
    margin-bottom:10px;
    color:var(--azul-uca);
}

.notebook-card p{
    font-size:14px;
    margin-bottom:12px;
}

.notebook-card a{
    text-decoration:none;
    font-weight:600;
    color:white;
    background:var(--celeste-uca);
    padding:8px 14px;
    border-radius:8px;
    display:inline-block;
    transition:0.3s;
}

.notebook-card a:hover{
    background:var(--azul-uca);
}

/* Contenedor principal */
.aqi-contenedor {
    display: flex;
    flex-direction: column; /* barra arriba, leyenda abajo */
    gap: 15px;
}

/* Barra AQI */
.barra-aqi {
    display: flex;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

/* Leyenda debajo en vertical */
.aqi-leyenda {
    display: flex;
    flex-direction: column; /* una abajo de la otra */
    gap: 8px; /* espacio entre líneas */
    font-size: 14px;
    margin-bottom: 20px;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 0px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Cada item */
.aqi-leyenda .item {
    display: flex;
    align-items: center;
}

.info-rango-datos {
    background: #eef4fb;
    border-left: 5px solid #174a7c;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #2c3e50;
}

@keyframes fadeIn{
    from{opacity:0; transform:translateY(10px)}
    to{opacity:1; transform:translateY(0)}
}


@media(max-width:900px){
    .grid-relaciones{
        grid-template-columns:1fr;
    }
}