/**
 * Professional Analytics & Data Visualization
 * Government-grade statistics and reporting dashboard
 * Based on federal data visualization standards
 */

/* Analytics Dashboard Container */
.analytics-dashboard {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.analytics-dashboard .section-header {
    border-bottom: 2px solid var(--gov-blue-60);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.analytics-dashboard .section-header h2 {
    color: var(--gov-blue-60);
    font-weight: 700;
}

/* Professional Statistics Grid */
.professional-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.professional-stat-card {
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.professional-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.professional-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0.5rem 0.5rem 0 0;
}

.professional-stat-card.stat-total::before {
    background: var(--gov-blue-60);
}

.professional-stat-card.stat-recovered::before {
    background: var(--gov-green-60);
}

.professional-stat-card.stat-pending::before {
    background: var(--gov-orange-60);
}

.professional-stat-card.stat-rate::before {
    background: var(--trust-600);
}

.stat-icon-professional {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-total .stat-icon-professional {
    background: var(--gov-blue-60);
}

.stat-recovered .stat-icon-professional {
    background: var(--gov-green-60);
}

.stat-pending .stat-icon-professional {
    background: var(--gov-orange-60);
}

.stat-rate .stat-icon-professional {
    background: var(--trust-600);
}

.stat-number-professional {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label-professional {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.stat-trend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-trend.positive {
    color: var(--gov-green-60);
}

.stat-trend.negative {
    color: var(--gov-red-60);
}

.stat-trend.neutral {
    color: var(--gov-gray-50);
}

/* Recovery Rate Visualization */
.recovery-rate-chart {
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recovery-rate-chart h3 {
    color: var(--gov-blue-60);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rate-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.rate-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--gov-green-60) 0deg,
        var(--gov-green-60) var(--recovery-angle, 0deg),
        var(--gov-gray-10) var(--recovery-angle, 0deg),
        var(--gov-gray-10) 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rate-circle::before {
    content: "";
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.rate-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gov-green-60);
    z-index: 1;
}

/* Time-based Analytics */
.time-analytics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.time-period-card {
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 0.25rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.time-period-card h4 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-period-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gov-blue-60);
    margin-bottom: 0.25rem;
}

.time-period-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Professional Data Table */
.professional-data-table {
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.professional-data-table table {
    width: 100%;
    border-collapse: collapse;
}

.professional-data-table th {
    background: var(--gov-blue-60);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.professional-data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.professional-data-table tr:last-child td {
    border-bottom: none;
}

.professional-data-table tr:nth-child(even) {
    background: var(--bg-secondary);
}

.professional-data-table tr:hover {
    background: rgba(0, 94, 162, 0.05);
}

/* Performance Metrics */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.performance-card {
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.performance-card h4 {
    color: var(--gov-blue-60);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.performance-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.performance-metric:last-child {
    margin-bottom: 0;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.positive {
    color: var(--gov-green-60);
}

.metric-value.negative {
    color: var(--gov-red-60);
}

/* Export and Report Actions */
.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-primary);
}

.export-btn {
    background: white;
    border: 2px solid var(--gov-blue-60);
    color: var(--gov-blue-60);
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.export-btn:hover {
    background: var(--gov-blue-60);
    color: white;
}

.export-btn i {
    font-size: 1rem;
}

/* Mobile Responsive Analytics */
@media (max-width: 768px) {
    .professional-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .professional-stat-card {
        padding: 1.5rem;
    }
    
    .stat-number-professional {
        font-size: 2rem;
    }
    
    .time-analytics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .time-period-card {
        padding: 1rem;
    }
    
    .time-period-number {
        font-size: 1.5rem;
    }
    
    .performance-metrics {
        grid-template-columns: 1fr;
    }
    
    .rate-circle {
        width: 100px;
        height: 100px;
    }
    
    .rate-circle::before {
        width: 70px;
        height: 70px;
    }
    
    .rate-percentage {
        font-size: 1.25rem;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .export-btn {
        justify-content: center;
        width: 100%;
    }
    
    .professional-data-table {
        overflow-x: auto;
    }
    
    .professional-data-table th,
    .professional-data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Dark Mode Analytics */
[data-theme="dark"] .analytics-dashboard,
[data-theme="dark"] .professional-stat-card,
[data-theme="dark"] .recovery-rate-chart,
[data-theme="dark"] .time-period-card,
[data-theme="dark"] .professional-data-table,
[data-theme="dark"] .performance-card {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

[data-theme="dark"] .professional-data-table th {
    background: var(--gov-blue-20);
    color: var(--bg-primary);
}

[data-theme="dark"] .professional-data-table tr:nth-child(even) {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .professional-data-table tr:hover {
    background: rgba(115, 179, 231, 0.1);
}

[data-theme="dark"] .export-btn {
    background: var(--bg-secondary);
    border-color: var(--gov-blue-20);
    color: var(--gov-blue-20);
}

[data-theme="dark"] .export-btn:hover {
    background: var(--gov-blue-20);
    color: var(--bg-primary);
}

[data-theme="dark"] .rate-circle::before {
    background: var(--bg-secondary);
}

/* High Contrast Analytics */
@media (prefers-contrast: high) {
    .professional-stat-card,
    .recovery-rate-chart,
    .time-period-card,
    .professional-data-table,
    .performance-card {
        border-width: 2px;
    }
    
    .professional-stat-card::before {
        height: 6px;
    }
    
    .export-btn {
        border-width: 3px;
        font-weight: 700;
    }
}