/* Chart Component Styles */

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
}

.chart-container-tall {
    height: 400px;
}

.chart-container-short {
    height: 200px;
}

canvas {
    max-width: 100%;
    height: auto;
}

/* Chart card styling */
.chart-card {
    background: rgba(var(--bs-body-bg-rgb), 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-card .chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: rgba(var(--bs-body-color-rgb), 0.9);
}

.chart-card .chart-subtitle {
    font-size: 0.875rem;
    color: rgba(var(--bs-body-color-rgb), 0.6);
    margin-bottom: 1rem;
}

/* Chart legend enhancements */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.chart-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Chart loading state */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: rgba(var(--bs-body-color-rgb), 0.5);
}

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

/* Chart empty state */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: rgba(var(--bs-body-color-rgb), 0.5);
    text-align: center;
    padding: 2rem;
}

.chart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.chart-empty p {
    margin: 0;
    font-size: 1rem;
}

/* Chart toolbar */
.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-toolbar .btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Chart filters */
.chart-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.chart-filters .form-select {
    width: auto;
    min-width: 150px;
}

/* Responsive chart grid */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .chart-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-toolbar .btn-group {
        width: 100%;
    }
    
    .chart-toolbar .btn {
        flex: 1;
    }
}

/* Chart export button */
.chart-export-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-card:hover .chart-export-btn {
    opacity: 1;
}

/* Comparison chart styles */
.comparison-chart {
    position: relative;
}

.comparison-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(var(--bs-body-color-rgb), 0.05);
    border-radius: 8px;
}

.comparison-legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.comparison-legend-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.comparison-legend-label {
    font-size: 0.875rem;
    color: rgba(var(--bs-body-color-rgb), 0.6);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .chart-card {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] canvas {
    filter: brightness(0.95);
}
