/* ==========================================================================
   DASHBOARD COMPONENTS - ESTILOS ESPECÍFICOS DE COMPONENTES
   Estilos únicos para cada componente de gráfico del dashboard
   ========================================================================== */

/* ==========================================================================
   1. CONTAINERS PRINCIPALES
   ========================================================================== */

/* Container base para todos los charts */
.chart-container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ==========================================================================
   2. ESTADOS DE LOADING Y ERROR
   ========================================================================== */

/* Loading spinner */
.chart-loading {
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

.chart-loading .text-muted {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* No data indicator */
.chart-nodata {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
}

.chart-nodata .bg-white {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
}

.chart-nodata i {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* ==========================================================================
   3. ALERTAS ESPECÍFICAS DE COMPONENTES
   ========================================================================== */

/* Alerta SNP */
.alert-snp {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 0;
    margin: 0;
    padding: 0.75rem 1rem;
}

.alert-snp .bi-exclamation-triangle {
    color: #856404;
    font-size: 1.1rem;
}

.alert-snp .text-warning {
    color: #856404 !important;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Alerta en insights (más pequeña) */
.alert-insights {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.alert-insights .bi-exclamation-triangle {
    color: #856404;
    font-size: 0.8rem;
}

.alert-insights .text-warning {
    color: #856404 !important;
    font-size: 0.7rem;
    line-height: 1.3;
}

/* ==========================================================================
   4. FOOTERS DE COMPONENTES
   ========================================================================== */

/* Footer base */
.chart-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-footer .text-muted {
    font-size: 0.8rem;
}

.chart-footer .text-muted strong {
    font-weight: 600;
}

.chart-footer small {
    font-size: 0.7rem;
    margin-top: 2px;
    display: block;
}

.chart-footer a {
    color: #007bff;
    text-decoration: none;
}

.chart-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   5. ESTILOS ESPECÍFICOS POR COMPONENTE
   ========================================================================== */

/* --- EMISSIONS CHART --- */
.emissions-chart .insights-panel .main-metric-item {
    width: 100%;
    flex: none;
}

.emissions-chart .insights-panel .main-metric-item .bg-white {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid #e9ecef;
}

.emissions-chart .insights-panel .secondary-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Fullscreen specific styles */
.emissions-chart:fullscreen,
.emissions-chart:-webkit-full-screen,
.emissions-chart:-moz-full-screen,
.emissions-chart:-ms-fullscreen {
    background: white !important;
    padding: 20px !important;
}

/* Hide dropdown arrow but maintain functionality */
.emissions-chart .dropdown-toggle::after {
    display: none;
}

/* --- SNP CHART --- */
.snp-chart .alert-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.snp-chart .row.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

.snp-chart .col-6 .bg-light {
    background-color: #f8f9fa !important;
    border-radius: 0.375rem;
    padding: 0.5rem 0.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* --- ARCLIM CHART --- */
.arclim-chart .variable-btn[data-variable="tasmax_mean"] {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.arclim-chart .variable-btn[data-variable="pr_sum"] {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

.arclim-chart .variable-btn[data-variable="snow_sum"] {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.1);
}

.arclim-chart .insights-panel .progress {
    height: 4px;
    border-radius: 2px;
}

.arclim-chart .insights-panel .progress-bar {
    border-radius: 2px;
}

.arclim-chart .insights-panel .display-6 {
    font-size: 2rem;
    font-weight: 700;
}

/* --- HUELLA COMUNAL CHART --- */
.huella-comunal-chart .vista-btn[data-vista="por_region"] {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

.huella-comunal-chart .vista-btn[data-vista="por_sector"] {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.huella-comunal-chart .vista-btn[data-vista="por_comuna"] {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.huella-comunal-chart .display-6 {
    font-size: 2rem;
    color: #28a745 !important;
}


/* ==========================================================================
   6. RESPONSIVE COMPONENTS - MOVIDO A dashboard-responsive.css
   ========================================================================== */

/* Las reglas responsive se han consolidado en dashboard-responsive.css
   para evitar duplicación y mejorar el mantenimiento */