/* ==============================================
   DASHBOARD.CSS - ULTRA OPTIMIZED VERSION
   Violet Theme • Maximum Performance • Smooth Scrolling
   Animations lourdes supprimées • Sidebar & Modals préservés
   ============================================== */

/* ============================================
   🌟 VARIABLES PERSONNALISÉES 3D - VIOLET THEME
   ============================================ */
:root {
    --ml-primary: #667eea;
    --ml-secondary: #764ba2;
    --ml-accent: #8b5cf6;
    --ml-light: #a78bfa;
    --ml-success: #10b981;
    --ml-danger: #ef4444;
    --ml-warning: #f59e0b;
    
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: rgba(102, 126, 234, 0.37);
    
    --glow-primary: 0 0 20px rgba(102, 126, 234, 0.5);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.5);
    
    --transition-smooth: all 0.25s ease;
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body.dark-mode {
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(148, 163, 184, 0.1);
    --glass-shadow: rgba(102, 126, 234, 0.5);
}

/* ============================================
   ✅ OPTIMISATIONS PERFORMANCES GLOBALES
   ============================================ */

/* GPU Acceleration pour éléments critiques uniquement */
.stat-card,
.chart-wrapper,
.simulation-item {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Optimiser les rendus */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ✨ TITRES GLOBAUX - TOUS EN GRAS ET VIOLET
   ============================================ */
h1, h2, h3, h4, h5, h6,
.page-title,
.section-title,
.card-title,
.chart-title,
.subsection-title {
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   🎬 ANIMATIONS OPTIMISÉES (Légères uniquement)
   ============================================ */

/* ✅ Animation légère - Hover uniquement */
@keyframes floatIcon {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-5px); 
    }
}

/* ❌ SUPPRIMÉ : gradientShift (trop lourd) */
/* ❌ SUPPRIMÉ : rotate3d (trop lourd) */
/* ❌ SUPPRIMÉ : moveStripes (trop lourd) */

/* ✅ Animation légère - Spinner uniquement */
@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ✅ Animation légère - Entrée uniquement (une fois) */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   📊 STATS GRID - SIMPLIFIÉ
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    /* ✅ Background statique (pas d'animation) */
    background: rgba(102, 126, 234, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

body.dark-mode .stats-grid {
    background: rgba(15, 23, 42, 0.5);
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--ml-primary);
    position: relative;
    animation: fadeInUp 0.4s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

body.dark-mode .stat-card {
    background: rgba(30, 41, 59, 0.9);
}

/* ❌ SUPPRIMÉ : ::before animation */

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 16px 40px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-left-color: var(--ml-secondary);
}

