/* Styles pour les graphiques */
.charts-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--background-dark);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.charts-panel.visible {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.charts-title {
    font-size: 1.2em;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.charts-title-icon {
    font-size: 1.4em;
}

.charts-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.charts-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.charts-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.charts-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.chart-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chart-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    display: none;
    height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.chart-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.chart-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.chart-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chart-card-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-canvas-container {
    height: calc(100% - 30px);
    position: relative;
}

.chart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chart-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .charts-panel {
        width: 95%;
    }
    
    .chart-row {
        flex-direction: column;
    }
    
    .chart-card {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .charts-panel {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .charts-header {
        border-radius: 0;
    }
    
    .charts-tabs {
        overflow-x: auto;
        padding-bottom: 15px;
    }
    
    .chart-tab {
        white-space: nowrap;
    }
}

.chart-preview {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 10px;
    margin: 10px 0;
}

#resourceChartPreview {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
}

.stats-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.stats-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.stat-card-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-card-trend {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.stat-card-trend.positive {
    color: #4CAF50;
}

.stat-card-trend.negative {
    color: #F44336;
}

.stat-card-info {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.detailed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-name {
    color: var(--text-secondary);
}

.stat-data {
    color: var(--text-primary);
    font-weight: bold;
}

/* Styles spécifiques aux graphiques */
canvas {
    width: 100% !important;
    height: 100% !important;
}
