/* Chart Components Styles */

.chart-controls {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.chart-controls .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
}

.chart-controls .form-select,
.chart-controls .form-control {
    font-size: 0.875rem;
}

.chart-loading {
    background-color: var(--color-card-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    z-index: 10;
}

.chart-error {
    margin-top: 1rem;
}

/* Responsive chart controls */
@media (max-width: 768px) {
    .chart-controls .row {
        flex-direction: column;
    }

    .chart-controls .col-md-2 {
        margin-bottom: 0.5rem;
    }

    .chart-controls .col-md-2:last-child {
        margin-bottom: 0;
    }
}

/* Chart canvas styling */
.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Ensure chart containers don't overflow but allow for axis labels */
.card-body .chart-container {
    overflow: visible;
    padding: 10px;
}

/* Fix for Chart.js responsive behavior */
.chartjs-render-monitor {
    animation: chartjs-render-animation 0.001s;
}

@keyframes chartjs-render-animation {
    from {
        opacity: 0.99;
    }

    to {
        opacity: 1;
    }
}

/* Custom select styling for multiple selection */
.chart-controls select[multiple] {
    min-height: 2.5rem;
}

/* Loading spinner animation */
.chart-loading .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Chart title styling */
.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* Tooltip improvements */
.chart-tooltip {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

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

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

.chart-legend-color {
    width: 12px;
    height: 12px;
    margin-right: 0.5rem;
    border-radius: 2px;
}