/* Charts Panel Styles */

#charts-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dashboard-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.dashboard-panel .panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.dashboard-panel .panel-icon {
    font-size: 20px;
    line-height: 1;
}

.dashboard-panel .panel-content {
    padding: 20px;
    position: relative;
    min-height: 400px;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.metric-selector {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.metric-selector:hover {
    border-color: #9ca3af;
}

.metric-selector:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Chart Toggle Buttons */
.chart-toggle-buttons {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 2px;
    border-radius: 6px;
}

.chart-toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-toggle-btn:hover {
    color: #374151;
    background: #e5e7eb;
}

.chart-toggle-btn.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chart-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* Chart Containers */
.chart-container {
    display: none;
}

.chart-container.active {
    display: block;
}

.highcharts-container {
    width: 100% !important;
    height: 400px !important;
}

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

.chart-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.chart-loading p {
    margin-top: 16px;
    font-size: 14px;
}

/* Empty State */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #9ca3af;
}

.chart-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.chart-empty p {
    font-size: 14px;
}

/* Spinner Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .chart-controls {
        width: 100%;
        justify-content: space-between;
    }

    .chart-toggle-buttons {
        width: 100%;
    }

    .chart-toggle-btn {
        flex: 1;
        justify-content: center;
    }

    .metric-selector {
        width: 100%;
    }

    .highcharts-container {
        height: 350px !important;
    }
}

@media (max-width: 480px) {
    .dashboard-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .highcharts-container {
        height: 300px !important;
    }
}
