/* ═══════════════════════════════════════════════════════════════
   V5 MODE ENFANT - STYLES PRODUCTION V2
   ═══════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 16px; color: #333; background: #f5f7fa; line-height: 1.5; }

/* AUTH */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-box { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center; max-width: 420px; width: 90%; }
.auth-box h1 { font-size: 28px; margin-bottom: 8px; color: #667eea; }
.tagline { color: #666; margin-bottom: 25px; font-size: 16px; }

.auth-tabs { display: flex; gap: 5px; margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 10px; background: #f5f5f5; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.auth-tab.active { background: #667eea; color: white; }
.auth-tab:hover:not(.active) { background: #e0e0e0; }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input { padding: 14px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 15px; }
.auth-form input:focus { outline: none; border-color: #667eea; }
.hint { margin-top: 20px; font-size: 13px; color: #999; }

/* APP */
.main-app { display: flex; flex-direction: column; min-height: 100vh; }
.app-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 25px; }
.header-top h1 { font-size: 22px; margin: 0; }

/* v8.45: Logo SOJO Academy */
.logo-title { display: flex; align-items: center; gap: 15px; }
.logo { height: 45px; width: auto; object-fit: contain; }
.logo-light { display: block; }
.logo-dark { display: none; }
.app-title { display: flex; flex-direction: column; }
.app-title h1 { font-size: 24px; font-weight: 700; margin: 0; line-height: 1.1; }
.app-subtitle { font-size: 11px; opacity: 0.85; font-weight: 500; letter-spacing: 0.5px; }

/* Logo sur page connexion */
.auth-logo { text-align: center; margin-bottom: 15px; }
.auth-logo .logo { height: 60px; }
.user-info { display: flex; align-items: center; gap: 12px; }
.role-badge { font-size: 12px; padding: 3px 8px; background: rgba(255,255,255,0.2); border-radius: 12px; }
.role-badge.admin { background: #ffd700; color: #333; }

.main-nav { display: flex; gap: 3px; padding: 0 25px; background: rgba(0,0,0,0.1); overflow-x: auto; }
.nav-btn { padding: 12px 16px; background: transparent; border: none; color: white; font-size: 14px; font-weight: 500; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; white-space: nowrap; }
.nav-btn:hover { background: rgba(255,255,255,0.1); }
.nav-btn.active { border-bottom-color: white; background: rgba(255,255,255,0.15); }

/* CONTENT */
.app-content { flex: 1; padding: 20px; }
.view { display: none; opacity: 0; }
.view.active { display: block; opacity: 1; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 10px; }

/* HELP PANEL - v8.43: Compact et collapsible */
.help-panel { background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); padding: 8px 15px; border-radius: 8px; margin-bottom: 10px; border-left: 4px solid #4caf50; }
.help-panel.compact .help-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.help-panel.compact .help-header span { color: #2e7d32; font-size: 13px; }
.help-panel.compact .help-toggle { background: none; border: none; cursor: pointer; font-size: 12px; color: #4caf50; padding: 2px 8px; }
.help-panel.compact .help-content { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(76, 175, 80, 0.3); }
.help-panel.compact .help-content ol { margin-left: 20px; color: #388e3c; font-size: 13px; }
.help-panel.compact .help-content li { margin-bottom: 4px; }
.help-panel h4 { color: #2e7d32; margin-bottom: 8px; font-size: 15px; }
.help-panel ol { margin-left: 20px; color: #388e3c; font-size: 14px; }
.help-panel li { margin-bottom: 4px; }

/* TOOLBAR */
.toolbar { display: flex; gap: 8px; margin-bottom: 15px; padding: 12px; background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); flex-wrap: wrap; }
.input-text { flex: 1; min-width: 150px; padding: 10px 14px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; }
.btn-execute { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); } }

/* LAYOUT 3 COLS - v8.43: Optimisé hauteur écran */
.layout-3cols { display: grid; grid-template-columns: 280px 1fr 280px; gap: 15px; margin-bottom: 10px; min-height: calc(100vh - 380px); }
.sidebar-left, .sidebar-right, .main-area { background: var(--card-bg, white); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; display: flex; flex-direction: column; }
.sidebar-left .cards-container, .sidebar-right .properties-container { flex: 1; overflow-y: auto; max-height: calc(100vh - 450px); }
.panel-header { padding: 10px 15px; background: var(--bg-secondary, #f8f9fa); border-bottom: 2px solid var(--border-color, #e9ecef); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.panel-header h3 { font-size: 14px; color: #667eea; margin: 0; }

/* LIBRARY CONTROLS */
.library-controls { padding: 10px 12px; background: #fafafa; border-bottom: 1px solid #eee; }
.search-input, .filter-select { width: 100%; padding: 8px 10px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 13px; margin-bottom: 6px; }
.btn-show-all { width: 100%; padding: 6px; font-size: 12px; }

/* CARDS COUNT */
.cards-count { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: #e0e0e0; }
.cards-count.ok { background: #c8e6c9; color: #2e7d32; }
.cards-count.warning { background: #ffecb3; color: #f57c00; }

/* CARDS */
.cards-container { padding: 12px; max-height: 550px; overflow-y: auto; }
.category { margin-bottom: 18px; }
.category h4 { font-size: 12px; color: #888; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.card-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f8f9fa; border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.card-item:hover { background: #e3f2fd; border-color: #667eea; transform: translateX(4px); }
.card-icon { font-size: 22px; }
.card-name { flex: 1; font-size: 13px; font-weight: 500; }

/* PROGRAM */
.program-zone { padding: 15px; min-height: 300px; max-height: calc(100vh - 380px); overflow-y: auto; }
.empty-state { text-align: center; padding: 80px 20px; color: #999; }
.empty-state p { margin-bottom: 15px; font-size: 15px; }
.program-card { display: flex; align-items: center; gap: 10px; padding: 12px; background: #f8f9fa; border: 2px solid #e9ecef; border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.program-card:hover { border-color: #667eea; }
.program-card.selected { background: #e3f2fd; border-color: #667eea; box-shadow: 0 4px 12px rgba(102,126,234,0.2); }
.card-preview { font-size: 12px; color: #888; font-style: italic; }
.btn-remove { background: #dc3545; color: white; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 12px; margin-left: auto; }

/* CONTAINERS */
.container-zone { margin-left: 25px; padding-left: 15px; border-left: 3px solid #667eea; margin-bottom: 8px; }
.container-label { font-size: 11px; font-weight: 600; color: #667eea; margin: 8px 0 4px; text-transform: uppercase; }
.container-drop { padding: 8px; background: #f0f4ff; border: 2px dashed #667eea; border-radius: 6px; text-align: center; cursor: pointer; font-size: 12px; color: #667eea; margin-bottom: 8px; }
.container-drop:hover { background: #e3f2fd; }

/* PROPERTIES */
.properties-container { padding: 15px; max-height: 550px; overflow-y: auto; }
.properties-card h4 { color: #667eea; margin-bottom: 10px; }
.prop-description { font-size: 13px; color: #666; margin-bottom: 15px; padding: 10px; background: #f5f5f5; border-radius: 6px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: #555; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 14px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; }

/* BOTTOM PANELS - v8.43: Sticky en bas sur desktop */
.bottom-panels { 
    display: grid; 
    grid-template-columns: 1fr 300px; 
    gap: 15px;
    position: sticky;
    bottom: 0;
    background: var(--bg-color, #f0f2f5);
    padding: 15px 0;
    margin: 0 -20px -20px -20px;
    padding: 15px 20px;
    border-top: 2px solid var(--border-color, #dee2e6);
    z-index: 100;
}
.result-panel, .variables-panel { 
    background: var(--card-bg, white); 
    padding: 12px 15px; 
    border-radius: 10px; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); 
}
.panel-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.panel-header-inline h3 { font-size: 14px; color: #667eea; margin: 0; }
.btn-expand {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-expand:hover { background: var(--bg-secondary, #f0f0f0); }
.result-panel h3, .variables-panel h3 { font-size: 14px; color: #667eea; margin-bottom: 10px; }
.result-panel.expanded { 
    position: fixed; 
    bottom: 20px; 
    left: 20px; 
    right: 320px; 
    max-height: 50vh; 
    z-index: 200;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.2);
}
.result-panel.expanded .output-container { max-height: 40vh; overflow-y: auto; }
.output-container { background: #f8f9fa; padding: 12px; border-radius: 8px; min-height: 60px; max-height: 150px; overflow-y: auto; font-family: monospace; font-size: 13px; white-space: pre-wrap; }
.result-success { color: #2e7d32; }
.result-success h4 { margin-bottom: 8px; }
.result-error { color: #c62828; }
.result-error h4 { margin-bottom: 8px; }
.variable-item { display: flex; justify-content: space-between; padding: 8px 10px; background: #f8f9fa; border-radius: 6px; margin-bottom: 6px; }
.variable-name { font-weight: 600; color: #667eea; }
.variable-value { font-family: monospace; color: #333; }

/* TOOLTIP */
.tooltip { position: fixed; background: #2d3748; color: white; padding: 15px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.35); max-width: 320px; z-index: 10000; pointer-events: none; }
.tooltip-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.2); }
.tooltip-icon { font-size: 24px; }
.tooltip-name { font-size: 16px; font-weight: 600; }
.tooltip-description { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
.tooltip-example { font-size: 13px; color: #90cdf4; margin-top: 10px; padding: 10px; background: rgba(255,255,255,0.1); border-radius: 6px; }
.tooltip-pseudo { font-size: 12px; font-family: monospace; background: rgba(0,0,0,0.3); padding: 5px 8px; border-radius: 4px; margin-top: 8px; }
.tooltip-steps { font-size: 12px; margin-top: 10px; }
.tooltip-steps ol { margin-left: 15px; }

/* BUTTONS */
.btn-primary, .btn-secondary, .btn-logout, .btn-danger { padding: 10px 18px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5568d3; transform: translateY(-1px); }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }
.btn-logout { background: rgba(255,255,255,0.2); color: white; padding: 8px 12px; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }
.btn-large { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #999; }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9999; }
.modal-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 12px; width: 90%; max-width: 550px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); z-index: 10000; padding: 20px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* TUTORIAL */
.tutorial-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); z-index: 10001; display: flex; align-items: center; justify-content: center; }
.tutorial-box { background: white; padding: 30px; border-radius: 16px; max-width: 500px; width: 90%; text-align: center; }
.tutorial-step h3 { color: #667eea; margin-bottom: 15px; font-size: 20px; }
.tutorial-step p { font-size: 16px; line-height: 1.6; color: #555; }
.tutorial-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 25px; }
#tutorial-progress { color: #888; font-size: 14px; }
.tutorial-highlight { position: relative; z-index: 10002; box-shadow: 0 0 0 4px #667eea, 0 0 20px rgba(102,126,234,0.5) !important; border-radius: 12px !important; }

/* QUIZZES */
.quiz-container { max-width: 700px; margin: 0 auto; }
.quiz-card { background: white; padding: 30px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.quiz-level { display: inline-block; background: #667eea; color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; margin-bottom: 15px; }
.quiz-question { font-size: 20px; color: #333; margin-bottom: 25px; line-height: 1.4; }
.quiz-choices { display: flex; flex-direction: column; gap: 12px; }
.quiz-choice { display: flex; align-items: center; gap: 15px; padding: 15px; background: #f8f9fa; border: 2px solid #e0e0e0; border-radius: 10px; cursor: pointer; transition: all 0.2s; text-align: left; font-size: 15px; }
.quiz-choice:hover:not(:disabled) { background: #e3f2fd; border-color: #667eea; }
.quiz-choice.correct { background: #c8e6c9; border-color: #4caf50; }
.quiz-choice.wrong { background: #ffcdd2; border-color: #f44336; }
.quiz-choice:disabled { cursor: default; }
.choice-id { width: 32px; height: 32px; background: #667eea; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; }
.quiz-explanation { margin-top: 20px; padding: 15px; border-radius: 10px; font-size: 15px; }
.quiz-explanation.success { background: #e8f5e9; color: #2e7d32; }
.quiz-explanation.error { background: #ffebee; color: #c62828; }
.quiz-next { margin-top: 20px; width: 100%; }
.quiz-progress { font-size: 14px; color: #666; }
.quiz-final { text-align: center; padding: 40px; }
.quiz-score-emoji { font-size: 80px; margin-bottom: 20px; }
.quiz-score-big { font-size: 48px; font-weight: bold; color: #667eea; margin: 15px 0; }
.quiz-final h2 { color: #333; }

/* CARDS MANAGER */
.filters-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.select-input { padding: 10px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 14px; }
.cards-info { margin-bottom: 15px; font-size: 14px; color: #666; display: flex; align-items: center; gap: 10px; }
.cards-info .warning { color: #f57c00; }
.cards-table { width: 100%; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-collapse: collapse; }
.cards-table th { background: #667eea; color: white; padding: 12px; text-align: left; font-weight: 500; font-size: 13px; }
.cards-table td { padding: 12px; border-bottom: 1px solid #e9ecef; font-size: 14px; }
.cards-table tr:last-child td { border-bottom: none; }
.cards-table .actions { white-space: nowrap; }

/* FUNCTIONS */
.functions-info { margin-bottom: 15px; font-size: 14px; color: #666; }
.functions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.function-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.function-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.function-icon { font-size: 28px; }
.function-description { color: #666; font-size: 14px; margin-bottom: 10px; }
.function-example { font-size: 13px; color: #667eea; background: #f0f4ff; padding: 10px; border-radius: 6px; margin-bottom: 10px; }
.function-steps { font-size: 13px; color: #555; margin-bottom: 15px; }
.function-steps ol { margin-left: 18px; }
.function-actions { display: flex; gap: 8px; }

/* ALGOS */
.algos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.algo-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.algo-card h4 { color: #333; margin-bottom: 8px; }
.algo-date { color: #999; font-size: 13px; margin-bottom: 5px; }
.algo-stats { color: #667eea; font-size: 13px; margin-bottom: 15px; }
.algo-actions { display: flex; gap: 8px; }

/* SETTINGS */
.settings-container { max-width: 600px; }
.settings-section { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; }
.settings-section h3 { color: #667eea; margin-bottom: 15px; font-size: 16px; }
.settings-section p { margin-bottom: 12px; color: #555; font-size: 14px; }
.settings-section button { margin-right: 10px; margin-bottom: 10px; }
.admin-only { border-left: 4px solid #dc3545; }

/* RESPONSIVE - v8.43: Optimisé tablette/desktop */
@media (max-width: 1400px) {
    .layout-3cols { grid-template-columns: 260px 1fr 260px; }
}
@media (max-width: 1200px) {
    .layout-3cols { grid-template-columns: 240px 1fr 240px; }
    .bottom-panels { grid-template-columns: 1fr 260px; }
}
@media (max-width: 1024px) {
    /* TABLETTE PAYSAGE */
    .layout-3cols { grid-template-columns: 220px 1fr 220px; gap: 10px; }
    .bottom-panels { grid-template-columns: 1fr 240px; gap: 10px; }
    .toolbar { padding: 10px; gap: 6px; }
    .help-panel { padding: 6px 12px; margin-bottom: 8px; }
}
@media (max-width: 900px) {
    /* TABLETTE PORTRAIT */
    .layout-3cols { 
        grid-template-columns: 200px 1fr; 
        grid-template-rows: auto auto;
    }
    .sidebar-right { 
        grid-column: 1 / -1; 
        max-height: 200px;
    }
    .bottom-panels { 
        grid-template-columns: 1fr; 
        position: relative;
        margin: 0;
        padding: 10px;
    }
    .main-nav { justify-content: flex-start; overflow-x: auto; }
}
@media (max-width: 768px) {
    /* MOBILE LARGE / PETITE TABLETTE */
    .layout-3cols { 
        grid-template-columns: 1fr; 
    }
    .sidebar-left { max-height: 250px; order: 1; }
    .main-area { order: 2; }
    .sidebar-right { max-height: 180px; order: 3; }
    .bottom-panels { grid-template-columns: 1fr; }
    .result-panel.expanded {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    .help-panel.compact .help-header span { font-size: 12px; }
}
@media (max-width: 600px) {
    /* MOBILE */
    .toolbar { flex-direction: column; }
    .toolbar button { width: 100%; }
    .debug-controls { width: 100%; justify-content: center; }
    .input-text { min-width: 100%; }
    .help-panel { display: none; } /* Cacher sur très petit écran */
}
    .toolbar .input-text { width: 100%; }
    .auth-box { padding: 25px; }
}

/* ═══════════════════════════════════════════════════════════════
   PATCH DRAG & DROP v3 - Styles complets
   ═══════════════════════════════════════════════════════════════ */

/* Cartes bibliothèque draggables */
.card-item[draggable="true"] {
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
}

.card-item[draggable="true"]:active {
    cursor: grabbing;
}

.card-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Cartes programme draggables */
.program-card[draggable="true"] {
    cursor: grab;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.program-card[draggable="true"]:active {
    cursor: grabbing;
}

.program-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    background: #e3f2fd;
}

/* Boutons déplacement ↑↓ */
.step-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 8px;
}

.btn-move {
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.btn-move:hover {
    background: #667eea;
    color: white;
}

/* Zones de drop */
.drop-zone {
    min-height: 8px;
    margin: 4px 0;
    border-radius: 6px;
    transition: all 0.2s;
    border: 2px dashed transparent;
}

.drop-zone-empty {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    color: #6c757d;
    font-size: 14px;
}

.drop-zone-active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    min-height: 12px;
}

.drop-zone-hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    min-height: 40px;
    border-style: solid;
}

.drop-zone-hover::after {
    content: '📥 Dépose ici';
    display: block;
    text-align: center;
    color: #667eea;
    font-weight: 500;
    font-size: 13px;
    padding: 8px;
}

/* Conteneurs */
.container-zone {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 3px solid #667eea;
    margin-top: 5px;
    margin-bottom: 10px;
}

.container-section {
    margin-bottom: 10px;
}

.container-label {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.container-body {
    min-height: 50px;
    background: rgba(102, 126, 234, 0.03);
    border-radius: 8px;
    padding: 5px;
    transition: background 0.2s, box-shadow 0.2s;
}

.container-body.container-hover {
    background: rgba(102, 126, 234, 0.15);
    box-shadow: inset 0 0 0 2px #667eea;
}

/* Profondeur visuelle pour conteneurs imbriqués */
.container-zone[data-depth="1"] {
    border-left-color: #9b59b6;
}

.container-zone[data-depth="2"] {
    border-left-color: #e74c3c;
}

.container-zone[data-depth="1"] .container-label {
    color: #9b59b6;
}

.container-zone[data-depth="2"] .container-label {
    color: #e74c3c;
}

/* Toast de succès */
.success-toast {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    animation: toast-in 0.3s ease, toast-out 0.3s ease 1.7s;
    z-index: 100;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Programme - position relative pour toast */
.program-zone {
    position: relative;
}

/* Mobile: boutons ↑↓ plus gros */
@media (max-width: 768px) {
    .btn-move {
        width: 32px;
        height: 28px;
        font-size: 16px;
    }
    
    .step-controls {
        margin-right: 10px;
    }
    
    .drop-zone-empty {
        min-height: 80px;
        font-size: 16px;
    }
}

/* Désactiver la sélection de texte pendant le drag */
body.dragging-active {
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   PATCH TUTORIEL v3 - Draggable + Minimize
   ═══════════════════════════════════════════════════════════════ */

.tutorial-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    pointer-events: none;
}

.tutorial-box {
    position: fixed;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 380px;
    width: 90%;
    z-index: 10001;
    pointer-events: auto;
    transition: box-shadow 0.2s;
}

.tutorial-box.dragging {
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    opacity: 0.95;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    cursor: move;
    user-select: none;
    font-weight: 600;
}

.tutorial-header-btns {
    display: flex;
    gap: 8px;
}

.btn-minimize, .btn-close-tuto {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-minimize:hover, .btn-close-tuto:hover {
    background: rgba(255,255,255,0.4);
}

.tutorial-body {
    padding: 20px;
}

.tutorial-step h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 18px;
}

.tutorial-step p {
    font-size: 15px;
    line-height: 1.5;
    color: #444;
}

.tutorial-drag-hint {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 15px 0 5px;
    font-style: italic;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-skip {
    background: #6c757d !important;
    font-size: 12px;
    padding: 8px 12px;
}

.tutorial-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    z-index: 10002;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: badge-bounce 2s infinite;
}

@keyframes badge-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tutorial-highlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px #667eea, 0 0 30px rgba(102,126,234,0.5) !important;
    border-radius: 12px !important;
    animation: highlight-pulse 1.5s infinite;
    pointer-events: auto !important;
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 4px #667eea, 0 0 30px rgba(102,126,234,0.5); }
    50% { box-shadow: 0 0 0 8px #667eea, 0 0 50px rgba(102,126,234,0.7); }
}

body.tutorial-open .tooltip {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE EXEMPLES - STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Compteur exemples */
.examples-count {
    font-size: 14px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 20px;
}

.examples-count.filtered {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Aide */
.examples-help {
    background: linear-gradient(135deg, #e8f4fd 0%, #e3f2fd 100%);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.examples-help p {
    margin: 0 0 8px 0;
    color: #1565c0;
}

.examples-help ul {
    margin: 0;
    padding-left: 20px;
}

.examples-help li {
    font-size: 14px;
    color: #1976d2;
    margin: 4px 0;
}

/* Liste exemples */
.examples-list {
    padding: 10px 0;
}

/* Catégorie */
.examples-category {
    margin-bottom: 25px;
}

.category-title {
    font-size: 18px;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

/* Grille exemples */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Carte exemple */
.example-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s, box-shadow 0.2s;
}

.example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: #667eea;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.example-icon {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.example-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.example-description {
    font-size: 14px;
    color: #555;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.example-preview {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin: 0 0 12px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Boutons actions */
.example-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.example-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Modal exemples */
#examples-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#examples-modal .modal-box {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

#examples-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

#examples-modal .modal-header h3 {
    margin: 0;
    color: #333;
}

#examples-modal .modal-content {
    padding: 20px;
}

#examples-modal .modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* Étapes preview */
.steps-preview h3 {
    color: #667eea;
    margin: 0 0 10px 0;
}

.steps-desc {
    color: #666;
    margin: 0 0 15px 0;
}

.steps-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
}

.step-item:last-child {
    border-bottom: none;
}

.step-num {
    background: #667eea;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.step-type {
    font-weight: 500;
    color: #333;
}

.step-detail {
    color: #666;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .example-actions {
        flex-direction: column;
    }
    
    .example-actions .btn-sm {
        width: 100%;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PATCH v5 - Corrections Exemples + Toast + Modal
   ═══════════════════════════════════════════════════════════════ */

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 10005;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
}

.toast-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Modal améliorée */
#examples-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.2s;
}

#examples-modal.show {
    opacity: 1;
}

#examples-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    cursor: pointer;
}

#examples-modal .modal-box {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transform: scale(0.9);
    transition: transform 0.2s;
}

#examples-modal.show .modal-box {
    transform: scale(1);
}

#examples-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#examples-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
}

#examples-modal .modal-header .btn-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#examples-modal .modal-header .btn-close:hover {
    background: rgba(255,255,255,0.4);
}

#examples-modal .modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

#examples-modal .modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    background: #f8f9fa;
}

/* Étapes récursives */
.step-children {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 2px solid #667eea;
    margin-top: 5px;
    margin-bottom: 5px;
}

.step-branch {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

/* Highlight carte chargée */
.program-card.highlight-loaded {
    animation: highlight-loaded 2s ease;
}

@keyframes highlight-loaded {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 0 0 4px #28a745, 0 0 20px rgba(40, 167, 69, 0.4); }
}

/* Amélioration cartes exemples */
.example-card {
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
}

.example-card:hover::before {
    opacity: 1;
}

/* Boutons d'action exemples */
.example-actions .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.example-actions .btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

/* ═══════════════════════════════════════════════════════════════
   PATCH v6 - Exemples + Validation + Toast + Modal
   ═══════════════════════════════════════════════════════════════ */

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 10005;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.toast-error { background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%); }
.toast-info { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

/* Modal améliorée */
#examples-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.2s;
}

#examples-modal.show { opacity: 1; }

#examples-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    cursor: pointer;
}

#examples-modal .modal-box {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transform: scale(0.9);
    transition: transform 0.2s;
}

#examples-modal.show .modal-box { transform: scale(1); }

#examples-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#examples-modal .modal-header h3 { margin: 0; font-size: 18px; }

#examples-modal .modal-header .btn-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#examples-modal .modal-header .btn-close:hover { background: rgba(255,255,255,0.4); }
#examples-modal .modal-content { padding: 20px; overflow-y: auto; flex: 1; }
#examples-modal .modal-footer { padding: 15px 20px; border-top: 1px solid #e9ecef; text-align: center; background: #f8f9fa; }

/* Exemples invalides */
.example-card.example-invalid {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
}

.example-card.example-invalid::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
    opacity: 1;
}

.invalid-badge { font-size: 16px; margin-left: auto; }

.example-actions button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc !important;
}

/* Validation warning */
.validation-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: #856404;
    font-weight: 500;
}

/* Steps preview */
.steps-preview h3 { margin: 0 0 10px 0; }
.steps-desc { color: #666; margin-bottom: 15px; }
.steps-list { background: #f8f9fa; border-radius: 8px; padding: 15px; }
.step-item { display: flex; align-items: center; gap: 10px; padding: 8px; background: white; border-radius: 6px; margin-bottom: 5px; }
.step-num { background: #667eea; color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.step-type { font-weight: 600; color: #333; }
.step-detail { color: #666; font-size: 13px; }
.step-branch { font-size: 12px; font-weight: 600; color: #667eea; padding: 5px 0; }

/* Highlight carte chargée */
.program-card.highlight-loaded { animation: highlight-loaded 2s ease; }

@keyframes highlight-loaded {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 0 0 4px #28a745, 0 0 20px rgba(40, 167, 69, 0.4); }
}

/* Amélioration preview cartes */
.card-preview {
    font-size: 11px;
    color: #666;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Erreurs enfant */
.result-error {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 15px;
}

.result-error h4 { color: #dc3545; margin: 0 0 10px 0; }
.result-error p { color: #333; line-height: 1.6; white-space: pre-line; margin: 0; }

/* Bouton success */
.example-actions .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}
.example-actions .btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

/* ═══════════════════════════════════════════════════════════════
   PATCH v7 - CARTES INTELLIGENTES + NOMS DYNAMIQUES + APERÇUS
   ═══════════════════════════════════════════════════════════════ */

/* Amélioration des aperçus de cartes */
.program-card .card-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.program-card .card-preview {
    font-size: 11px;
    color: #555;
    background: linear-gradient(135deg, #f5f5f5, #ebebeb);
    padding: 3px 8px;
    border-radius: 10px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Monaco', 'Consolas', monospace;
    border: 1px solid #ddd;
}

/* Cartes math colorées dans la bibliothèque */
.library-card[data-category*="Maths"] {
    border-left: 4px solid #28a745;
}

.library-card[data-category*="Comparer"] {
    border-left: 4px solid #17a2b8;
}

.library-card[data-category*="Texte"] {
    border-left: 4px solid #fd7e14;
}

/* Amélioration carte programme */
.program-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.program-card:hover {
    border-color: #667eea;
    transform: translateX(3px);
}

.program-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff, #eef1ff);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Icônes des cartes */
.program-card .card-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Conteneurs améliorés */
.container-zone {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 3px solid #667eea;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
}

.container-section {
    margin-bottom: 10px;
}

.container-label {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Drop zones */
.drop-zone {
    height: 8px;
    border-radius: 4px;
    margin: 3px 0;
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    height: 40px;
    background: rgba(102, 126, 234, 0.2);
    border: 2px dashed #667eea;
}

.drop-zone-empty {
    height: 60px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
    border-radius: 10px;
    background: rgba(0,0,0,0.02);
}

.drop-zone-empty:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Amélioration bibliothèque */
#cards-library .library-card {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: white;
    cursor: grab;
    transition: all 0.2s;
    border: 2px solid #e9ecef;
}

#cards-library .library-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

#cards-library .library-card:active {
    cursor: grabbing;
}

/* Catégories dans la page exemples */
.examples-category .category-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* Badges pour nouvelles catégories */
.example-card[data-category*="Maths"] .example-header {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.example-card[data-category*="Maths"] .example-header .example-icon {
    background: #28a745;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   PATCH v8 - STYLES COMPLÉMENTAIRES
   Gestion utilisateurs + Nouvelles catégories de cartes
   ═══════════════════════════════════════════════════════════════ */

/* ─── GESTION UTILISATEURS (Admin) ─── */

.users-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.users-header {
    display: grid;
    grid-template-columns: 1fr 80px 100px 120px;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-row {
    display: grid;
    grid-template-columns: 1fr 80px 100px 120px;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    font-size: 14px;
}

.user-row:last-child {
    border-bottom: none;
}

.user-row.current-user {
    background: linear-gradient(135deg, #f8f9ff, #eef0ff);
}

.user-row .role-admin {
    color: #667eea;
    font-weight: 600;
}

.user-row .role-user {
    color: #6c757d;
}

/* ─── GESTION NIVEAUX (Admin v8.22) ─── */

.admin-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

.admin-table thead tr {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.admin-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #e9ecef;
}

.btn-small:hover {
    background: #dee2e6;
}

.btn-danger-small {
    background: #ffebee;
    color: #c62828;
}

.btn-danger-small:hover {
    background: #ffcdd2;
}

.user-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.user-actions .btn-sm {
    padding: 4px 10px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #e9ecef;
    transition: all 0.2s;
}

.user-actions .btn-sm:hover {
    background: #dee2e6;
    transform: scale(1.05);
}

.user-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.user-actions .btn-danger:hover {
    background: #c82333;
}

/* ─── CATÉGORIES DE CARTES v8 ─── */

/* Vrai/Faux (logique) - Violet */
.library-card[data-category*="Vrai/Faux"],
.library-card[data-category*="logique"] {
    border-left: 4px solid #6f42c1;
}

.program-card[data-type="BOOL_NOT"],
.program-card[data-type="BOOL_AND"],
.program-card[data-type="BOOL_OR"] {
    background: linear-gradient(135deg, #f8f4ff, #f0e6ff);
    border-left: 4px solid #6f42c1;
}

/* Texte - Orange */
.library-card[data-category*="Texte"] {
    border-left: 4px solid #fd7e14;
}

.program-card[data-type="TEXT_LOWER"],
.program-card[data-type="TEXT_LENGTH"],
.program-card[data-type="TEXT_CONTAINS"],
.program-card[data-type="TEXT_CONCAT"],
.program-card[data-type="TEXT_UPPER"] {
    background: linear-gradient(135deg, #fff8f0, #fff3e6);
    border-left: 4px solid #fd7e14;
}

/* Calcul avec formule - Jaune */
.program-card[data-type="VAR_SET_CALC"] {
    background: linear-gradient(135deg, #fffde7, #fff9c4);
    border-left: 4px solid #ffc107;
}

.program-card[data-type="VAR_SET_CALC"] .card-preview {
    font-family: 'Monaco', 'Consolas', monospace;
    background: rgba(255,255,255,0.8);
    border: 1px solid #ffc107;
    color: #d63384;
}

/* Variables par type */
.program-card[data-type="VAR_CREATE_TEXT"] {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
}

.program-card[data-type="VAR_CREATE_BOOL"] {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
}

.program-card[data-type="VAR_SUB"] {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-left: 4px solid #f44336;
}

/* ─── SECTION PARAMÈTRES ─── */

.settings-section h4 {
    font-size: 14px;
    color: #495057;
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #dee2e6;
}

.settings-section button {
    margin: 5px 5px 5px 0;
}

/* ─── AMÉLIORATION TOOLTIPS ─── */

.tooltip {
    max-width: 350px;
}

/* ─── INDICATEURS DE TYPE ─── */

.var-type-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    font-weight: 600;
}

.var-type-badge.num {
    background: #d4edda;
    color: #155724;
}

.var-type-badge.string {
    background: #fff3cd;
    color: #856404;
}

.var-type-badge.bool {
    background: #e2d5f8;
    color: #5a3d8a;
}

/* ═══════════════════════════════════════════════════════════════
   HOTFIX v8.1 - Tooltip à droite + Toast upgrade
   ═══════════════════════════════════════════════════════════════ */

/* Tooltip positionné à droite par défaut */
.tooltip {
    position: fixed;
    max-width: 320px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 10000;
    border: 2px solid #667eea;
}

/* Flèche pointant vers la gauche (tooltip à droite) */
.tooltip::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #667eea;
}

/* Flèche pointant vers la droite (tooltip à gauche - fallback) */
.tooltip.tooltip-left::before {
    left: auto;
    right: -10px;
    border-right: none;
    border-left: 10px solid #667eea;
}

/* Toast de mise à jour */
.upgrade-toast {
    animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 3.7s forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Highlight carte chargée */
.program-card.highlight-loaded {
    animation: highlight-pulse 0.5s ease-in-out 3;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 0 25px rgba(102, 126, 234, 0.8); }
}

/* Boutons réparation admin */
.repair-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.repair-buttons .btn-repair {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.repair-buttons .btn-repair:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   v8.2-stable - STYLES SCOPES + AMÉLIORATIONS
   ═══════════════════════════════════════════════════════════════ */

/* ─── AFFICHAGE DES SCOPES ─── */

.scope-group {
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.scope-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
}

.scope-group:first-child .scope-header {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.scope-group .variable-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scope-group .variable-item:last-child {
    border-bottom: none;
}

.scope-empty {
    padding: 8px 12px;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
    margin: 0;
}

.variable-name {
    font-weight: 600;
    color: #495057;
}

.variable-value {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
}

/* ─── TEST RUNNER UI ─── */

.test-runner-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 10px;
}

.test-runner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* ─── AIDE SCOPES ─── */

.scope-help {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 10px 0;
    font-size: 13px;
}

.scope-help h4 {
    margin: 0 0 8px 0;
    color: #856404;
}

.scope-help p {
    margin: 0;
    color: #856404;
}

/* ─── ERREUR DE SCOPE ─── */

.scope-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 10px 0;
}

.scope-error strong {
    color: #721c24;
}

/* ─── AMÉLIORATION CARTES CONTENEURS ─── */

.container-zone {
    min-height: 50px;
    margin: 8px 0;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.05);
}

.container-zone.then-zone {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.container-zone.else-zone {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.container-zone.body-zone {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.container-label {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   v8.3-debug - AMÉLIORATIONS SCOPES & MESSAGES ERREUR
   ═══════════════════════════════════════════════════════════════ */

/* ─── AFFICHAGE DES SCOPES AMÉLIORÉ ─── */

.scope-group {
    margin-bottom: 12px;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.scope-header {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scope GLOBAL - Vert */
.scope-group:first-child .scope-header {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-bottom: 2px solid #28a745;
}

/* Scope BOUCLE - Bleu */
.scope-header[data-scope*="POUR"],
.scope-header[data-scope*="RÉPÉTER"],
.scope-header[data-scope*="TANT"] {
    background: linear-gradient(135deg, #cce5ff, #b8daff);
    color: #004085;
    border-bottom: 2px solid #007bff;
}

/* Scope FONCTION - Violet */
.scope-header[data-scope*="FONCTION"] {
    background: linear-gradient(135deg, #e2d5f8, #d4c4f0);
    color: #5a3d8a;
    border-bottom: 2px solid #6f42c1;
}

/* ─── MESSAGES D'ERREUR ENFANT-FRIENDLY ─── */

.error-message {
    background: linear-gradient(135deg, #fff5f5, #ffe3e3);
    border: 2px solid #fc8181;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
}

.error-message .error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.error-message .error-title {
    font-weight: 700;
    color: #c53030;
    font-size: 15px;
    margin-bottom: 8px;
}

.error-message .error-text {
    color: #742a2a;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.error-message .error-tip {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
    border-left: 4px solid #48bb78;
}

.error-message .error-tip strong {
    color: #276749;
}

/* ─── INDICATEUR DE SCOPE DANS CARTES ─── */

.card-scope-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.card-scope-badge.global {
    background: #d4edda;
    color: #155724;
}

.card-scope-badge.loop {
    background: #cce5ff;
    color: #004085;
}

.card-scope-badge.function {
    background: #e2d5f8;
    color: #5a3d8a;
}

/* ─── RÈGLE DE SCOPE - AIDE VISUELLE ─── */

.scope-rule-info {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 10px 0;
    font-size: 13px;
}

.scope-rule-info h5 {
    margin: 0 0 8px 0;
    color: #92400e;
    font-size: 14px;
}

.scope-rule-info p {
    margin: 0;
    color: #78350f;
    line-height: 1.5;
}

.scope-rule-info code {
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', monospace;
    color: #92400e;
}

/* ─── TEST RUNNER UI ─── */

.test-results {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    background: #1a202c;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.test-results .test-pass {
    color: #48bb78;
}

.test-results .test-fail {
    color: #fc8181;
}

.test-results .test-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #4a5568;
    font-weight: 600;
}

/* ═══ ASSISTANT BOUCLES (v8.14) ═══ */
.btn-assistant {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin: 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-assistant:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-assistant:active {
    transform: translateY(0);
}

/* Placeholder style pour les inputs */
.form-group input::placeholder {
    color: #aaa;
    font-style: italic;
}

/* ═══ ZONES CONDITION BOUCLES (v8.15) ═══ */

/* Zone condition normale */
.condition-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 8px;
    margin-bottom: 8px;
}

.condition-section .container-label {
    color: #2e7d32;
    font-weight: 600;
}

/* Zone condition MANQUANTE */
.condition-section.condition-missing {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px dashed #f44336;
    animation: pulse-warning 2s infinite;
}

.condition-section.condition-missing .container-label {
    color: #c62828;
    font-weight: 700;
}

@keyframes pulse-warning {
    0%, 100% { border-color: #f44336; }
    50% { border-color: #ff9800; }
}

/* Placeholder dans zone vide */
.condition-placeholder {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    border: 2px dashed #ccc;
    margin: 5px;
}

/* Zone drop pour condition */
.condition-drop {
    min-height: 50px;
}

.condition-drop.drag-over {
    background: rgba(76, 175, 80, 0.2) !important;
    border-color: #4caf50 !important;
}

/* Cartes spéciales boucles */
.card[data-type="LOOP_CONDITION"] {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
}

.card[data-type="LOOP_TIMES"] {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

/* ═══ SLOTS CONDITION DRAG & DROP (v8.16) ═══ */

/* Header de configuration FOR */
.for-config-header {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    padding: 5px;
    background: #e3f2fd;
    border-radius: 5px;
}

.for-config-header strong {
    color: #1976d2;
    font-family: monospace;
    font-size: 1.1em;
}

/* Ligne de slots */
.condition-slots-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #fff3e0;
    border-radius: 8px;
    margin: 5px 0;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.condition-slots-row.condition-complete {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
}

/* Slot individuel */
.condition-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.condition-slot.times-slot {
    min-width: 120px;
}

.slot-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

/* Zone drop du slot */
.slot-drop {
    min-width: 70px;
    min-height: 40px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.2s;
}

.slot-empty .slot-drop {
    border-color: #ff9800;
    background: #fff8e1;
}

.slot-filled .slot-drop {
    border-color: #4caf50;
    border-style: solid;
    background: #e8f5e9;
}

.slot-drop.drag-over {
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: #4caf50 !important;
    transform: scale(1.05);
}

/* Placeholder dans slot vide */
.slot-placeholder {
    font-size: 24px;
    color: #bbb;
    font-weight: bold;
}

.slot-empty .slot-placeholder {
    color: #ff9800;
    animation: pulse-slot 1.5s infinite;
}

@keyframes pulse-slot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cartes dans les slots (petites) */
.slot-drop .program-card {
    margin: 2px;
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;
}

.slot-drop .program-card .card-icon {
    font-size: 14px;
}

.slot-drop .program-card .btn-move,
.slot-drop .program-card .card-preview {
    display: none;
}

/* Zone condition complète */
.condition-section.condition-complete {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4caf50;
    animation: none;
}

.condition-section.condition-complete .container-label {
    color: #2e7d32;
}

/* Cartes valeurs et opérateurs dans bibliothèque */
.card[data-category="Valeurs"] {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
}

.card[data-category="Opérateurs"] {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    border-left: 4px solid #e91e63;
}

/* ═══ WARNING VARIABLES (v8.16) ═══ */
.hint.warning {
    color: #e65100;
    background: #fff3e0;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
    margin: 10px 0;
}

/* ═══════════════════════════════════════════════════════════════
   P2: CARTES UTILES (v8.23)
   ═══════════════════════════════════════════════════════════════ */

.useful-cards-section {
    padding: 10px;
    margin-bottom: 5px;
}

.useful-category {
    margin-bottom: 12px;
}

.useful-category h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #495057;
}

.useful-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.useful-card {
    position: relative;
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border: 2px solid #fbc02d;
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.useful-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 192, 45, 0.3);
}

.useful-card.suggested {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4caf50;
}

.useful-card .usage-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff5722;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.useful-card .card-hint {
    display: block;
    font-size: 10px;
    color: #2e7d32;
    margin-top: 2px;
    font-style: italic;
}

.section-divider {
    border: none;
    border-top: 1px dashed #dee2e6;
    margin: 10px 0;
}

/* Catégorie suggestions */
.useful-category.suggestions h4 {
    color: #2e7d32;
}

/* Catégorie plus utilisées */
.useful-category.most-used h4 {
    color: #e65100;
}

/* Catégorie récentes */
.useful-category.recent h4 {
    color: #1565c0;
}

/* ═══════════════════════════════════════════════════════════════
   P5: CLASSEMENT & GAMIFICATION (v8.23)
   ═══════════════════════════════════════════════════════════════ */

.leaderboard-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Mon profil */
.my-profile-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.profile-level {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.level-icon {
    font-size: 48px;
}

.level-info {
    flex: 1;
}

.level-name {
    font-size: 20px;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

.xp-bar {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.xp-progress {
    background: linear-gradient(90deg, #ffd700, #ff9800);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.xp-text {
    font-size: 14px;
    opacity: 0.9;
}

.profile-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.profile-stats .stat {
    text-align: center;
}

.profile-stats .stat-value {
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.profile-stats .stat-label {
    font-size: 12px;
    opacity: 0.8;
}

/* Badges */
.badges-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.badges-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #495057;
}

.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    border-radius: 10px;
    min-width: 70px;
    transition: all 0.2s ease;
}

.badge-item.earned {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border: 2px solid #fbc02d;
}

.badge-item.locked {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    opacity: 0.5;
}

.badge-item.earned:hover {
    transform: scale(1.1);
}

.badge-icon {
    font-size: 28px;
}

.badge-name {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.empty-badges {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Classement */
.ranking-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ranking-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #495057;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: #e9ecef;
}

.leaderboard-row.is-me {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
}

.leaderboard-row .rank {
    font-size: 18px;
    font-weight: bold;
    min-width: 35px;
    text-align: center;
}

.leaderboard-row .level-icon {
    font-size: 24px;
}

.leaderboard-row .username {
    flex: 1;
    font-weight: 500;
}

.leaderboard-row .xp {
    font-weight: bold;
    color: #ff9800;
}

.empty-leaderboard {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* Animation XP toast */
@keyframes xpPop {
    0% { transform: scale(0) translateY(20px); opacity: 0; }
    50% { transform: scale(1.2) translateY(-10px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   P1: RESPONSIVE MOBILE & TABLETTE (v8.23)
   ═══════════════════════════════════════════════════════════════ */

/* ═══ TABLETTE (768px - 1024px) ═══ */
@media screen and (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .program-container {
        height: 50vh;
    }
    
    .view-header h2 {
        font-size: 18px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Cartes plus compactes */
    .card-item {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .card-icon {
        font-size: 18px;
    }
}

/* ═══ MOBILE (< 768px) ═══ */
@media screen and (max-width: 768px) {
    /* Header compact */
    header {
        padding: 8px 12px;
    }
    
    header h1 {
        font-size: 16px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    /* Navigation en bas */
    nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        display: flex;
        justify-content: space-around;
        padding: 8px 4px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
        overflow-x: auto;
    }
    
    .nav-btn {
        flex-direction: column;
        padding: 6px 10px;
        font-size: 10px;
        min-width: 60px;
    }
    
    .nav-btn::before {
        content: attr(data-icon);
        font-size: 20px;
        display: block;
        margin-bottom: 2px;
    }
    
    /* Main content avec marge pour bottom nav */
    main {
        padding-bottom: 70px;
    }
    
    /* Sidebar = drawer en bas */
    .sidebar {
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        height: 45vh;
        max-height: 45vh;
        z-index: 90;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        transform: translateY(calc(100% - 50px));
        transition: transform 0.3s ease;
    }
    
    .sidebar.expanded {
        transform: translateY(0);
    }
    
    .sidebar-header {
        display: flex;
        justify-content: center;
        padding: 10px;
        cursor: pointer;
    }
    
    .sidebar-handle {
        width: 40px;
        height: 5px;
        background: #dee2e6;
        border-radius: 3px;
    }
    
    /* Zone programme plein écran */
    .program-container {
        height: calc(100vh - 120px);
        padding: 10px;
    }
    
    /* Cartes en grille */
    .category {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .category h4 {
        grid-column: 1 / -1;
        font-size: 12px;
        margin: 5px 0;
    }
    
    .card-item {
        flex-direction: column;
        padding: 10px 8px;
        text-align: center;
        min-height: 60px;
    }
    
    .card-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .card-name {
        font-size: 11px;
        line-height: 1.2;
    }
    
    /* Programme: cartes empilées */
    .program-card {
        margin: 4px 0;
        padding: 10px 12px;
    }
    
    .program-card .card-icon {
        font-size: 20px;
    }
    
    /* Boutons tactiles */
    .btn-primary, .btn-secondary, .btn-danger {
        min-height: 44px;
        font-size: 14px;
        padding: 12px 20px;
    }
    
    /* Modal plein écran */
    .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 85vh;
        margin: 5vh auto;
    }
    
    /* Résultat compact */
    .result-container {
        max-height: 30vh;
    }
    
    /* Classement responsive */
    .leaderboard-container {
        padding: 10px;
    }
    
    .my-profile-card {
        padding: 15px;
    }
    
    .level-icon {
        font-size: 36px;
    }
    
    .badges-grid {
        justify-content: center;
    }
    
    .badge-item {
        min-width: 60px;
        padding: 8px 10px;
    }
    
    /* Cartes utiles en horizontal scroll */
    .useful-cards-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .useful-card {
        min-width: 90px;
        flex-shrink: 0;
    }
    
    /* Admin tables responsive */
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th, .admin-table td {
        padding: 8px 10px;
    }
    
    /* Users table */
    .users-header, .user-row {
        grid-template-columns: 1fr 60px 80px 80px;
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* ═══ PETIT MOBILE (< 480px) ═══ */
@media screen and (max-width: 480px) {
    header h1 {
        font-size: 14px;
    }
    
    .nav-btn {
        padding: 4px 6px;
        font-size: 9px;
        min-width: 50px;
    }
    
    .card-item {
        min-height: 50px;
        padding: 8px 6px;
    }
    
    .card-icon {
        font-size: 20px;
    }
    
    .card-name {
        font-size: 10px;
    }
    
    .useful-card {
        min-width: 70px;
    }
    
    .level-icon {
        font-size: 28px;
    }
    
    .level-name {
        font-size: 16px;
    }
}

/* ═══ INTERACTIONS TACTILES ═══ */
@media (hover: none) and (pointer: coarse) {
    /* Pas de hover sur tactile */
    .card-item:hover, .useful-card:hover, .nav-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Active state pour feedback */
    .card-item:active, .useful-card:active, .nav-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    /* Plus gros targets tactiles */
    .btn-move, .btn-delete, .btn-small {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

/* ═══ ANIMATIONS PERFORMANCE MOBILE ═══ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.24: INTERFACE ÉLÈVE - ÉPREUVES
   ═══════════════════════════════════════════════════════════════ */

.challenges-intro {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

.challenges-intro p {
    margin: 0;
    color: #2e7d32;
}

.challenges-progress {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Grille des épreuves */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.challenge-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.challenge-card.completed {
    background: linear-gradient(135deg, #f1f8e9, #dcedc8);
    border-color: #8bc34a;
}

.challenge-card.completed:hover {
    border-color: #689f38;
}

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

.challenge-status {
    font-size: 24px;
}

.challenge-stars {
    font-size: 14px;
}

.challenge-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.challenge-card-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.challenge-card-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.challenge-xp-badge {
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.challenge-time-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.challenge-tests-badge {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.challenge-completed-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
}

.empty-challenges {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-challenges p {
    margin: 10px 0;
}

/* Modal épreuve */
.challenge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    z-index: 1000;
    overflow-y: auto;
}

.challenge-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    margin-top: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.challenge-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
    color: white;
}

.challenge-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.btn-close-challenge {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-challenge:hover {
    background: rgba(255,255,255,0.3);
}

.challenge-info {
    display: flex;
    gap: 15px;
    padding: 15px 25px;
    background: #f8f9fa;
    flex-wrap: wrap;
}

.challenge-info span {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.challenge-difficulty {
    background: #fff3e0;
    color: #e65100;
}

.challenge-xp {
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #333;
}

.challenge-timer {
    background: #e3f2fd;
    color: #1565c0;
}

.challenge-timer.warning {
    background: #ffebee;
    color: #c62828;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.challenge-description {
    padding: 20px 25px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.challenge-workspace {
    padding: 15px 25px;
    background: #f0f4f8;
}

.workspace-hint {
    margin: 0;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.challenge-actions {
    padding: 20px 25px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-validate {
    padding: 12px 30px;
    font-size: 16px;
}

/* Résultats validation */
.challenge-results {
    padding: 20px 25px;
    border-top: 1px solid #eee;
}

.challenge-success {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 12px;
    margin-bottom: 15px;
}

.challenge-success h4 {
    margin: 0 0 10px 0;
    color: #2e7d32;
    font-size: 20px;
}

.xp-earned {
    font-size: 28px;
    font-weight: bold;
    color: #ff9800;
    margin: 0;
}

.challenge-failed {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-radius: 12px;
    margin-bottom: 15px;
}

.challenge-failed h4 {
    margin: 0 0 10px 0;
    color: #c62828;
}

.tests-details {
    margin-top: 15px;
}

.tests-details h5 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.test-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.test-result.passed {
    background: #e8f5e9;
}

.test-result.failed {
    background: #ffebee;
}

.test-icon {
    font-size: 18px;
}

.test-num {
    font-weight: 600;
    min-width: 60px;
}

.test-detail {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.validating {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Responsive mobile */
@media screen and (max-width: 768px) {
    .challenges-grid {
        grid-template-columns: 1fr;
    }
    
    .challenge-modal-content {
        margin-top: 20px;
        border-radius: 15px;
    }
    
    .challenge-modal-header {
        border-radius: 15px 15px 0 0;
        padding: 15px 20px;
    }
    
    .challenge-info {
        padding: 12px 20px;
    }
    
    .challenge-description {
        padding: 15px 20px;
    }
    
    .challenge-actions {
        flex-direction: column;
        padding: 15px 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.25: ONGLETS LEADERBOARD + STATS + DÉFIS
   ═══════════════════════════════════════════════════════════════ */

/* Onglets */
.leaderboard-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.lb-tab {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.lb-tab:hover {
    background: #e9ecef;
}

.lb-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.lb-tab-content {
    display: none;
}

.lb-tab-content.active {
    display: block;
}

/* Stats Dashboard */
.stats-dashboard {
    padding: 20px;
}

.stats-dashboard h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.stats-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stats-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
}

.empty-stats {
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Top cartes chart */
.top-cards-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-card-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-card-row .card-info {
    min-width: 120px;
    font-size: 13px;
}

.card-bar-container {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.card-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.top-card-row .card-count {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

/* Activité timeline */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.activity-action {
    flex: 1;
    font-size: 13px;
}

.activity-xp {
    font-weight: 600;
    color: #ff9800;
    font-size: 13px;
}

.activity-date {
    font-size: 11px;
    color: #999;
}

/* Défis */
.duels-container {
    padding: 20px;
}

.duels-container h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.duels-intro {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.duels-actions {
    margin-bottom: 25px;
}

.duels-section {
    margin-bottom: 25px;
}

.duels-section h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.duels-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-duels {
    color: #999;
    font-style: italic;
    padding: 15px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.duel-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
}

.duel-card.received {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, #fff9e6, #fff);
}

.duel-card.sent {
    border-left-color: #2196f3;
}

.duel-card.history.won {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, #e8f5e9, #fff);
}

.duel-card.history.lost {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #ffebee, #fff);
}

.duel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.duel-challenger, .duel-opponent {
    font-weight: 600;
    font-size: 14px;
}

.duel-status {
    font-size: 12px;
    color: #666;
}

.duel-info {
    margin-bottom: 10px;
}

.duel-challenge {
    font-size: 13px;
    color: #666;
}

.duel-actions {
    display: flex;
    gap: 8px;
}

.duel-result {
    font-weight: bold;
    font-size: 14px;
}

.duel-vs {
    font-size: 13px;
    color: #666;
    margin: 0 10px;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #e91e63);
    color: white;
    border: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .leaderboard-tabs {
        padding: 8px 10px;
    }
    
    .lb-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 15px 10px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .top-card-row .card-info {
        min-width: 80px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.25: TABLEAU DE BORD CLASSE (Admin)
   ═══════════════════════════════════════════════════════════════ */

.class-dashboard {
    margin-top: 15px;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.summary-stat {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.summary-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.summary-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
}

.students-progress-list {
    max-height: 400px;
    overflow-y: auto;
}

.students-table {
    width: 100%;
    font-size: 13px;
}

.students-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.students-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e9ecef;
}

.students-table tr.active-student {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
}

.students-table tr.active-student td {
    border-color: #c8e6c9;
}

.xp-badge {
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
}

.activity-cell {
    font-size: 11px;
    color: #6c757d;
}

/* Header actions */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .dashboard-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-value {
        font-size: 22px;
    }
    
    .students-table {
        font-size: 11px;
    }
    
    .students-table th,
    .students-table td {
        padding: 8px 5px;
    }
    
    .header-actions {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.26: POINTS DE PERFORMANCE
   ═══════════════════════════════════════════════════════════════ */

.performance-bonus {
    font-size: 14px;
    color: #7b1fa2;
    margin-top: 8px;
    font-weight: 600;
}

.performance-stats {
    background: linear-gradient(135deg, #ede7f6, #e1bee7);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #ce93d8;
}

.performance-stats h5 {
    margin: 0 0 12px 0;
    color: #6a1b9a;
    font-size: 14px;
}

.perf-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.perf-stat {
    text-align: center;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 80px;
}

.perf-stat.rating {
    background: linear-gradient(135deg, #ffd700, #ff9800);
}

.perf-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #6a1b9a;
}

.perf-stat.rating .perf-value {
    color: #333;
    font-size: 14px;
}

.perf-label {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
    display: block;
}

.test-time {
    margin-left: auto;
    font-size: 11px;
    color: #7b1fa2;
    background: #f3e5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Duel avec raison de victoire */
.duel-card .win-reason {
    font-size: 11px;
    color: #6a1b9a;
    margin-left: 5px;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .perf-grid {
        gap: 8px;
    }
    
    .perf-stat {
        min-width: 60px;
        padding: 8px 10px;
    }
    
    .perf-value {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.27: CONSIGNES ÉPREUVES AMÉLIORÉES
   ═══════════════════════════════════════════════════════════════ */

/* Cartes requises dans la carte d'épreuve */
.challenge-required-cards {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 8px 0;
    padding: 6px 10px;
    background: #f3e5f5;
    border-radius: 8px;
}

.required-label {
    font-size: 12px;
    margin-right: 4px;
}

.required-card-icon {
    font-size: 16px;
    background: white;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #ce93d8;
}

.required-more {
    font-size: 11px;
    color: #7b1fa2;
    margin-left: 4px;
}

/* Instructions dans le modal */
.challenge-instructions {
    background: #fafafa;
    border-radius: 10px;
    padding: 15px;
}

.desc-section {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 8px;
}

.desc-section:last-child {
    margin-bottom: 0;
}

.desc-section strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Section Objectif */
.desc-section.objective {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
}

/* Section Cartes */
.desc-section.cards {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border-left: 4px solid #9c27b0;
}

/* Section Entrées */
.desc-section.inputs {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-left: 4px solid #ff9800;
}

/* Section Sorties */
.desc-section.outputs {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-left: 4px solid #4caf50;
    font-family: monospace;
}

/* Section Astuce */
.desc-section.hint {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border-left: 4px solid #fbc02d;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .challenge-required-cards {
        flex-wrap: wrap;
    }
    
    .required-card-icon {
        font-size: 14px;
        padding: 2px 4px;
    }
    
    .desc-section {
        padding: 8px 10px;
    }
    
    .desc-section strong {
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.28: SUSPENSION COMPTE & QUIZ ADMIN
   ═══════════════════════════════════════════════════════════════ */

/* Statuts utilisateur */
.user-status {
    font-size: 11px;
}

.status-suspended {
    color: #c62828;
    background: #ffebee;
    padding: 2px 6px;
    border-radius: 4px;
}

.status-expired {
    color: #e65100;
    background: #fff3e0;
    padding: 2px 6px;
    border-radius: 4px;
}

.status-valid {
    color: #2e7d32;
    font-size: 10px;
}

.status-active {
    color: #2e7d32;
}

.user-row.suspended {
    background: linear-gradient(135deg, #ffebee, #fce4ec);
    border-left: 3px solid #c62828;
}

.user-row.expired {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-left: 3px solid #e65100;
}

/* Boutons admin */
.btn-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
}

/* Quiz admin */
.quizzes-admin-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
}

.quiz-theme-group {
    margin-bottom: 15px;
}

.quiz-theme-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
}

.quiz-count {
    color: #6c757d;
    font-weight: normal;
}

.quiz-theme-list {
    padding-left: 10px;
}

.quiz-admin-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #e9ecef;
}

.quiz-admin-item:hover {
    border-color: #667eea;
}

.quiz-level {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.quiz-question {
    flex: 1;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-actions {
    display: flex;
    gap: 4px;
}

/* Users table header avec colonne supplémentaire */
.users-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
}

.user-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    font-size: 13px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .users-header,
    .user-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .user-row span {
        display: block;
    }
    
    .user-status {
        margin: 5px 0;
    }
    
    .quiz-admin-item {
        flex-wrap: wrap;
    }
    
    .quiz-question {
        width: 100%;
        order: -1;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.29: MODE SOMBRE
   ═══════════════════════════════════════════════════════════════ */

/* Variables CSS pour le thème */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.08);
    --input-bg: #ffffff;
    --header-bg: linear-gradient(135deg, #667eea, #764ba2);
}

/* Mode sombre */
:root.dark-mode {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;
    --border-color: #2d3748;
    --card-bg: #1e2a3a;
    --card-shadow: 0 2px 15px rgba(0,0,0,0.3);
    --input-bg: #2d3748;
    --header-bg: linear-gradient(135deg, #4a5568, #2d3748);
}

/* Application des variables */
.dark-mode body,
.dark-mode .app-container {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.dark-mode .sidebar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.dark-mode .nav-btn {
    color: var(--text-primary);
}

.dark-mode .nav-btn:hover {
    background: var(--bg-tertiary);
}

.dark-mode .main-content {
    background: var(--bg-primary);
}

.dark-mode .view-header {
    background: var(--header-bg);
}

.dark-mode .card,
.dark-mode .algo-card,
.dark-mode .challenge-card,
.dark-mode .example-card,
.dark-mode .quiz-card,
.dark-mode .stat-card,
.dark-mode .duel-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--card-shadow);
}

.dark-mode .card:hover,
.dark-mode .algo-card:hover,
.dark-mode .challenge-card:hover {
    border-color: #667eea;
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-mode .settings-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.dark-mode .settings-section h3,
.dark-mode .settings-section h4 {
    color: var(--text-primary);
}

.dark-mode .admin-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dark-mode .admin-table td {
    border-color: var(--border-color);
}

.dark-mode .user-row {
    border-color: var(--border-color);
}

.dark-mode .users-header {
    background: var(--bg-tertiary);
}

.dark-mode .modal-content,
.dark-mode .challenge-modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dark-mode .library-section {
    background: var(--bg-secondary);
}

.dark-mode .card-item {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .program-area {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.dark-mode .output-panel {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.dark-mode .output-content {
    background: #0d1117;
    color: #58a6ff;
}

.dark-mode .leaderboard-tabs {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.dark-mode .lb-tab {
    color: var(--text-secondary);
}

.dark-mode .lb-tab:hover {
    background: var(--bg-tertiary);
}

.dark-mode .my-profile-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .badges-section,
.dark-mode .ranking-section {
    background: var(--bg-secondary);
}

/* Toggle switch */
.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.theme-label {
    font-size: 14px;
}

.theme-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.theme-switch input:checked + .theme-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.theme-switch input:checked + .theme-slider:before {
    transform: translateX(24px);
}

/* ═══════════════════════════════════════════════════════════════
   v8.29: NOTIFICATIONS TOAST
   ═══════════════════════════════════════════════════════════════ */

#notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.dark-mode .notification {
    background: var(--card-bg);
    color: var(--text-primary);
}

.notif-icon {
    font-size: 20px;
}

.notif-message {
    flex: 1;
    font-size: 14px;
}

.notif-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0 5px;
}

.notif-close:hover {
    color: #333;
}

/* Types de notifications */
.notification-info {
    border-left: 4px solid #2196f3;
}

.notification-success {
    border-left: 4px solid #4caf50;
    background: linear-gradient(135deg, #e8f5e9, #fff);
}

.notification-warning {
    border-left: 4px solid #ff9800;
    background: linear-gradient(135deg, #fff3e0, #fff);
}

.notification-error {
    border-left: 4px solid #f44336;
    background: linear-gradient(135deg, #ffebee, #fff);
}

.notification-xp {
    border-left: 4px solid #ffd700;
    background: linear-gradient(135deg, #fffde7, #fff);
}

.notification-badge {
    border-left: 4px solid #9c27b0;
    background: linear-gradient(135deg, #f3e5f5, #fff);
}

.notification-challenge {
    border-left: 4px solid #00bcd4;
}

.notification-duel {
    border-left: 4px solid #e91e63;
}

/* Responsive */
@media screen and (max-width: 480px) {
    #notifications-container {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .notification {
        transform: translateY(120%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.29: HISTORIQUE DES EXÉCUTIONS
   ═══════════════════════════════════════════════════════════════ */

.history-container {
    padding: 20px;
}

.history-container h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary, #333);
}

.history-intro {
    color: var(--text-muted, #666);
    font-size: 14px;
    margin-bottom: 20px;
}

.execution-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    color: var(--text-muted, #999);
    padding: 30px;
    font-style: italic;
}

.execution-item {
    background: var(--card-bg, white);
    border-radius: 10px;
    padding: 12px 15px;
    border-left: 4px solid #ccc;
    box-shadow: var(--card-shadow, 0 2px 8px rgba(0,0,0,0.08));
}

.execution-item.success {
    border-left-color: #4caf50;
}

.execution-item.error {
    border-left-color: #f44336;
}

.exec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.exec-status {
    font-size: 18px;
}

.exec-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.exec-time {
    font-size: 11px;
    color: var(--text-muted, #999);
}

.exec-details {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.exec-perf,
.exec-steps {
    font-size: 12px;
    color: var(--text-secondary, #666);
    background: var(--bg-tertiary, #f0f0f0);
    padding: 3px 8px;
    border-radius: 4px;
}

.exec-output {
    font-family: monospace;
    font-size: 12px;
    background: #0d1117;
    color: #58a6ff;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.exec-error {
    font-size: 12px;
    color: #c62828;
    background: #ffebee;
    padding: 8px 10px;
    border-radius: 6px;
}

.dark-mode .exec-error {
    background: rgba(198, 40, 40, 0.2);
    color: #ef9a9a;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .exec-header {
        flex-wrap: wrap;
    }
    
    .exec-time {
        width: 100%;
        margin-top: 5px;
    }
    
    .exec-details {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.30: TOOLTIPS AMÉLIORÉS
   ═══════════════════════════════════════════════════════════════ */

.app-tooltip {
    position: fixed;
    z-index: 10001;
    background: rgba(33, 33, 33, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 250px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.app-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.app-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(33, 33, 33, 0.95);
}

/* ═══════════════════════════════════════════════════════════════
   v8.30: INDICATEUR DE CHARGEMENT
   ═══════════════════════════════════════════════════════════════ */

.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.app-loader.visible {
    opacity: 1;
    visibility: visible;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   v8.30: AIDE CONTEXTUELLE - CARTES
   ═══════════════════════════════════════════════════════════════ */

/* Badge d'aide sur les cartes */
.card-item[data-tooltip]::after {
    content: '?';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: rgba(102, 126, 234, 0.8);
    color: white;
    border-radius: 50%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.card-item[data-tooltip]:hover::after {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   v8.30: RACCOURCIS CLAVIER - INFO
   ═══════════════════════════════════════════════════════════════ */

.keyboard-shortcuts-hint {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--card-bg, white);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    font-size: 11px;
    color: var(--text-muted, #666);
    z-index: 100;
    display: none;
}

.keyboard-shortcuts-hint.visible {
    display: block;
}

.shortcut-key {
    background: var(--bg-tertiary, #e9ecef);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
}

/* Section raccourcis clavier */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary, #f0f0f0);
    border-radius: 6px;
}

.shortcut-keys {
    display: flex;
    gap: 4px;
    align-items: center;
}

.shortcut-keys kbd {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #ddd);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    box-shadow: 0 2px 0 var(--border-color, #ddd);
}

.shortcut-desc {
    color: var(--text-secondary, #666);
    font-size: 13px;
}

.dark-mode .shortcut-keys kbd {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 2px 0 var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════
   v8.31: NOUVELLES CARTES - COMMENT & FOR_EACH
   ═══════════════════════════════════════════════════════════════ */

/* FOR_EACH header */
.for-each-header {
    padding: 8px 12px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #2e7d32;
    border-left: 3px solid #4caf50;
}

.for-each-header strong {
    color: #1b5e20;
}

.dark-mode .for-each-header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #a5d6a7;
}

.dark-mode .for-each-header strong {
    color: #c8e6c9;
}

/* Carte COMMENT - style spécial */
.program-card[data-card-type="COMMENT"] {
    background: linear-gradient(135deg, #fff9c4, #fff59d) !important;
    border-color: #fbc02d !important;
    opacity: 0.85;
}

.program-card[data-card-type="COMMENT"]:hover {
    opacity: 1;
}

.dark-mode .program-card[data-card-type="COMMENT"] {
    background: linear-gradient(135deg, #5d4037, #4e342e) !important;
    border-color: #8d6e63 !important;
}

/* Icône commentaire */
.program-card[data-card-type="COMMENT"] .card-icon {
    opacity: 0.7;
}

.program-card[data-card-type="COMMENT"] .card-name {
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   v8.34: MODULE COURS
   ═══════════════════════════════════════════════════════════════ */

/* Container cours */
.courses-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Carte chapitre */
.chapter-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow, 0 2px 10px rgba(0,0,0,0.1));
    transition: transform 0.2s, box-shadow 0.2s;
}

.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.chapter-card.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.chapter-card.completed {
    border-left: 4px solid #28a745;
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.chapter-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
}

.chapter-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.chapter-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary, #666);
}

.chapter-status {
    margin-left: auto;
}

.locked-badge, .completed-badge, .progress-badge {
    font-size: 24px;
}

.progress-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Barre de progression chapitre */
.chapter-progress-bar {
    height: 6px;
    background: var(--bg-tertiary, #e9ecef);
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.chapter-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Liste des leçons */
.chapter-lessons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.lesson-item:hover {
    background: var(--bg-tertiary, #e9ecef);
}

.lesson-item.done {
    background: rgba(40, 167, 69, 0.1);
}

.lesson-status {
    font-size: 18px;
}

.lesson-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* Challenge */
.challenge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s;
}

.challenge-item:hover:not(.locked) {
    transform: scale(1.02);
}

.challenge-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.challenge-item.done {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.challenge-status {
    font-size: 24px;
}

.challenge-title {
    flex: 1;
    font-weight: 600;
    color: #856404;
}

.challenge-item.done .challenge-title {
    color: #155724;
}

.challenge-xp {
    background: #ffc107;
    color: #856404;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.challenge-item.done .challenge-xp {
    background: #28a745;
    color: white;
}

/* Modal leçon */
.lesson-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.lesson-modal-content {
    background: var(--card-bg, white);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.lesson-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.lesson-view h2 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.lesson-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.lesson-cards, .lesson-tips, .lesson-example, .lesson-quiz {
    margin-bottom: 20px;
}

.lesson-cards h4, .lesson-tips h4, .lesson-example h4, .lesson-quiz h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.cards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.lesson-tips ul {
    margin: 0;
    padding-left: 20px;
}

.lesson-tips li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.example-result {
    background: var(--bg-secondary, #f8f9fa);
    padding: 12px;
    border-radius: 8px;
}

.example-result code {
    background: #0d1117;
    color: #58a6ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Quiz dans leçon */
.quiz-question {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-choice {
    padding: 12px 15px;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    background: var(--card-bg, white);
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: all 0.2s;
}

.quiz-choice:hover:not(:disabled) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.quiz-choice.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.quiz-choice.wrong {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.quiz-done {
    margin-top: 15px;
    padding: 10px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    color: #28a745;
    text-align: center;
}

.lesson-actions {
    margin-top: 20px;
    text-align: center;
}

/* XP display */
.course-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

#course-total-xp {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Dark mode */
.dark-mode .chapter-card {
    background: var(--card-bg);
}

.dark-mode .lesson-item {
    background: var(--bg-tertiary);
}

.dark-mode .challenge-item {
    background: linear-gradient(135deg, #5d4e37, #4a3f2f);
}

.dark-mode .challenge-title {
    color: #ffc107;
}

.dark-mode .lesson-modal-content {
    background: var(--card-bg);
}

/* Responsive */
@media (max-width: 600px) {
    .chapter-header {
        flex-wrap: wrap;
    }
    
    .chapter-status {
        width: 100%;
        text-align: right;
        margin-top: 10px;
    }
    
    .lesson-modal-content {
        padding: 20px;
        margin: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.36: VISUALISATION PORTÉE DES VARIABLES
   ═══════════════════════════════════════════════════════════════ */

/* Légende des couleurs */
.scope-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    font-size: 11px;
}

.legend-item {
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.legend-item.scope-global { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.legend-item.scope-for { background: rgba(0, 123, 255, 0.15); color: #007bff; }
.legend-item.scope-foreach { background: rgba(111, 66, 193, 0.15); color: #6f42c1; }
.legend-item.scope-while { background: rgba(253, 126, 20, 0.15); color: #fd7e14; }
.legend-item.scope-func { background: rgba(220, 53, 69, 0.15); color: #dc3545; }

/* Groupes de scope */
.scope-group {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Couleurs par type de scope */
.scope-group.scope-global {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08), rgba(40, 167, 69, 0.02));
}

.scope-group.scope-for {
    border-color: #007bff;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08), rgba(0, 123, 255, 0.02));
}

.scope-group.scope-foreach {
    border-color: #6f42c1;
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.08), rgba(111, 66, 193, 0.02));
}

.scope-group.scope-while {
    border-color: #fd7e14;
    background: linear-gradient(135deg, rgba(253, 126, 20, 0.08), rgba(253, 126, 20, 0.02));
}

.scope-group.scope-repeat {
    border-color: #17a2b8;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.08), rgba(23, 162, 184, 0.02));
}

.scope-group.scope-func {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08), rgba(220, 53, 69, 0.02));
}

.scope-group.scope-other {
    border-color: #6c757d;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.08), rgba(108, 117, 125, 0.02));
}

/* Header du scope */
.scope-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
}

.scope-global .scope-header { color: #28a745; background: rgba(40, 167, 69, 0.1); }
.scope-for .scope-header { color: #007bff; background: rgba(0, 123, 255, 0.1); }
.scope-foreach .scope-header { color: #6f42c1; background: rgba(111, 66, 193, 0.1); }
.scope-while .scope-header { color: #fd7e14; background: rgba(253, 126, 20, 0.1); }
.scope-repeat .scope-header { color: #17a2b8; background: rgba(23, 162, 184, 0.1); }
.scope-func .scope-header { color: #dc3545; background: rgba(220, 53, 69, 0.1); }

.scope-icon {
    font-size: 16px;
}

.scope-name {
    flex: 1;
    font-family: monospace;
}

.scope-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-weight: normal;
}

/* Variables dans le scope */
.scope-vars {
    padding: 8px;
}

.variable-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--card-bg, white);
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.variable-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Couleurs des variables par scope */
.scope-global-var { border-left: 3px solid #28a745; }
.scope-for-var { border-left: 3px solid #007bff; }
.scope-foreach-var { border-left: 3px solid #6f42c1; }
.scope-while-var { border-left: 3px solid #fd7e14; }
.scope-repeat-var { border-left: 3px solid #17a2b8; }
.scope-func-var { border-left: 3px solid #dc3545; }
.scope-other-var { border-left: 3px solid #6c757d; }

.variable-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.variable-name {
    font-weight: 600;
    color: var(--text-primary);
}

.variable-equals {
    color: var(--text-secondary, #999);
    margin: 0 2px;
}

.variable-value {
    flex: 1;
    text-align: right;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-secondary, #f0f0f0);
}

/* Couleurs par type de valeur */
.variable-value.var-number { color: #007bff; background: rgba(0, 123, 255, 0.1); }
.variable-value.var-string { color: #28a745; background: rgba(40, 167, 69, 0.1); }
.variable-value.var-bool { color: #fd7e14; background: rgba(253, 126, 20, 0.1); }
.variable-value.var-array { color: #6f42c1; background: rgba(111, 66, 193, 0.1); }
.variable-value.var-object { color: #dc3545; background: rgba(220, 53, 69, 0.1); }

/* Animation d'apparition des variables */
@keyframes varAppear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.variable-item {
    animation: varAppear 0.3s ease-out;
}

/* Animation quand scope change */
@keyframes scopePulse {
    0% { box-shadow: 0 0 0 0 currentColor; }
    50% { box-shadow: 0 0 10px 2px currentColor; }
    100% { box-shadow: 0 0 0 0 currentColor; }
}

.scope-group.active {
    animation: scopePulse 0.5s ease-out;
}

/* Empty state */
.scope-empty {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    padding: 10px;
    margin: 0;
}

/* Dark mode */
.dark-mode .scope-legend {
    background: var(--bg-tertiary);
}

.dark-mode .variable-item {
    background: var(--bg-tertiary);
}

.dark-mode .scope-group.scope-global { background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.05)); }
.dark-mode .scope-group.scope-for { background: linear-gradient(135deg, rgba(0, 123, 255, 0.15), rgba(0, 123, 255, 0.05)); }
.dark-mode .scope-group.scope-foreach { background: linear-gradient(135deg, rgba(111, 66, 193, 0.15), rgba(111, 66, 193, 0.05)); }
.dark-mode .scope-group.scope-while { background: linear-gradient(135deg, rgba(253, 126, 20, 0.15), rgba(253, 126, 20, 0.05)); }
.dark-mode .scope-group.scope-func { background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.05)); }

/* Responsive */
@media (max-width: 600px) {
    .scope-legend {
        font-size: 10px;
    }
    
    .legend-item {
        padding: 2px 6px;
    }
    
    .variable-item {
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.39: MODE DÉBOGAGE VISUEL
   ═══════════════════════════════════════════════════════════════ */

/* Boutons de débogage */
.debug-controls {
    display: inline-flex;
    gap: 5px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 2px solid var(--border-color, #dee2e6);
}

.btn-debug {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--bg-secondary, #e9ecef);
    color: var(--text-primary);
}

.btn-debug:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-debug:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btn-debug-start {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
}

#btn-debug-start:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a32a3, #4a2893);
}

.btn-step {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.btn-step:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3, #003d80);
}

.btn-play {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.btn-play:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34, #155724);
}

.btn-play.playing {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #000;
}

.btn-stop {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333, #a71d2a);
}

/* Highlight de la carte en cours de débogage */
.program-card.debug-highlight {
    position: relative;
    animation: debugPulse 1s ease-in-out infinite;
    z-index: 10;
}

.program-card.debug-highlight::before {
    content: '➡️';
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: debugArrow 0.5s ease-in-out infinite alternate;
}

.program-card.debug-highlight::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 3px solid #ffc107;
    border-radius: 12px;
    animation: debugBorder 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes debugPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
        background: linear-gradient(135deg, #fff3cd, #ffeeba);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(255, 193, 7, 0.6);
        background: linear-gradient(135deg, #ffeeba, #fff3cd);
    }
}

@keyframes debugArrow {
    from {
        transform: translateY(-50%) translateX(-5px);
    }
    to {
        transform: translateY(-50%) translateX(0);
    }
}

@keyframes debugBorder {
    0%, 100% {
        border-color: #ffc107;
    }
    50% {
        border-color: #ff9800;
    }
}

/* Panneau de débogage */
.debug-panel {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #6f42c1;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.debug-header {
    font-size: 16px;
    font-weight: 700;
    color: #6f42c1;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(111, 66, 193, 0.2);
}

.debug-instruction {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 14px;
    border-left: 4px solid #6f42c1;
}

.debug-output {
    background: #0d1117;
    border-radius: 8px;
    padding: 10px;
    color: #c9d1d9;
}

.debug-output .debug-label {
    color: #8b949e;
    font-size: 12px;
    margin-bottom: 5px;
}

.debug-output pre {
    margin: 0;
    font-family: monospace;
    font-size: 13px;
    color: #58a6ff;
}

.debug-complete {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    animation: successPop 0.3s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dark mode pour le débogage */
.dark-mode .debug-panel {
    background: linear-gradient(135deg, #1e1e2e, #2d2d3d);
    border-color: #9d7cd8;
}

.dark-mode .debug-header {
    color: #9d7cd8;
    border-color: rgba(157, 124, 216, 0.3);
}

.dark-mode .debug-instruction {
    background: var(--card-bg);
    border-color: #9d7cd8;
    color: var(--text-primary);
}

.dark-mode .program-card.debug-highlight {
    background: linear-gradient(135deg, #3d3d1f, #4d4d2f) !important;
}

.dark-mode .program-card.debug-highlight::after {
    border-color: #ffc107;
}

.dark-mode .debug-complete {
    background: linear-gradient(135deg, #1a3d1a, #2d4d2d);
    color: #4ade80;
}

/* Responsive */
@media (max-width: 768px) {
    .debug-controls {
        display: flex;
        flex-wrap: wrap;
        margin-left: 0;
        margin-top: 10px;
        padding-left: 0;
        border-left: none;
        border-top: 2px solid var(--border-color, #dee2e6);
        padding-top: 10px;
    }
    
    .btn-debug {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.40: BOUTON DUPLIQUER + PROJETS GUIDÉS
   ═══════════════════════════════════════════════════════════════ */

/* Bouton Dupliquer */
.btn-duplicate {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.btn-duplicate:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.program-card:hover .btn-duplicate {
    opacity: 0.8;
}

/* Container Projets */
.projects-container {
    padding: 20px;
}

.projects-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 10px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Carte Projet */
.project-card {
    background: var(--card-bg, white);
    border-radius: 16px;
    padding: 20px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow, 0 2px 10px rgba(0,0,0,0.1));
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.project-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 15px;
}

.project-info h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.project-info p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.project-concepts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.concept-tag {
    background: var(--bg-secondary, #e9ecef);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-primary);
}

.project-status {
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.project-status.completed {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.project-status.in-progress {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.project-status.new {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.project-status .progress-bar {
    height: 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

.project-status .progress-fill {
    height: 100%;
    background: #007bff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Modal Projet */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.project-modal-content {
    background: var(--card-bg, white);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.project-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    border: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    z-index: 10;
}

.project-view .project-header {
    padding: 30px;
    color: white;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.project-icon-large {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

.project-view .project-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.project-view .project-header p {
    margin: 0;
    opacity: 0.9;
}

/* Étapes du projet */
.project-steps {
    padding: 20px;
}

.project-step {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--bg-secondary, #f8f9fa);
    transition: all 0.3s ease;
}

.project-step.current {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 2px solid #ffc107;
}

.project-step.done {
    background: rgba(40, 167, 69, 0.1);
    opacity: 0.8;
}

.project-step.locked {
    opacity: 0.5;
}

.step-number {
    font-size: 18px;
    font-weight: 700;
    min-width: 40px;
}

.step-content h4 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
}

.step-content p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.step-hint {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #5a4fcf;
}

.project-finish {
    padding: 20px;
    text-align: center;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.project-complete {
    text-align: center;
    padding: 30px;
    font-size: 24px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    margin: 20px;
    border-radius: 12px;
}

.project-actions {
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color, #dee2e6);
}

/* Dark mode */
.dark-mode .project-card {
    background: var(--card-bg);
}

.dark-mode .project-step {
    background: var(--bg-tertiary);
}

.dark-mode .project-step.current {
    background: linear-gradient(135deg, #3d3d1f, #4d4d2f);
}

.dark-mode .project-modal-content {
    background: var(--card-bg);
}

.dark-mode .project-close {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-modal-content {
        margin: 10px;
        border-radius: 16px;
    }
    
    .project-view .project-header {
        padding: 20px;
        border-radius: 16px 16px 0 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.41: GAMIFICATION - BADGES & CERTIFICATS
   ═══════════════════════════════════════════════════════════════ */

/* Stats badges */
.badges-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
    margin: 20px;
}

.badge-stat {
    text-align: center;
}

.badge-stat span:first-child {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color, #667eea);
}

.badge-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Container badges */
.badges-container {
    padding: 20px;
}

.badges-category {
    margin-bottom: 30px;
}

.badges-category-title {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color, #dee2e6);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Carte badge */
.badge-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--card-bg, white);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow, 0 2px 8px rgba(0,0,0,0.08));
}

.badge-card.earned {
    border-color: var(--primary-color, #667eea);
}

.badge-card.locked {
    opacity: 0.6;
}

.badge-card.locked .badge-icon {
    filter: grayscale(100%);
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.badge-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.badge-info {
    flex: 1;
}

.badge-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.badge-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.badge-date {
    font-size: 12px;
    color: #28a745;
}

.badge-locked {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Bouton certificat */
.btn-certificate {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-certificate:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* Notification badge débloqué */
.badge-unlocked-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.5);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 350px;
}

.badge-unlocked-notification.show {
    transform: translateX(0);
}

.badge-unlocked-content {
    display: flex;
    gap: 15px;
    align-items: center;
}

.badge-unlocked-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: badgeBounce 0.6s ease-out;
}

@keyframes badgeBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.badge-unlocked-info {
    flex: 1;
}

.badge-unlocked-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.badge-unlocked-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.badge-unlocked-desc {
    font-size: 13px;
    opacity: 0.85;
}

/* Dark mode */
.dark-mode .badges-stats {
    background: var(--bg-tertiary);
}

.dark-mode .badge-card {
    background: var(--card-bg);
}

/* Responsive */
@media (max-width: 600px) {
    .badges-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .badges-grid {
        grid-template-columns: 1fr;
    }
    
    .badge-unlocked-notification {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 20px;
        transform: translateY(120%);
    }
    
    .badge-unlocked-notification.show {
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.42: EXPORT PHP/JS
   ═══════════════════════════════════════════════════════════════ */

/* Bouton Export */
.btn-export {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
}

.btn-export:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

/* Modal Export */
.export-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.export-modal-content {
    background: var(--card-bg, white);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.export-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.export-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 8px;
}

.export-close:hover {
    background: var(--bg-secondary);
}

/* Tabs Export */
.export-tabs {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: var(--bg-secondary, #f8f9fa);
}

.export-tab {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.export-tab:hover {
    background: var(--card-bg, white);
}

.export-tab.active {
    background: var(--card-bg, white);
    color: var(--primary-color, #667eea);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Preview Code */
.export-preview {
    flex: 1;
    overflow: auto;
    padding: 0;
    background: #1e1e2e;
    max-height: 50vh;
}

.export-preview pre {
    margin: 0;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #c9d1d9;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Actions Export */
.export-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color, #dee2e6);
    justify-content: flex-end;
}

.btn-copy, .btn-download {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-copy {
    background: var(--bg-secondary, #e9ecef);
    color: var(--text-primary);
}

.btn-copy:hover {
    background: var(--border-color, #dee2e6);
}

.btn-download {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Dark mode */
.dark-mode .export-modal-content {
    background: var(--card-bg);
}

.dark-mode .export-tabs {
    background: var(--bg-tertiary);
}

.dark-mode .export-tab.active {
    background: var(--card-bg);
}

/* Responsive */
@media (max-width: 600px) {
    .export-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .export-tabs {
        flex-wrap: wrap;
    }
    
    .export-tab {
        flex: 1;
        text-align: center;
    }
    
    .export-actions {
        flex-direction: column;
    }
    
    .btn-copy, .btn-download {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.43: AMÉLIORATIONS UX DESKTOP/TABLETTE
   ═══════════════════════════════════════════════════════════════ */

/* Amélioration vue principale */
#view-enfant {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    overflow: hidden;
}

#view-enfant .toolbar {
    flex-shrink: 0;
}

#view-enfant .layout-3cols {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#view-enfant .bottom-panels {
    flex-shrink: 0;
}

/* Main area flex */
.main-area {
    display: flex;
    flex-direction: column;
}

.main-area .program-zone {
    flex: 1;
    min-height: 200px;
    max-height: none;
}

/* Sidebar scroll amélioré */
.cards-container {
    padding: 10px;
    overflow-y: auto;
}

.properties-container {
    padding: 12px;
    overflow-y: auto;
}

/* Dark mode pour nouveaux éléments */
.dark-mode .help-panel {
    background: linear-gradient(135deg, #1a3d1a 0%, #2d4d2d 100%);
    border-color: #4caf50;
}

.dark-mode .help-panel .help-header span,
.dark-mode .help-panel.compact .help-content ol {
    color: #81c784;
}

.dark-mode .bottom-panels {
    background: var(--bg-color);
    border-color: var(--border-color);
}

.dark-mode .result-panel,
.dark-mode .variables-panel {
    background: var(--card-bg);
}

.dark-mode .output-container {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Animation scroll pour result */
.result-panel .output-container {
    scroll-behavior: smooth;
}

/* Toolbar compacte sur écrans moyens */
@media (min-width: 901px) and (max-width: 1200px) {
    .toolbar .btn-secondary,
    .toolbar .btn-primary {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .debug-controls .btn-debug {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Focus visible pour accessibilité */
.btn-execute:focus,
.btn-debug:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Amélioration cartes bibliothèque pour plus de visibilité */
.library-card {
    padding: 10px 12px;
    margin-bottom: 6px;
}

.library-card .card-icon {
    font-size: 18px;
}

.library-card .card-name {
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   v8.44: TOUCH MOBILE - GESTES TACTILES
   ═══════════════════════════════════════════════════════════════ */

/* Indicateur tactile activé */
.touch-enabled {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.touch-enabled * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.touch-enabled input,
.touch-enabled textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Carte en cours de swipe */
.program-card {
    touch-action: pan-y;
    will-change: transform;
}

.program-card.swipe-delete {
    background: linear-gradient(90deg, #ffebee 0%, #ffcdd2 100%) !important;
    border-color: #f44336 !important;
}

.program-card.swipe-delete::after {
    content: '🗑️';
    position: absolute;
    right: 15px;
    font-size: 24px;
    opacity: 0.8;
}

.program-card.swipe-duplicate {
    background: linear-gradient(90deg, #e8f5e9 0%, #c8e6c9 100%) !important;
    border-color: #4caf50 !important;
}

.program-card.swipe-duplicate::after {
    content: '📋';
    position: absolute;
    left: 15px;
    font-size: 24px;
    opacity: 0.8;
}

/* Feedback toast */
.touch-feedback {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.touch-feedback.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Menu contextuel tactile */
.touch-context-menu {
    position: fixed;
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    overflow: hidden;
    min-width: 180px;
    animation: menuPop 0.2s ease-out;
}

@keyframes menuPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.context-menu-item:hover,
.context-menu-item:active {
    background: var(--bg-secondary, #f0f0f0);
}

.context-menu-item.delete {
    color: #f44336;
}

.context-menu-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color, #eee);
}

/* Aide gestes tactiles */
.touch-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.touch-help-content {
    background: var(--card-bg, white);
    border-radius: 16px;
    padding: 25px;
    max-width: 320px;
    width: 100%;
}

.touch-help-content h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--text-primary);
}

.touch-help-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #eee);
}

.touch-help-item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.touch-help-item .gesture {
    font-weight: 600;
    color: var(--primary-color, #667eea);
}

.touch-help-item .action {
    color: var(--text-secondary);
}

.touch-help-content button {
    width: 100%;
    margin-top: 10px;
}

/* Indicateurs de swipe sur les côtés */
.touch-enabled #view-enfant::before,
.touch-enabled #view-enfant::after {
    content: '';
    position: fixed;
    top: 50%;
    width: 30px;
    height: 60px;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
    border-radius: 0 30px 30px 0;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.touch-enabled #view-enfant::before {
    left: 0;
}

.touch-enabled #view-enfant::after {
    right: 0;
    transform: translateY(-50%) scaleX(-1);
}

/* Zone de swipe hint au démarrage */
.swipe-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 100;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Bouton aide tactile */
.btn-touch-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    display: none;
}

.touch-enabled .btn-touch-help {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Amélioration des zones de toucher */
.touch-enabled .library-card {
    min-height: 48px;
    padding: 12px 14px;
}

.touch-enabled .program-card {
    min-height: 52px;
    padding: 14px;
}

.touch-enabled .btn-remove,
.touch-enabled .btn-duplicate {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.touch-enabled .btn-move {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

/* Dark mode tactile */
.dark-mode .touch-feedback {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

.dark-mode .touch-context-menu {
    background: var(--card-bg);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.dark-mode .touch-help-content {
    background: var(--card-bg);
}

/* Animation de glissement pour les cartes */
@keyframes slideOutLeft {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive tactile */
@media (max-width: 768px) {
    .touch-feedback {
        bottom: 80px;
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .touch-context-menu {
        left: 50% !important;
        transform: translateX(-50%);
        min-width: 200px;
    }
    
    .btn-touch-help {
        bottom: 70px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* Désactiver certains effets sur desktop */
@media (hover: hover) and (pointer: fine) {
    .btn-touch-help {
        display: none !important;
    }
    
    .touch-hint {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v8.45: LOGO SOJO ACADEMY - MODE CLAIR/SOMBRE
   ═══════════════════════════════════════════════════════════════ */

/* Mode sombre: afficher logo violet */
.dark-mode .logo-light { display: none; }
.dark-mode .logo-dark { display: block; }

/* Ajustements header en dark mode */
.dark-mode .app-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .app-subtitle {
    opacity: 0.7;
}

/* Responsive logo */
@media (max-width: 768px) {
    .logo { height: 35px; }
    .auth-logo .logo { height: 50px; }
    .app-title h1 { font-size: 20px; }
    .app-subtitle { font-size: 10px; }
    .logo-title { gap: 10px; }
}

@media (max-width: 480px) {
    .logo { height: 30px; }
    .auth-logo .logo { height: 45px; }
    .app-title h1 { font-size: 18px; }
    .app-subtitle { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   v8.46: NAVIGATION ENTRE PAGES AMÉLIORÉE
   ═══════════════════════════════════════════════════════════════ */

/* Transition fluide entre vues */
.view {
    transition: opacity 0.2s ease-in-out;
}

/* Style distinct pour chaque section */
#view-courses,
#view-projects,
#view-badges,
#view-challenges,
#view-leaderboard,
#view-quizzes,
#view-mes-algos,
#view-examples {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header de section bien visible */
.view-header {
    background: var(--card-bg, white);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.view-header h2 {
    font-size: 24px;
    color: var(--primary-color, #667eea);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bouton nav actif bien visible */
.nav-btn.active {
    background: rgba(255,255,255,0.25);
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Indicateur visuel de la page active */
.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.nav-btn {
    position: relative;
}

/* Animation d'entrée de page */
@keyframes fadeInView {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view.active {
    animation: fadeInView 0.25s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   v8.47: GUIDE DES CARTES PÉDAGOGIQUE
   ═══════════════════════════════════════════════════════════════ */

/* Container principal */
.help-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Introduction */
.help-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
}

.help-intro h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.help-intro p {
    font-size: 16px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Sommaire */
.help-toc {
    background: var(--card-bg, white);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.help-toc h3 {
    color: var(--primary-color, #667eea);
    margin-bottom: 15px;
    font-size: 18px;
}

.help-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-toc li a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-secondary, #f0f2f5);
    color: var(--text-primary, #333);
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s;
}

.help-toc li a:hover {
    background: var(--primary-color, #667eea);
    color: white;
    transform: translateY(-2px);
}

/* Catégorie */
.help-category {
    margin-bottom: 40px;
}

.help-category h3 {
    font-size: 24px;
    color: var(--primary-color, #667eea);
    padding: 15px 20px;
    background: var(--card-bg, white);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary-color, #667eea);
}

.category-desc {
    font-size: 16px;
    color: var(--text-secondary, #666);
    padding: 0 10px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Grille de cartes */
.help-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Carte d'aide individuelle */
.help-card {
    background: var(--card-bg, white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.help-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.help-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.help-card-icon {
    font-size: 32px;
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 12px;
}

.help-card-header h4 {
    font-size: 18px;
    margin: 0;
}

.help-card-body {
    padding: 20px;
}

/* Sections dans la carte */
.card-explanation,
.card-params,
.card-example {
    margin-bottom: 18px;
}

.card-explanation h5,
.card-params h5,
.card-example h5 {
    font-size: 14px;
    color: var(--primary-color, #667eea);
    margin-bottom: 8px;
    font-weight: 600;
}

.card-explanation p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary, #333);
}

/* Paramètres */
.card-params ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-params li {
    padding: 10px 12px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.card-params li strong {
    color: var(--primary-color, #667eea);
}

/* Exemple */
.card-example {
    background: #fffbeb;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
}

.example-setup {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 8px;
}

.example-result {
    font-size: 14px;
    color: #065f46;
    font-weight: 600;
}

/* Astuce */
.card-tips {
    background: #ecfdf5;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #047857;
    border-left: 4px solid #10b981;
}

/* Loading */
.help-cards-container .loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

/* Dark mode */
.dark-mode .help-intro {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .help-toc li a {
    background: var(--bg-tertiary);
}

.dark-mode .card-example {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.dark-mode .example-setup {
    color: #fbbf24;
}

.dark-mode .example-result {
    color: #34d399;
}

.dark-mode .card-tips {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

/* Responsive */
@media (max-width: 768px) {
    .help-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .help-intro {
        padding: 20px;
    }
    
    .help-intro h2 {
        font-size: 22px;
    }
    
    .help-category h3 {
        font-size: 20px;
    }
    
    .help-toc ul {
        flex-direction: column;
    }
    
    .help-card-icon {
        font-size: 24px;
        padding: 8px;
    }
}

/* Animation d'apparition */
@keyframes helpCardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-card {
    animation: helpCardAppear 0.4s ease-out;
}

.help-card:nth-child(1) { animation-delay: 0.05s; }
.help-card:nth-child(2) { animation-delay: 0.1s; }
.help-card:nth-child(3) { animation-delay: 0.15s; }
.help-card:nth-child(4) { animation-delay: 0.2s; }