.stat-card h3 {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 800 !important;
    letter-spacing: 1.2px;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .value {
    font-size: 2.2em;
    font-weight: 800 !important;
    /* ✅ Gradient statique (pas d'animation) */
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    line-height: 1.2;
}

.stat-card.positive .value {
    background: linear-gradient(135deg, var(--ml-success), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.negative .value {
    background: linear-gradient(135deg, var(--ml-danger), #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   🛠️ TOOLBAR - SIMPLIFIÉ
   ============================================ */
.toolbar {
    /* ✅ Background statique */
    background: rgba(102, 126, 234, 0.08);
    backdrop-filter: blur(15px);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 2px solid var(--glass-border);
    box-shadow: 
        0 8px 32px var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

/* ❌ SUPPRIMÉ : ::before rotation 3D */

body.dark-mode .toolbar {
    background: rgba(15, 23, 42, 0.6);
}

.toolbar h3 {
    color: var(--text-primary);
    margin-bottom: 18px;
    font-size: 1.2rem;
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ❌ SUPPRIMÉ : Icon float animation */

.toolbar-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    animation: slideInFromLeft 0.4s ease-out backwards;
}

.toolbar-row:nth-child(2) { animation-delay: 0.05s; }
.toolbar-row:nth-child(3) { animation-delay: 0.1s; }

.toolbar-row:last-child {
    margin-bottom: 0;
}

.toolbar label {
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.95em;
    min-width: 80px;
}

.toolbar input,
.toolbar select {
    padding: 12px 18px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    color: var(--text-primary);
    transition: var(--transition-smooth);
    font-weight: 600;
}

.toolbar input:focus,
.toolbar select:focus {
    outline: none;
    border-color: var(--ml-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        var(--glow-primary);
    transform: translateY(-2px);
}

/* ============================================
   🚀 BOUTONS - OPTIMISÉS
   ============================================ */
.btn-add,
.btn-success,
.btn-primary,
.btn-secondary {
    padding: 12px 28px;
    border: none;
    border-radius: 14px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

/* ❌ SUPPRIMÉ : ::before shimmer effect */

/* Btn Primary - VIOLET (statique) */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        0 0 20px rgba(118, 75, 162, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #8b5cf6 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 36px rgba(102, 126, 234, 0.5),
        0 0 40px rgba(118, 75, 162, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Btn Secondary */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 
        0 6px 20px rgba(107, 114, 128, 0.2),
        0 0 15px rgba(75, 85, 99, 0.15);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(107, 114, 128, 0.3),
        0 0 30px rgba(75, 85, 99, 0.2);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
}

/* Btn Success */
.btn-success {
    background: linear-gradient(135deg, var(--ml-success), #059669);
    color: white;
    box-shadow: 
        0 8px 24px rgba(16, 185, 129, 0.3),
        0 0 20px rgba(5, 150, 105, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 36px rgba(16, 185, 129, 0.4),
        var(--glow-success);
}

/* Btn Add - VIOLET */
.btn-add {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white;
    margin: 5px;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.3),
        0 0 15px rgba(118, 75, 162, 0.2);
}

.btn-add:hover {
    background: linear-gradient(135deg, var(--ml-secondary), var(--ml-accent));
    transform: translateY(-2px) scale(1.03);
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.4),
        0 0 30px rgba(118, 75, 162, 0.3);
}

/* Dark Mode Buttons */
body.dark-mode .btn-primary,
body.dark-mode .btn-add {
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.5),
        0 0 25px rgba(118, 75, 162, 0.4);
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-add:hover {
    box-shadow: 
        0 12px 36px rgba(102, 126, 234, 0.6),
        0 0 40px rgba(118, 75, 162, 0.5);
}

body.dark-mode .btn-secondary {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    box-shadow: 0 6px 20px rgba(55, 65, 81, 0.3);
}

body.dark-mode .btn-secondary:hover {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    box-shadow: 0 10px 30px rgba(55, 65, 81, 0.5);
}

/* Total Months & Displays */
.total-months {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 20px;
    animation: fadeInUp 0.4s ease-out 0.15s backwards;
}

.total-months span {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2em;
    font-weight: 800;
}

.parameters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.yield-display {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800 !important;
    margin-left: 10px;
}

.inflation-status {
    background: linear-gradient(135deg, var(--ml-accent), var(--ml-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800 !important;
    margin-left: 15px;
}

/* ============================================
   📋 TABLE - ULTRA OPTIMISÉE
   ============================================ */
.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 
        0 12px 40px var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    backdrop-filter: blur(5px);
    animation: fadeInUp 0.4s ease-out 0.2s backwards;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.data-table thead {
    /* ✅ Background statique (pas d'animation) */
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    color: white !important;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

body.dark-mode .data-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.data-table th {
    padding: 14px 10px;
    text-align: left;
    font-weight: 800 !important;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white !important;
}

.data-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    box-shadow: 2px 0 8px rgba(102, 126, 234, 0.3);
    color: white !important;
}

body.dark-mode .data-table th:first-child {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.06);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

body.dark-mode .data-table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.3);
}

.data-table tbody tr:nth-child(even):hover {
    background: rgba(102, 126, 234, 0.08);
}

.data-table td {
    padding: 8px 6px;
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

.data-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--background-primary);
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 1;
    font-size: 0.85em;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.data-table tbody tr:nth-child(even) td:first-child {
    background: rgba(248, 250, 252, 0.5);
}

body.dark-mode .data-table tbody tr:nth-child(even) td:first-child {
    background: rgba(30, 41, 59, 0.3);
}

.data-table tbody tr:hover td:first-child {
    background: rgba(102, 126, 234, 0.05);
}

.data-table input {
    width: 80px;
    padding: 6px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 0.85em;
    text-align: right;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(3px);
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.data-table input:focus {
    outline: none;
    border-color: var(--ml-primary);
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 2px 8px rgba(102, 126, 234, 0.3);
    transform: scale(1.03);
}

.data-table .calculated {
    background: rgba(102, 126, 234, 0.06);
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    padding: 8px 10px;
    font-size: 0.85em;
    border-left: 2px solid rgba(102, 126, 234, 0.4);
}

body.dark-mode .data-table .calculated {
    background: rgba(102, 126, 234, 0.12);
}

.data-table .btn-delete {
    background: linear-gradient(135deg, var(--ml-danger), #dc2626);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 700;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.data-table .btn-delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

/* ============================================
   📈 CHARTS - OPTIMISÉS
   ============================================ */
.charts-container {
    padding: 30px;
    /* ✅ Background statique */
    background: rgba(102, 126, 234, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

body.dark-mode .charts-container {
    background: rgba(15, 23, 42, 0.4);
}

.chart-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    border-radius: 20px;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 24px;
    border: 2px solid var(--glass-border);
    transition: var(--transition-smooth);
    animation: fadeInUp 0.4s ease-out backwards;
    position: relative;
}

.chart-wrapper:nth-child(1) { animation-delay: 0.05s; }
.chart-wrapper:nth-child(2) { animation-delay: 0.1s; }

/* ❌ SUPPRIMÉ : ::before rotation 3D */

body.dark-mode .chart-wrapper {
    background: rgba(30, 41, 59, 0.9);
}

.chart-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 36px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.chart-wrapper h3,
.chart-wrapper h4,
.chart-wrapper h5 {
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800 !important;
    margin-bottom: 15px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
}

/* ============================================
   🎯 LOCAL FILTER - OPTIMISÉ
   ============================================ */
.local-filter {
    margin: 18px 0;
    padding: 18px;
    /* ✅ Background statique */
    background: rgba(102, 126, 234, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    border: 2px solid var(--glass-border);
    border-left: 4px solid var(--ml-primary);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

body.dark-mode .local-filter {
    background: rgba(102, 126, 234, 0.12);
}

.local-filter label {
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.95em;
}

.local-filter select {
    padding: 10px 18px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 0.95em;
    min-width: 200px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.local-filter select:focus {
    outline: none;
    border-color: var(--ml-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        var(--glow-primary);
    transform: translateY(-2px);
}

/* ============================================
   🎪 SIMULATION MANAGEMENT - Titre Violet
   ============================================ */
.simulation-management {
    /* ✅ Fond clair/blanc (pas violet) */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 28px;
    border-radius: 20px;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid var(--glass-border);
    position: relative;
    margin-bottom: 30px;
}

body.dark-mode .simulation-management {
    background: rgba(30, 41, 59, 0.9);
}

/* ✅ UNIQUEMENT le titre en VIOLET */
.simulation-management h3,
.simulation-management .section-title {
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* Current simulation display */
.current-simulation-display {
    background: rgba(102, 126, 234, 0.08);
    backdrop-filter: blur(5px);
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    position: relative;
    margin-bottom: 24px;
}

.current-simulation-display .label {
    font-size: 0.95em;
    margin-right: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.current-simulation-display .value {
    font-size: 1.3em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ml-primary), var(--ml-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Conteneur des boutons */
.simulation-management .button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   ⚠️ MODAL - 100% PRESERVED
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: white !important;
    font-weight: 800 !important;
    background: none !important;
    -webkit-text-fill-color: white !important;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Dark Mode Support */
body.dark-mode .modal-content {
    background: var(--background-primary);
    color: var(--text-primary);
}

body.dark-mode .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-mode .modal-footer {
    background: var(--background-secondary);
}

/* ============================================
   📋 SIMULATIONS LIST - OPTIMISÉE
   ============================================ */

#simulationsListContainer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-simulations {
    text-align: center;
    color: #999;
    padding: 50px;
    font-style: italic;
    font-size: 1.1em;
    animation: fadeInUp 0.4s ease-out;
}

.simulation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    /* ✅ Background statique */
    background: rgba(245, 247, 250, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    transition: var(--transition-smooth);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    position: relative;
    animation: slideInFromLeft 0.4s ease-out backwards;
}

.simulation-item:nth-child(1) { animation-delay: 0.05s; }
.simulation-item:nth-child(2) { animation-delay: 0.1s; }
.simulation-item:nth-child(3) { animation-delay: 0.15s; }
.simulation-item:nth-child(4) { animation-delay: 0.2s; }
.simulation-item:nth-child(5) { animation-delay: 0.25s; }

body.dark-mode .simulation-item {
    background: rgba(30, 41, 59, 0.8);
}

/* ❌ SUPPRIMÉ : ::before shimmer effect */

.simulation-item:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 36px rgba(102, 126, 234, 0.25),
        0 0 40px rgba(118, 75, 162, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
}

.simulation-item.active {
    /* ✅ Gradient statique */
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 2px solid #ffd700;
    box-shadow: 
        0 12px 40px rgba(16, 185, 129, 0.5),
        0 0 60px rgba(16, 185, 129, 0.3);
}

.simulation-info {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.simulation-name {
    font-weight: 800;
    font-size: 1.15em;
    display: block;
    margin-bottom: 6px;
}

.simulation-date {
    font-size: 0.9em;
    opacity: 0.75;
    font-weight: 600;
}

.simulation-item.active .simulation-date {
    color: rgba(255, 255, 255, 0.95);
    opacity: 1;
}

.simulation-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 2px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
}

.btn-icon:hover {
    background: white;
    transform: scale(1.12) rotate(5deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-icon.btn-danger {
    color: #e74c3c;
}

.btn-icon.btn-danger:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.simulation-item.active .btn-icon {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.simulation-item.active .btn-icon:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Loading Animation */
.simulation-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.simulation-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Hover Effect for non-active */
.simulation-item:not(.active):hover {
    background: rgba(224, 231, 255, 0.9);
    border-color: #667eea;
}

body.dark-mode .simulation-item:not(.active):hover {
    background: rgba(51, 65, 85, 0.9);
}

/* ============================================
   🌙 DARK MODE - HIGHCHARTS OVERRIDE
   ============================================ */
body.dark-mode .highcharts-background {
    fill: var(--background-primary);
}

body.dark-mode .highcharts-title,
body.dark-mode .highcharts-subtitle,
body.dark-mode .highcharts-axis-labels text {
    fill: var(--text-primary) !important;
}

body.dark-mode .highcharts-grid-line {
    stroke: var(--border-color);
}

body.dark-mode .highcharts-legend-item text {
    fill: var(--text-primary) !important;
}

/* ============================================
   📱 RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .parameters-grid {
        grid-template-columns: 1fr;
    }
    
    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        padding: 20px;
        gap: 15px;
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        padding: 20px;
    }
    
    .chart-wrapper {
        padding: 16px;
    }
}

/* ============================================
   ⚡ PERFORMANCE OPTIMIZATIONS FINALES
   ============================================ */

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .stat-card:hover,
    .chart-wrapper:hover,
    .simulation-item:hover {
        transform: none;
    }
}

/* ✅ Force simplification of rendering on low-end devices */
@media (max-width: 1024px) {
    .toolbar,
    .stats-grid,
    .charts-container,
    .local-filter {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.95);
    }
    
    body.dark-mode .toolbar,
    body.dark-mode .stats-grid,
    body.dark-mode .charts-container,
    body.dark-mode .local-filter {
        background: rgba(15, 23, 42, 0.95);
    }
}

/* ============================================
   🎯 FIN DU FICHIER - ULTRA OPTIMIZED VERSION
   Violet Theme • Maximum Performance
   Animations continues supprimées • Scroll fluide
   Sidebar & Modals 100% Preserved
   ============================================ */