/**
 * Stili per Dashboard Statistiche
 * 
 * @package GestioneEsami
 * @since 1.2.0
 */

/* Container principale statistiche */
#gestione-esami-statistics-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* KPI Cards Container */
.statistics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Singola KPI Card */
.statistics-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #3b82f6;
}

.statistics-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.statistics-kpi-card.kpi-success {
    border-left-color: #22c55e;
}

.statistics-kpi-card.kpi-warning {
    border-left-color: #f59e0b;
}

.statistics-kpi-card.kpi-info {
    border-left-color: #8b5cf6;
}

.statistics-kpi-card.kpi-primary {
    border-left-color: #3b82f6;
}

/* KPI Header */
.statistics-kpi-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.statistics-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.kpi-primary .statistics-kpi-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.kpi-success .statistics-kpi-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.kpi-warning .statistics-kpi-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.kpi-info .statistics-kpi-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.statistics-kpi-title {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* KPI Value */
.statistics-kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.statistics-kpi-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Charts Grid */
.statistics-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Singola Chart Card */
.statistics-chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.statistics-chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Chart a tutta larghezza */
.statistics-chart-full {
    grid-column: 1 / -1;
}

.statistics-chart-full .statistics-chart-container {
    height: 400px;
}

/* Loading State */
.statistics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #6b7280;
}

.statistics-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Empty State */
.statistics-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.statistics-empty-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.statistics-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.statistics-empty-text {
    font-size: 14px;
    color: #9ca3af;
}

/* Section Headers */
.statistics-section-header {
    margin: 40px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.statistics-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.statistics-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .statistics-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #gestione-esami-statistics-dashboard {
        padding: 16px;
    }
    
    .statistics-kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .statistics-charts-grid {
        gap: 16px;
    }
    
    .statistics-chart-card {
        padding: 16px;
    }
    
    .statistics-chart-container {
        height: 300px;
    }
    
    .statistics-kpi-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .statistics-kpi-card {
        padding: 16px;
    }
    
    .statistics-kpi-value {
        font-size: 24px;
    }
    
    .statistics-chart-container {
        height: 250px;
    }
}

/* Print Styles */
@media print {
    .statistics-kpi-card,
    .statistics-chart-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .statistics-kpi-grid,
    .statistics-charts-grid {
        gap: 16px;
    }
}
