.airquality-page {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    min-height: 100vh;
    padding: 40px 0;
}

@media (max-width: 768px) {
    .airquality-page {
        padding: 10px 0 30px 0;
    }
}

.airquality-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.airquality-header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 10px 40px rgba(67, 160, 71, 0.3);
}

@media (max-width: 768px) {
    .airquality-header {
        border-radius: 16px;
        padding: 20px;
        margin: 0 10px 20px 10px;
    }
}

.airquality-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .airquality-title {
        font-size: 1.6rem;
    }
}

.airquality-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .airquality-description {
        display: none;
    }
}

/* Mapa */
.map-section {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .map-section {
        border-radius: 16px;
        padding: 16px;
        margin: 0 10px 20px 10px;
    }
}

.map-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 16px;
}

#map {
    height: 600px;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    background: #f5f5f5;
}

@media (min-width: 1400px) {
    #map { height: 700px; }
}

@media (max-width: 768px) {
    #map { height: 400px; border-radius: 10px; }
}

/* Leyenda */
.map-legend {
    background: white;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
    max-width: 160px;
}

.legend-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 20px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Popup */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
}

.leaflet-popup-content {
    margin: 12px;
}

.aqi-popup h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #2c3e50;
}

.aqi-popup .aqi-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 8px 0;
}

.aqi-popup .aqi-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.aqi-popup p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: #666;
}

/* Info sections */
.info-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .info-section {
        border-radius: 16px;
        padding: 20px;
        margin: 0 10px 20px 10px;
    }
}

.info-section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
}

.info-section p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 16px;
}

.info-section ul {
    color: #555;
    line-height: 1.8;
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
}

/* AQI Table */
.aqi-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.aqi-table th,
.aqi-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.aqi-table th {
    background: #f8f9fa;
    font-weight: 700;
    color: #2c3e50;
}

.aqi-table td:first-child {
    white-space: nowrap;
}

.aqi-color-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aqi-color-box {
    width: 30px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.aqi-range {
    font-weight: 600;
    color: #333;
}

/* Pollutants grid */
.pollutants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.pollutant-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #43a047;
}

.pollutant-card h4 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.pollutant-card p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* Error */
.error-msg {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Layer Control */
.layer-control {
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    min-width: 180px;
}

.layer-control-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 0.9rem;
}

.layer-control select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    cursor: pointer;
}

.layer-control select:focus {
    outline: none;
    border-color: #43a047;
}

.layer-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.layer-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
