/* Import specific chart styles */
@import 'charts/price-history.css';
@import 'charts/mileage-history.css';

/* Common Chart Styles */
.charts-section {
    margin-top: 2rem;
}

.chart-container {
    height: 500px;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.chart-container:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.chart-wrapper {
    position: relative;
    height: calc(100% - 60px); /* Account for header */
    width: 100%;
}

.chart-container h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
    z-index: 2;
    background: white;
}

/* Loading State */
.chart-container.loading {
    position: relative;
}

.chart-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    z-index: 10;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    position: relative;
    z-index: 2;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Tooltip Styles */
.chart-tooltip {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
}



/* Responsive Design */
@media (max-width: 768px) {
    .chart-container {
        padding: 1rem;
    }

    .chart-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}