﻿/* =====================================================
   style.css â€” Laboratoire de Gأ©omأ©trie - Symأ©trie Axiale
   Design scientifique, responsive, mobile-first
   ===================================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bleu:        #1565C0;
    --bleu-clair:  #42A5F5;
    --bleu-pale:   #E3F2FD;
    --rouge:       #E53935;
    --rouge-pale:  #FFEBEE;
    --vert:        #2E7D32;
    --vert-clair:  #A5D6A7;
    --vert-pale:   #E8F5E9;
    --gris:        #757575;
    --gris-clair:  #EEEEEE;
    --blanc:       #FFFFFF;
    --noir:        #212121;
    --orange:      #F57C00;
    --violet:      #6A1B9A;
    --shadow:      0 4px 20px rgba(21,101,192,0.15);
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.10);
    --radius:      12px;
    --radius-sm:   8px;
    --transition:  0.3s ease;
    --nav-width:   260px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #F5F7FA;
    color: var(--noir);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Layout Principal ---- */
#app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---- Navigation Latأ©rale ---- */
#sidebar {
    width: var(--nav-width);
    background: linear-gradient(180deg, var(--bleu) 0%, #0D47A1 100%);
    color: var(--blanc);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}

#sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    text-align: center;
}

#sidebar-header .logo {
    font-size: 2rem;
    margin-bottom: 8px;
}

#sidebar-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
    line-height: 1.4;
}

#sidebar-header p {
    font-size: 0.72rem;
    opacity: 0.6;
    margin-top: 4px;
}

#nav-menu { flex: 1; padding: 12px 0; }

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
    padding: 12px 20px 4px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.80);
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.12);
    color: var(--blanc);
    border-left-color: rgba(255,255,255,0.4);
}

.nav-item.active {
    background: rgba(255,255,255,0.18);
    color: var(--blanc);
    border-left-color: var(--bleu-clair);
    font-weight: 600;
}

.nav-item .nav-icon { font-size: 1.1rem; min-width: 20px; text-align: center; }

.nav-badge {
    margin-left: auto;
    background: var(--bleu-clair);
    color: white;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.nav-item.completed .nav-icon::after {
    content: 'âœ“';
    position: absolute;
    right: 16px;
    font-size: 0.75rem;
    color: var(--vert-clair);
}

#sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.72rem;
    opacity: 0.5;
    text-align: center;
}

/* ---- Contenu Principal ---- */
#main-content {
    margin-left: var(--nav-width);
    flex: 1;
    min-height: 100vh;
    padding: 0;
    transition: margin-left var(--transition);
}

/* ---- Topbar ---- */
#topbar {
    background: var(--blanc);
    border-bottom: 2px solid var(--bleu-pale);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

#topbar h1 {
    font-size: 1.1rem;
    color: var(--bleu);
    font-weight: 700;
}

#topbar .topbar-actions { display: flex; gap: 8px; align-items: center; }

#menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--bleu);
    padding: 4px;
}

/* ---- Page Content ---- */
#page-content {
    padding: 28px 32px;
    max-width: 1100px;
}

/* ---- Page d'Accueil ---- */
#home-page {
    animation: fadeIn 0.5s ease;
}

.hero-section {
    background: linear-gradient(135deg, var(--bleu) 0%, #0D47A1 60%, #1A237E 100%);
    color: var(--blanc);
    border-radius: var(--radius);
    padding: 48px 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.hero-text { flex: 1; }
.hero-text .subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.75;
    margin-bottom: 12px;
}
.hero-text h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}
.hero-text p {
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 480px;
}

.hero-svg { flex-shrink: 0; }

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* ---- Boutons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blanc);
    color: var(--bleu);
    border-color: var(--blanc);
}
.btn-primary:hover { background: var(--bleu-pale); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }

.btn-secondary {
    background: transparent;
    color: var(--blanc);
    border-color: rgba(255,255,255,0.5);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: var(--blanc); }

.btn-blue {
    background: var(--bleu);
    color: var(--blanc);
    border-color: var(--bleu);
}
.btn-blue:hover { background: #0D47A1; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(21,101,192,0.4); }

.btn-green {
    background: var(--vert);
    color: var(--blanc);
    border-color: var(--vert);
}
.btn-green:hover { background: #1B5E20; transform: translateY(-2px); }

.btn-red {
    background: var(--rouge);
    color: var(--blanc);
    border-color: var(--rouge);
}
.btn-red:hover { background: #B71C1C; transform: translateY(-2px); }

.btn-outline {
    background: transparent;
    color: var(--bleu);
    border-color: var(--bleu);
}
.btn-outline:hover { background: var(--bleu-pale); }

.btn-orange {
    background: var(--orange);
    color: var(--blanc);
    border-color: var(--orange);
}
.btn-orange:hover { background: #E65100; }

.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- Cartes de Modules ---- */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.module-card {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-color, var(--bleu));
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--card-color, var(--bleu));
}

.module-card .card-icon { font-size: 2.4rem; margin-bottom: 12px; }
.module-card .card-num {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--card-color, var(--bleu));
    margin-bottom: 4px;
}
.module-card h3 { font-size: 1rem; font-weight: 700; color: var(--noir); margin-bottom: 8px; }
.module-card p { font-size: 0.83rem; color: var(--gris); line-height: 1.5; }
.module-card .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}
.card-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--bleu-pale);
    color: var(--bleu);
    font-weight: 600;
}

/* ---- Section Titles ---- */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bleu);
    margin-bottom: 8px;
}
.section-subtitle {
    font-size: 0.9rem;
    color: var(--gris);
    margin-bottom: 24px;
}

/* ---- Module Pages ---- */
.module-page { animation: fadeIn 0.4s ease; }

.module-header {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--bleu);
}

.module-header .mod-icon { font-size: 2rem; }
.module-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--bleu); }
.module-header p { font-size: 0.88rem; color: var(--gris); margin-top: 4px; }

/* ---- Canvas Container ---- */
.canvas-container {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

canvas {
    display: block;
    border-radius: var(--radius-sm);
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
}

canvas.grabbable { cursor: grab; }
canvas.grabbing { cursor: grabbing; }

/* ---- Controls Bar ---- */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: var(--gris-clair);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.controls-bar .label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gris);
    margin-right: 4px;
}

/* ---- Info Panel ---- */
.info-panel {
    background: var(--bleu-pale);
    border-left: 4px solid var(--bleu);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--bleu);
    font-weight: 500;
}

.info-panel.red {
    background: var(--rouge-pale);
    border-left-color: var(--rouge);
    color: var(--rouge);
}

.info-panel.green {
    background: var(--vert-pale);
    border-left-color: var(--vert);
    color: var(--vert);
}

/* ---- Properties Panel ---- */
.properties-panel {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.properties-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bleu);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gris-clair);
    opacity: 0.3;
    transition: opacity 0.6s ease;
}

.property-item.visible { opacity: 1; }

.property-item .prop-icon {
    font-size: 1.3rem;
    min-width: 28px;
    text-align: center;
}

.property-item .prop-text { flex: 1; }
.property-item .prop-name { font-weight: 700; font-size: 0.88rem; color: var(--bleu); }
.property-item .prop-desc { font-size: 0.8rem; color: var(--gris); margin-top: 2px; }
.property-item .prop-measure {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rouge);
    min-width: 100px;
    text-align: right;
}

/* ---- Step Buttons ---- */
.steps-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.step-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 2px solid var(--bleu);
    color: var(--bleu);
    background: transparent;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition);
}

.step-btn:hover, .step-btn.active {
    background: var(--bleu);
    color: var(--blanc);
}

.step-btn.done {
    background: var(--vert);
    border-color: var(--vert);
    color: var(--blanc);
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--gris-clair);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--gris);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab-btn:hover { color: var(--bleu); }
.tab-btn.active { color: var(--bleu); border-bottom-color: var(--bleu); }

/* ---- Math Box ---- */
.math-box {
    background: linear-gradient(135deg, var(--bleu-pale), #BBDEFB);
    border: 2px solid var(--bleu);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 16px 0;
    text-align: center;
}

.math-box .formula {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bleu);
    font-family: 'Times New Roman', serif;
}

.math-box .formula-desc {
    font-size: 0.82rem;
    color: var(--gris);
    margin-top: 6px;
}

/* ---- Propriأ©tأ© Card (Module 4) ---- */
.property-card {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border-top: 4px solid var(--bleu);
    transition: box-shadow var(--transition);
}

.property-card:hover { box-shadow: var(--shadow); }

.property-card .prop-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bleu);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.property-card .prop-enonce {
    font-size: 0.9rem;
    color: var(--noir);
    line-height: 1.6;
    background: var(--bleu-pale);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    border-left: 3px solid var(--bleu);
}

/* ---- Exercices ---- */
.exercise-container {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.exercise-num {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gris);
    margin-bottom: 8px;
}

.exercise-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--noir);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ---- QCM Options ---- */
.qcm-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.qcm-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gris-clair);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.qcm-option:hover { border-color: var(--bleu); background: var(--bleu-pale); }
.qcm-option.selected { border-color: var(--bleu); background: var(--bleu-pale); color: var(--bleu); }
.qcm-option.correct { border-color: var(--vert); background: var(--vert-pale); color: var(--vert); }
.qcm-option.wrong { border-color: var(--rouge); background: var(--rouge-pale); color: var(--rouge); }

.qcm-option .option-letter {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gris-clair);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ---- Feedback ---- */
.feedback {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    display: none;
    animation: slideDown 0.3s ease;
    margin-top: 12px;
}

.feedback.show { display: flex; align-items: center; gap: 10px; }
.feedback.correct { background: var(--vert-pale); color: var(--vert); border: 1px solid var(--vert-clair); }
.feedback.wrong { background: var(--rouge-pale); color: var(--rouge); border: 1px solid #EF9A9A; }

/* ---- Score & Progress ---- */
.score-bar {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.score-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--bleu);
}

.progress-bar-container {
    flex: 1;
    background: var(--gris-clair);
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--bleu), var(--bleu-clair));
    border-radius: 20px;
    transition: width 0.6s ease;
    width: 0%;
}

/* ---- Niveau Badges ---- */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-1 { background: var(--vert-pale); color: var(--vert); }
.level-2 { background: #FFF3E0; color: var(--orange); }
.level-3 { background: var(--rouge-pale); color: var(--rouge); }

/* ---- أ‰valuation ---- */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.quiz-progress {
    font-size: 0.9rem;
    color: var(--gris);
    font-weight: 600;
}

.quiz-timer {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--bleu);
    min-width: 60px;
    text-align: center;
}

.quiz-timer.warning { color: var(--orange); animation: pulse 1s infinite; }
.quiz-timer.danger { color: var(--rouge); }

/* ---- Results ---- */
.results-container {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-weight: 800;
    border: 6px solid;
}

.result-score-circle .score-big { font-size: 2.5rem; line-height: 1; }
.result-score-circle .score-label { font-size: 0.8rem; }

.result-excellent { border-color: var(--vert); color: var(--vert); background: var(--vert-pale); }
.result-bien { border-color: var(--bleu); color: var(--bleu); background: var(--bleu-pale); }
.result-moyen { border-color: var(--orange); color: var(--orange); background: #FFF3E0; }
.result-insuffisant { border-color: var(--rouge); color: var(--rouge); background: var(--rouge-pale); }

.competences-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
    text-align: left;
}

.competence-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.competence-ok { background: var(--vert-pale); color: var(--vert); }
.competence-no { background: var(--rouge-pale); color: var(--rouge); }

/* ---- Module 6 Tools ---- */
.tools-panel {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.tools-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }

.tool-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gris-clair);
    background: var(--blanc);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-btn:hover { border-color: var(--bleu); color: var(--bleu); }
.tool-btn.active { border-color: var(--bleu); background: var(--bleu); color: var(--blanc); }

/* ---- Hints ---- */
.hint-container {
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #5D4037;
    display: none;
}
.hint-container.show { display: block; animation: fadeIn 0.3s ease; }
.hint-title { font-weight: 700; margin-bottom: 4px; }

/* ---- Animation SVG accueil ---- */
#hero-svg { overflow: visible; }

.anim-axis { stroke: var(--rouge); stroke-width: 2.5; stroke-dasharray: 6,4; }
.anim-figure { fill: rgba(21,101,192,0.15); stroke: var(--bleu); stroke-width: 2; }
.anim-mirror { fill: rgba(46,125,50,0.15); stroke: var(--vert); stroke-width: 2; opacity: 0; }
.anim-label { font-family: 'Segoe UI', sans-serif; font-size: 12px; font-weight: 700; }
.anim-dashed { stroke: var(--gris); stroke-dasharray: 4,3; stroke-width: 1.5; fill: none; }

/* ---- Animations Keyframes ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes mirrorReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes drawLine {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* ---- Tooltip ---- */
.tooltip {
    position: absolute;
    background: rgba(33,33,33,0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    pointer-events: none;
    z-index: 200;
    white-space: nowrap;
    display: none;
}

/* ---- Notification ---- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    animation: slideIn 0.3s ease;
    max-width: 320px;
    border-left: 4px solid var(--bleu);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---- Fiche de synthأ¨se ---- */
.synthese-box {
    background: linear-gradient(135deg, #E8EAF6, #EDE7F6);
    border: 2px solid var(--violet);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 20px 0;
}

.synthese-box h3 { color: var(--violet); margin-bottom: 12px; font-size: 1rem; }
.synthese-box ul { padding-left: 20px; }
.synthese-box li { font-size: 0.88rem; line-height: 1.8; color: var(--noir); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    :root { --nav-width: 220px; }
    #page-content { padding: 20px 16px; }
    .hero-section { flex-direction: column; padding: 32px 24px; }
    .hero-svg { display: none; }
    .competences-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #main-content { margin-left: 0; }
    #menu-toggle { display: flex; }
    #page-content { padding: 16px 12px; }
    .modules-grid { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 1.6rem; }
    canvas { width: 100% !important; height: auto !important; }
    .controls-bar { gap: 6px; }
}

/* ---- Overlay pour mobile ---- */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
#sidebar-overlay.show { display: block; }

/* ---- Scrollbar custom ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gris-clair); }
::-webkit-scrollbar-thumb { background: var(--bleu-clair); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bleu); }

/* ---- Print ---- */
@media print {
    #sidebar, #topbar { display: none; }
    #main-content { margin-left: 0; }
}

/* ---- Chip / Tag ---- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bleu-pale);
    color: var(--bleu);
}

/* ---- Divider ---- */
.divider { border: none; border-top: 2px solid var(--gris-clair); margin: 20px 0; }

/* ---- Input Range (slider) ---- */
input[type=range] {
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--gris-clair);
    outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bleu);
    cursor: pointer;
}

/* ---- Toggle switch ---- */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--noir);
}

.toggle-switch input { display: none; }

.toggle-track {
    width: 44px; height: 24px;
    background: var(--gris-clair);
    border-radius: 12px;
    position: relative;
    transition: background var(--transition);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: white;
    border-radius: 50%;
    transition: left var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-track { background: var(--bleu); }
.toggle-switch input:checked + .toggle-track::after { left: 23px; }

/* ---- Foldable ---- */
.foldable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 12px 16px;
    background: var(--bleu-pale);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    font-weight: 600;
    color: var(--bleu);
    transition: background var(--transition);
}
.foldable-header:hover { background: #BBDEFB; }
.foldable-content { display: none; padding: 16px; }
.foldable-content.open { display: block; animation: fadeIn 0.3s ease; }

/* =====================================================
   Landing Page / Accueil : Merveilles & Atouts Pأ©dagogiques
   ===================================================== */
.welcome-badge {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 30px;
    padding: 7px 18px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.welcome-badge .badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00E676;
    box-shadow: 0 0 8px #00E676;
}

.hero-cta-main {
    background: #FFFFFF !important;
    color: #0D47A1 !important;
    border: 2px solid #FFFFFF !important;
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    padding: 16px 28px !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.22) !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.hero-cta-main:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
    background: #E8F0FE !important;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.stat-box {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #EAEAEA;
    transition: transform var(--transition);
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bleu);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gris);
    margin-top: 3px;
    font-weight: 500;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
    margin: 16px 0 36px;
}

.feature-card {
    background: var(--blanc);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid #E5E9F2;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(21,101,192,0.12);
    border-color: var(--bleu-clair);
}

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bleu-pale);
    color: var(--bleu);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.feature-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--noir);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.55;
}

/* Featured Lesson Card */
.lesson-featured-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F5F9FF 100%);
    border-radius: var(--radius);
    border: 2px solid #BBDEFB;
    box-shadow: 0 6px 24px rgba(21,101,192,0.1);
    padding: 32px 36px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
}

.lesson-featured-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 6px; height: 100%;
    background: linear-gradient(180deg, var(--bleu) 0%, var(--vert) 100%);
}

.lesson-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E8F5E9;
    color: #2E7D32;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 12px;
    border: 1px solid #A5D6A7;
}

.lesson-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lesson-title-row h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--bleu);
}

.lesson-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 24px;
}

.lesson-pill {
    background: var(--blanc);
    border: 1px solid #CFD8DC;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    color: #37474F;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.lesson-pill:hover {
    border-color: var(--bleu);
    color: var(--bleu);
    background: var(--bleu-pale);
    transform: translateY(-2px);
}

.pedagogical-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 20px 0 32px;
}

.pedago-step {
    background: var(--blanc);
    border-radius: var(--radius-sm);
    padding: 16px;
    border-left: 4px solid var(--bleu);
    box-shadow: var(--shadow-sm);
}

.pedago-step .p-step-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bleu);
    text-transform: uppercase;
}

.pedago-step .p-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--noir);
    margin: 4px 0 2px;
}

.pedago-step .p-step-desc {
    font-size: 0.8rem;
    color: var(--gris);
}

/* =====================================================
   Styles Spأ©cifiques : Page d'Accueil Autonome & Navigation Cours
   Conأ§u pour l'architecture modulaire Prof. Najib Leknizi
   ===================================================== */
.landing-navbar {
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--bleu);
}

.landing-brand .logo-icon {
    font-size: 2rem;
}

.landing-brand h1 {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--bleu);
    margin: 0;
}

.landing-brand p {
    font-size: 0.78rem;
    color: var(--gris);
    font-weight: 500;
    margin: 0;
}

.landing-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.landing-link {
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.landing-link:hover {
    color: var(--bleu);
    background: var(--bleu-pale);
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

/* Carte Profil Professeur Najib Leknizi */
.teacher-profile-card {
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #E2E8F0;
    border-left: 6px solid var(--bleu);
    display: flex;
    gap: 24px;
    align-items: center;
    margin: 32px 0 20px;
    position: relative;
    overflow: hidden;
}

.teacher-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #0D47A1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(21,101,192,0.25);
}

.teacher-info {
    flex: 1;
}

.teacher-info h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--noir);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-badge {
    background: #E3F2FD;
    color: #1565C0;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.teacher-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

.teacher-quote {
    font-size: 0.93rem;
    line-height: 1.65;
    color: #334155;
    background: #F8FAFC;
    padding: 12px 18px;
    border-radius: 8px;
    border-left: 3px solid #94A3B8;
    margin: 0;
}

/* Grille des Grands Cours sur l'Accueil */
.course-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 28px;
    margin: 24px 0 36px;
}

.course-card-big {
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    border: 2px solid transparent;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.course-card-big:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.course-card-big.ch1 {
    border-color: #BBDEFB;
}
.course-card-big.ch1:hover {
    border-color: #1565C0;
}

.course-card-big.ch2 {
    border-color: #B2DFDB;
}
.course-card-big.ch2:hover {
    border-color: #00897B;
}

.course-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.course-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.course-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--noir);
}

.course-card-desc {
    font-size: 0.88rem;
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 20px;
}

.course-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.course-meta-tag {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.btn-open-course {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

/* Bouton Retour Accueil pour les pages de cours */
.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    color: #1E293B;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all var(--transition);
}

.btn-back-home:hover {
    background: var(--bleu);
    color: #FFFFFF;
    border-color: var(--bleu);
    transform: translateX(-2px);
}

/* =====================================================
   PORTAIL MODERNE AVEC FOND Gأ‰OMأ‰TRIQUE ANIMأ‰
   Design Studio High-Tech â€¢ Prof. Najib Leknizi
   ===================================================== */
#geo-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1 !important;
    pointer-events: none;
    background: radial-gradient(circle at 20% 30%, #0F172A 0%, #0B1120 70%, #020617 100%);
}

.portal-body {
    background: #0B1120;
    color: #F8FAFC;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.portal-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(11, 17, 32, 0.80);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.portal-logo-glow {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284C7, #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.portal-brand h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #FFFFFF;
    margin: 0;
}

.portal-brand p {
    font-size: 0.76rem;
    color: #94A3B8;
    margin: 2px 0 0;
    font-weight: 500;
}

.portal-teacher-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #E2E8F0;
    backdrop-filter: blur(10px);
}

/* Grille principale en 2 colonnes (Prأ©sentation أ  gauche, Boutons des cours dans le volet latأ©ral أ  droite) */
.portal-main-grid {
    position: relative;
    z-index: 10;
    max-width: 1380px;
    margin: 0 auto;
    padding: 36px 32px 60px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
    align-items: start;
}

@media (max-width: 1024px) {
    .portal-main-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Colonne Gauche : Prأ©sentation & Vision */
.portal-left-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.1);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    width: fit-content;
}

.portal-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38BDF8;
    box-shadow: 0 0 10px #38BDF8;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.portal-hero-title {
    font-size: 2.45rem;
    font-weight: 800;
    line-height: 1.2;
    color: #FFFFFF;
    letter-spacing: -0.8px;
    margin: 0;
}

.portal-gradient-text {
    background: linear-gradient(135deg, #38BDF8 0%, #818CF8 50%, #34D399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-hero-desc {
    font-size: 1.02rem;
    color: #CBD5E1;
    line-height: 1.7;
    margin: 0;
}

/* Carte Professeur Najib Leknizi */
.portal-teacher-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 24px 26px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.portal-teacher-avatar {
    width: 66px;
    height: 66px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1E293B, #334155);
    border: 2px solid rgba(56, 189, 248, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.portal-teacher-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-teacher-badge-ar {
    background: rgba(56, 189, 248, 0.15);
    color: #7DD3FC;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.portal-teacher-sub {
    font-size: 0.85rem;
    color: #94A3B8;
    margin-bottom: 12px;
    font-weight: 500;
}

.portal-teacher-quote {
    font-size: 0.92rem;
    color: #E2E8F0;
    line-height: 1.65;
    background: rgba(2, 6, 23, 0.45);
    border-left: 3px solid #38BDF8;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0;
    font-style: italic;
}

/* 3 Cartouches d'atouts */
.portal-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.portal-pillar-item {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    backdrop-filter: blur(14px);
    transition: all 0.3s ease;
}

.portal-pillar-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
}

.portal-pillar-item .icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.portal-pillar-item .title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #F8FAFC;
    margin-bottom: 4px;
}

.portal-pillar-item .desc {
    font-size: 0.78rem;
    color: #94A3B8;
    line-height: 1.5;
}

/* =====================================================
   COLONNE DROITE : LE VOLET LATأ‰RAL DES BOUTONS DE COURS
   آ« ط§ط²ط±ط§ط± ط§ظ„ط¯ط±ظˆط³ ظپظٹ ط§ظ„ط¬ط§ظ†ط¨ ظˆط¨ط·ط±ظٹظ‚ط© ط§ط­طھط±ط§ظپظٹط© آ»
   ===================================================== */
.portal-side-panel {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 26px 22px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.portal-side-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.portal-side-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
}

.portal-side-header p {
    font-size: 0.82rem;
    color: #94A3B8;
    margin: 0;
}

/* Carte Latأ©rale de Cours (Bouton Grande Classe) */
.portal-course-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 22px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.portal-course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.portal-course-card.ch1::before {
    background: linear-gradient(180deg, #38BDF8 0%, #2563EB 100%);
}

.portal-course-card.ch2::before {
    background: linear-gradient(180deg, #34D399 0%, #059669 100%);
}

.portal-course-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.portal-course-card.ch1:hover {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 12px 32px rgba(56, 189, 248, 0.18);
}

.portal-course-card.ch2:hover {
    border-color: rgba(52, 211, 153, 0.45);
    box-shadow: 0 12px 32px rgba(52, 211, 153, 0.18);
}

.portal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.portal-card-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

.portal-course-card.ch1 .portal-card-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.portal-course-card.ch2 .portal-card-badge {
    background: rgba(52, 211, 153, 0.15);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.portal-card-h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 4px;
}

.portal-card-ar {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.portal-course-card.ch1 .portal-card-ar { color: #7DD3FC; }
.portal-course-card.ch2 .portal-card-ar { color: #6EE7B7; }

.portal-card-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    font-size: 0.82rem;
    color: #CBD5E1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-card-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-card-list li::before {
    content: 'â€¢';
    color: #94A3B8;
    font-size: 1.2rem;
    line-height: 0;
}

.portal-course-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.portal-course-btn.ch1 {
    background: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
    color: #FFFFFF;
}

.portal-course-btn.ch1:hover {
    background: linear-gradient(135deg, #0369A1 0%, #1D4ED8 100%);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
    transform: translateY(-2px);
}

.portal-course-btn.ch2 {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF;
}

.portal-course-btn.ch2:hover {
    background: linear-gradient(135deg, #047857 0%, #065F46 100%);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.45);
    transform: translateY(-2px);
}

/* =====================================================
   Sأ‰LECTEUR DE THأˆMES (WIDGET DE PERSONNALISATION)
   ===================================================== */
.theme-switcher-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #F8FAFC;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.theme-btn-icon { font-size: 1.05rem; }
.theme-btn-label { letter-spacing: 0.2px; }
.theme-btn-arrow { font-size: 0.75rem; opacity: 0.7; }

/* Menu dأ©roulant Popover */
.theme-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(28px);
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1050;
    animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dropdown-menu.show {
    display: flex;
}

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

.theme-menu-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.theme-menu-header h4 {
    font-size: 0.92rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 2px;
}

.theme-menu-header p {
    font-size: 0.75rem;
    color: #94A3B8;
    margin: 0;
}

.theme-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
}

.theme-option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option-item:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(56, 189, 248, 0.3);
}

.theme-option-item.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.45);
}

.theme-option-item .t-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-top: 2px;
}

.theme-option-item .t-details {
    flex: 1;
}

.theme-option-item .t-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.theme-option-item .t-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #94A3B8;
}

.theme-option-item .t-badge.main {
    background: rgba(56, 189, 248, 0.2);
    color: #38BDF8;
}

.theme-option-item .t-name-ar {
    font-size: 0.76rem;
    color: #7DD3FC;
    font-weight: 600;
    margin-top: 1px;
}

.theme-option-item .t-desc {
    font-size: 0.72rem;
    color: #94A3B8;
    line-height: 1.35;
    margin-top: 3px;
}

.theme-option-item .t-check {
    font-size: 0.85rem;
    color: #38BDF8;
    font-weight: bold;
    display: none;
}

.theme-option-item.active .t-check {
    display: block;
}

/* =====================================================
   RأˆGLES D'ADAPTATION PAR THأˆME POUR TOUTES LES PAGES
   ===================================================== */

/* --- THأˆME 2 : BLANC CLASSIQUE أ‰PURأ‰ (ط®ظ„ظپظٹط© ط¹ط§ط¯ظٹط© ط¨ظٹط¶ط§ط،) --- */
[data-theme="white"] body,
[data-theme="white"] .portal-body,
[data-theme="white"] #app-container {
    background: #F8FAFC !important;
    color: #1E293B !important;
}

[data-theme="white"] .portal-navbar,
[data-theme="white"] #topbar {
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
}

[data-theme="white"] .portal-brand h1,
[data-theme="white"] #topbar-title {
    color: #0F172A !important;
}

[data-theme="white"] .portal-hero-title {
    color: #0F172A !important;
}

[data-theme="white"] .portal-hero-desc {
    color: #475569 !important;
}

[data-theme="white"] .portal-teacher-pill {
    background: #F1F5F9 !important;
    border-color: #E2E8F0 !important;
    color: #334155 !important;
}

[data-theme="white"] .portal-teacher-card {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06) !important;
}

[data-theme="white"] .portal-teacher-header h3 {
    color: #0F172A !important;
}

[data-theme="white"] .portal-teacher-quote {
    background: #F8FAFC !important;
    color: #334155 !important;
    border-left-color: #1565C0 !important;
}

[data-theme="white"] .portal-side-panel {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06) !important;
}

[data-theme="white"] .portal-side-header h2 {
    color: #0F172A !important;
}

[data-theme="white"] .portal-course-card {
    background: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

[data-theme="white"] .portal-card-h3 {
    color: #0F172A !important;
}

[data-theme="white"] .portal-card-list {
    color: #475569 !important;
}

[data-theme="white"] .portal-pillar-item {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04) !important;
}

[data-theme="white"] .portal-pillar-item .title {
    color: #0F172A !important;
}

[data-theme="white"] .theme-toggle-btn {
    background: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

/* Sidebar en mode blanc */
[data-theme="white"] #sidebar {
    background: linear-gradient(180deg, #1565C0 0%, #0D47A1 100%) !important;
    color: #FFFFFF !important;
}

/* Header de module en mode blanc */
[data-theme="white"] .module-header {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    color: #0F172A !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

[data-theme="white"] .module-header h2 {
    color: #1565C0 !important;
}

/* --- THأˆMES 1, 3, 4, 5 : PAGES DE COURS EN MODE GLASSMORPHIC (STELLAR, GRID, AURORA, OCEAN) --- */
body:not([data-theme="white"]) #app-container {
    background: transparent !important;
}

body:not([data-theme="white"]) #main-content {
    background: transparent !important;
}

body:not([data-theme="white"]) #sidebar {
    background: rgba(15, 23, 42, 0.88) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4) !important;
}

body:not([data-theme="white"]) #topbar {
    background: rgba(15, 23, 42, 0.80) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    color: #FFFFFF !important;
}

body:not([data-theme="white"]) #topbar-title {
    color: #FFFFFF !important;
}

body:not([data-theme="white"]) .btn-back-home {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #F8FAFC !important;
}

body:not([data-theme="white"]) .btn-back-home:hover {
    background: #0284C7 !important;
    color: #FFFFFF !important;
    border-color: #0284C7 !important;
}

body:not([data-theme="white"]) .module-header {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

body:not([data-theme="white"]) .module-header h2 {
    color: #38BDF8 !important;
}

body:not([data-theme="white"]) .module-header p {
    color: #94A3B8 !important;
}

body:not([data-theme="white"]) .canvas-container {
    background: rgba(15, 23, 42, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

body:not([data-theme="white"]) .controls-bar {
    background: rgba(2, 6, 23, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #F8FAFC !important;
}

body:not([data-theme="white"]) .properties-panel,
body:not([data-theme="white"]) .synthese-box {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    color: #E2E8F0 !important;
}

/* =====================================================
   PROFIL PROFESSIONNEL OFFICIEL â€” NAJIB LEKNIZI
   ===================================================== */
.nl-profile-card {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 28px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nl-profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 18px;
}

.nl-avatar-box {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(135deg, #0284C7 0%, #2563EB 50%, #4F46E5 100%);
    box-shadow: 0 0 26px rgba(56, 189, 248, 0.45);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nl-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 17px;
    display: block;
}

.nl-pill-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #38BDF8;
}

.nl-mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.nl-name-title {
    flex: 1;
}

.nl-name {
    font-size: 1.55rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nl-badge-ar {
    background: rgba(56, 189, 248, 0.15);
    color: #7DD3FC;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.nl-headline {
    font-size: 0.95rem;
    font-weight: 600;
    color: #38BDF8;
    margin: 0 0 6px;
}

.nl-meta-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nl-meta-tag {
    background: rgba(255, 255, 255, 0.06);
    color: #94A3B8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nl-bio-lead {
    font-size: 0.94rem;
    color: #E2E8F0;
    line-height: 1.7;
    margin: 0;
}

/* 4 Domaines d'Expertise */
.nl-expertise-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nl-subheading {
    font-size: 0.98rem;
    font-weight: 800;
    color: #F8FAFC;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nl-expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.nl-expertise-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.25s ease;
}

.nl-expertise-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
}

.nl-exp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.nl-exp-header .exp-icon {
    font-size: 1.15rem;
}

.nl-exp-desc {
    font-size: 0.8rem;
    color: #94A3B8;
    line-height: 1.5;
    margin: 0;
}

/* Projet Phare : NL Sciences & Technologies */
.nl-flagship-card {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 14px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

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

.nl-flagship-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nl-flagship-badge {
    background: #0284C7;
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

.nl-flagship-desc {
    font-size: 0.85rem;
    color: #CBD5E1;
    line-height: 1.6;
    margin: 0;
}

/* Vision & Devise */
.nl-vision-card {
    background: rgba(2, 6, 23, 0.5);
    border-left: 4px solid #38BDF8;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nl-vision-text {
    font-size: 0.88rem;
    color: #E2E8F0;
    line-height: 1.65;
    margin: 0;
}

.nl-motto {
    font-size: 0.95rem;
    font-weight: 700;
    color: #7DD3FC;
    font-style: italic;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    padding-top: 8px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Adaptation pour Mode Blanc [data-theme="white"] */
[data-theme="white"] .nl-profile-card {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="white"] .nl-name {
    color: #0F172A !important;
}

[data-theme="white"] .nl-headline {
    color: #1565C0 !important;
}

[data-theme="white"] .nl-bio-lead {
    color: #334155 !important;
}

[data-theme="white"] .nl-subheading {
    color: #0F172A !important;
}

[data-theme="white"] .nl-expertise-card {
    background: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

[data-theme="white"] .nl-exp-header {
    color: #0F172A !important;
}

[data-theme="white"] .nl-exp-desc {
    color: #475569 !important;
}

[data-theme="white"] .nl-flagship-card {
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
}

[data-theme="white"] .nl-flagship-title {
    color: #1E3A8A !important;
}

[data-theme="white"] .nl-flagship-desc {
    color: #334155 !important;
}

[data-theme="white"] .nl-vision-card {
    background: #F8FAFC !important;
    border-left-color: #1565C0 !important;
}

[data-theme="white"] .nl-vision-text {
    color: #334155 !important;
}

[data-theme="white"] .nl-motto {
    color: #1565C0 !important;
    border-top-color: #E2E8F0 !important;
}

/* =====================================================
   BOUTON ET MENU DES PLATEFORMES NL TECHSCIENCE
   ===================================================== */
.nl-platforms-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.nl-platforms-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
    position: relative;
}

.nl-platforms-btn:hover {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.4) 0%, rgba(99, 102, 241, 0.4) 100%);
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
}

.nl-platforms-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(28px);
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1050;
    animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nl-platforms-dropdown.show {
    display: flex;
}

.nl-platforms-dropdown .dropdown-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.nl-platforms-dropdown .dropdown-header h4 {
    font-size: 0.92rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 3px;
}

.nl-platforms-dropdown .dropdown-header p {
    font-size: 0.74rem;
    color: #94A3B8;
    margin: 0;
}

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

.platform-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: all 0.25s ease;
}

.platform-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(4px);
}

.platform-item .item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.platform-item .item-content {
    flex: 1;
}

.platform-item .item-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
}

.platform-item .item-url {
    font-size: 0.72rem;
    color: #38BDF8;
    font-family: monospace;
    margin-top: 1px;
}

.platform-item .item-desc {
    font-size: 0.73rem;
    color: #94A3B8;
    line-height: 1.35;
    margin-top: 3px;
}

.platform-item .item-arrow {
    color: #64748B;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.platform-item:hover .item-arrow {
    color: #38BDF8;
    transform: translate(2px, -2px);
}

/* Boutons de redirection dans la carte projet phare */
.nl-flagship-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.nl-platform-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #F8FAFC;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

.nl-platform-link-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.nl-platform-link-btn.primary {
    background: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
    border-color: transparent;
    color: #FFFFFF;
}

.nl-platform-link-btn.primary:hover {
    background: linear-gradient(135deg, #0369A1 0%, #1D4ED8 100%);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
}

.nl-platform-link-btn .link-ext {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Adaptations mode blanc */
[data-theme="white"] .nl-platforms-btn {
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
    color: #1E3A8A !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

[data-theme="white"] .nl-platforms-dropdown {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12) !important;
}

[data-theme="white"] .nl-platforms-dropdown .dropdown-header h4 {
    color: #0F172A !important;
}

[data-theme="white"] .platform-item {
    background: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

[data-theme="white"] .platform-item:hover {
    background: #EFF6FF !important;
    border-color: #93C5FD !important;
}

[data-theme="white"] .platform-item .item-title {
    color: #0F172A !important;
}

[data-theme="white"] .nl-platform-link-btn {
    background: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
}

[data-theme="white"] .nl-platform-link-btn:hover {
    background: #EFF6FF !important;
    border-color: #93C5FD !important;
    color: #1E40AF !important;
}




/* ============================================================

/* ================================================================
   THEME ENGINE — DARK MODES (stellar, grid, aurora, ocean)
   ALL selectors target body:not([data-theme="white"])
   These rules fix every module in Chapitre 1 & Chapitre 2
   ================================================================ */

/* ── 1. BASE CONTAINERS ── */
body:not([data-theme="white"]) .module-page {
    color: #E2E8F0;
}

body:not([data-theme="white"]) .module-header {
    background: rgba(15,23,42,0.65) !important;
    border-left-color: #38BDF8 !important;
}
body:not([data-theme="white"]) .module-header h2 { color: #F0F9FF !important; }
body:not([data-theme="white"]) .module-header p  { color: #94A3B8 !important; }

/* ── 2. CANVAS CONTAINER ── */
body:not([data-theme="white"]) .canvas-container {
    background: rgba(15,23,42,0.70) !important;
    border-color: rgba(255,255,255,0.10) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.40) !important;
}

/* ── 3. PROPERTIES PANEL (Progression / Fiche) ── */
body:not([data-theme="white"]) .properties-panel {
    background: rgba(15,23,42,0.88) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.40) !important;
    color: #E2E8F0 !important;
}
body:not([data-theme="white"]) .properties-panel h3 {
    color: #38BDF8 !important;
    border-bottom-color: rgba(56,189,248,0.25) !important;
}
body:not([data-theme="white"]) .properties-panel h4 { color: #38BDF8 !important; }
body:not([data-theme="white"]) .properties-panel p,
body:not([data-theme="white"]) .properties-panel li,
body:not([data-theme="white"]) .properties-panel ul,
body:not([data-theme="white"]) .properties-panel span:not([style*="background"]) {
    color: #CBD5E1 !important;
}

/* ── 4. TUTORIAL BOX (m1-box-m1 / m1-box-m2) ── */
body:not([data-theme="white"]) [id^="m1-box-"] {
    background: rgba(15,23,42,0.88) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.40) !important;
}
body:not([data-theme="white"]) [id^="m1-desc-"] { color: #E2E8F0 !important; }
body:not([data-theme="white"]) [id^="m1-title-"]{ color: #38BDF8 !important; }
body:not([data-theme="white"]) [id^="m1-num-"]  { color: #94A3B8 !important; }
body:not([data-theme="white"]) #m1-dist-label   { color: #94A3B8 !important; }

/* ── 5. TABS BAR (Module 1) ── */
body:not([data-theme="white"]) .m1-tabs-bar {
    border-bottom-color: rgba(255,255,255,0.12) !important;
}
body:not([data-theme="white"]) .m1-tab-btn:not(.active) {
    background: rgba(255,255,255,0.08) !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
}
body:not([data-theme="white"]) .m1-tab-btn.active {
    background: linear-gradient(135deg,#1E40AF,#0284C7) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(56,189,248,0.4) !important;
}

/* ── 6. PROPERTY ITEMS (Progression steps) ── */
body:not([data-theme="white"]) .property-item { color: #CBD5E1 !important; }
body:not([data-theme="white"]) .property-item div,
body:not([data-theme="white"]) .property-item span,
body:not([data-theme="white"]) .property-item p  { color: inherit !important; }

/* ── 7. CONTROLS BAR ── */
body:not([data-theme="white"]) .controls-bar {
    background: rgba(15,23,42,0.60) !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #E2E8F0 !important;
}
body:not([data-theme="white"]) .controls-bar label,
body:not([data-theme="white"]) .controls-bar span { color: #CBD5E1 !important; }

/* ── 8. INFO DYNAMIC BOX (c2-m1-info, m1-info) ── */
body:not([data-theme="white"]) [id$="-info"],
body:not([data-theme="white"]) .info-panel {
    background: rgba(21,101,192,0.18) !important;
    color: #BAE6FD !important;
    border-color: rgba(56,189,248,0.25) !important;
}

/* ── 9. MATH BOX ── */
body:not([data-theme="white"]) .math-box {
    background: rgba(21,101,192,0.18) !important;
    border-color: rgba(56,189,248,0.30) !important;
}
body:not([data-theme="white"]) .math-box .formula      { color: #38BDF8 !important; }
body:not([data-theme="white"]) .math-box .formula-desc { color: #94A3B8 !important; }
body:not([data-theme="white"]) .math-box > div         { color: #CBD5E1 !important; }
body:not([data-theme="white"]) .math-box p,
body:not([data-theme="white"]) .math-box ul,
body:not([data-theme="white"]) .math-box li            { color: #CBD5E1 !important; }

/* ── 10. INLINE LIGHT BACKGROUND divs → DARK GLASS ── */
/* White / near-white containers */
body:not([data-theme="white"]) div[style*="background:white"]:not(canvas),
body:not([data-theme="white"]) div[style*="background: white"]:not(canvas),
body:not([data-theme="white"]) div[style*="background:#FFFFFF"]:not(canvas),
body:not([data-theme="white"]) div[style*="background: #FFFFFF"]:not(canvas),
body:not([data-theme="white"]) div[style*="background:#FFF;"]:not(canvas),
body:not([data-theme="white"]) div[style*="background: #FFF;"]:not(canvas),
body:not([data-theme="white"]) div[style*="background:#FAFAFA"]:not(canvas),
body:not([data-theme="white"]) div[style*="background: #FAFAFA"]:not(canvas),
body:not([data-theme="white"]) div[style*="background:#FCFDFE"]:not(canvas),
body:not([data-theme="white"]) div[style*="background:#F5F7FA"]:not(canvas),
body:not([data-theme="white"]) div[style*="background: #F5F7FA"]:not(canvas) {
    background: rgba(15,23,42,0.80) !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #E2E8F0 !important;
}

/* Blue-tinted light boxes (E8F0FE, E3F2FD, E8F5E9...) */
body:not([data-theme="white"]) div[style*="background:#E8F0FE"],
body:not([data-theme="white"]) div[style*="background:#E3F2FD"],
body:not([data-theme="white"]) div[style*="background: #E3F2FD"],
body:not([data-theme="white"]) div[style*="background:#EEF2FF"] {
    background: rgba(56,189,248,0.10) !important;
    border-color: rgba(56,189,248,0.25) !important;
    color: #BAE6FD !important;
}

/* Green boxes */
body:not([data-theme="white"]) div[style*="background:#E8F5E9"],
body:not([data-theme="white"]) div[style*="background:#C8E6C9"],
body:not([data-theme="white"]) div[style*="background:#F1F8E9"] {
    background: rgba(34,197,94,0.11) !important;
    border-color: rgba(34,197,94,0.28) !important;
    color: #86EFAC !important;
}
body:not([data-theme="white"]) div[style*="background:#E8F5E9"] *,
body:not([data-theme="white"]) div[style*="background:#C8E6C9"] * {
    color: #86EFAC !important;
}

/* Yellow boxes */
body:not([data-theme="white"]) div[style*="background:#FFF9C4"],
body:not([data-theme="white"]) div[style*="background:#FFFDE7"],
body:not([data-theme="white"]) div[style*="background:#FFF3E0"],
body:not([data-theme="white"]) div[style*="background:#FFF8E1"] {
    background: rgba(245,158,11,0.13) !important;
    border-color: rgba(245,158,11,0.30) !important;
    color: #FDE68A !important;
}
body:not([data-theme="white"]) div[style*="background:#FFF9C4"] *,
body:not([data-theme="white"]) div[style*="background:#FFFDE7"] *,
body:not([data-theme="white"]) div[style*="background:#FFF3E0"] * { color: #FDE68A !important; }

/* Red/pink boxes */
body:not([data-theme="white"]) div[style*="background:#FFEBEE"],
body:not([data-theme="white"]) div[style*="background:#FCE4EC"] {
    background: rgba(239,68,68,0.12) !important;
    border-color: rgba(239,68,68,0.28) !important;
    color: #FCA5A5 !important;
}
body:not([data-theme="white"]) div[style*="background:#FFEBEE"] *,
body:not([data-theme="white"]) div[style*="background:#FCE4EC"] * { color: #FCA5A5 !important; }

/* Purple/violet boxes */
body:not([data-theme="white"]) div[style*="background:#EDE7F6"],
body:not([data-theme="white"]) div[style*="background:#F3E5F5"],
body:not([data-theme="white"]) div[style*="background:#D1C4E9"] {
    background: rgba(139,92,246,0.13) !important;
    border-color: rgba(139,92,246,0.28) !important;
    color: #DDD6FE !important;
}
body:not([data-theme="white"]) div[style*="background:#EDE7F6"] *,
body:not([data-theme="white"]) div[style*="background:#F3E5F5"] * { color: #DDD6FE !important; }

/* Orange boxes */
body:not([data-theme="white"]) div[style*="background:#FFF3E0"],
body:not([data-theme="white"]) div[style*="background:#FBE9E7"] {
    background: rgba(249,115,22,0.12) !important;
    border-color: rgba(249,115,22,0.28) !important;
    color: #FED7AA !important;
}

/* ── 11. INLINE DARK TEXT OVERRIDES ── */
body:not([data-theme="white"]) [style*="color:#1B5E20"] { color: #86EFAC !important; }
body:not([data-theme="white"]) [style*="color:#2E7D32"] { color: #4ADE80 !important; }
body:not([data-theme="white"]) [style*="color:#C62828"] { color: #FCA5A5 !important; }
body:not([data-theme="white"]) [style*="color:#B71C1C"] { color: #FCA5A5 !important; }
body:not([data-theme="white"]) [style*="color:#E65100"] { color: #FED7AA !important; }
body:not([data-theme="white"]) [style*="color:#5D4037"] { color: #FDE68A !important; }
body:not([data-theme="white"]) [style*="color:#F57F17"] { color: #FDE68A !important; }
body:not([data-theme="white"]) [style*="color:#444"]    { color: #CBD5E1 !important; }
body:not([data-theme="white"]) [style*="color:#555"]    { color: #94A3B8 !important; }
body:not([data-theme="white"]) [style*="color:#666"]    { color: #94A3B8 !important; }
body:not([data-theme="white"]) [style*="color:#333"]    { color: #E2E8F0 !important; }
body:not([data-theme="white"]) [style*="color:inherit"] { color: #E2E8F0 !important; }
body:not([data-theme="white"]) [style*="color:#1565C0"] { color: #38BDF8 !important; }
body:not([data-theme="white"]) [style*="color:#0288D1"] { color: #38BDF8 !important; }
body:not([data-theme="white"]) [style*="color:#1E40AF"] { color: #60A5FA !important; }

/* ul/li inside light containers */
body:not([data-theme="white"]) div[style*="background:#F5F7FA"] ul li,
body:not([data-theme="white"]) div[style*="background:#F5F7FA"] span,
body:not([data-theme="white"]) div[style*="background:#F5F7FA"] div { color: #CBD5E1 !important; }

/* ── 12. CANVAS ELEMENT ── */
body:not([data-theme="white"]) canvas[style*="background:#FCFDFE"],
body:not([data-theme="white"]) canvas[style*="background:white"],
body:not([data-theme="white"]) canvas[style*="background: white"],
body:not([data-theme="white"]) canvas[style*="background:#FFFFFF"] {
    background: rgba(248,250,252,0.96) !important;
    border-color: rgba(255,255,255,0.15) !important;
}

/* ── 13. BUTTONS with light backgrounds ── */
body:not([data-theme="white"]) button[style*="background:#E3F2FD"],
body:not([data-theme="white"]) button[style*="background:#EDE7F6"],
body:not([data-theme="white"]) button[style*="background:#E8F0FE"] {
    background: rgba(56,189,248,0.12) !important;
    color: #38BDF8 !important;
    border: 1px solid rgba(56,189,248,0.25) !important;
}
body:not([data-theme="white"]) button[style*="background:#FFF3E0"],
body:not([data-theme="white"]) button[style*="background:#FFEBEE"] {
    background: rgba(249,115,22,0.12) !important;
    color: #FED7AA !important;
    border: 1px solid rgba(249,115,22,0.25) !important;
}

/* ── 14. WHITE THEME — explicit restore ── */
[data-theme="white"] .canvas-container {
    background: #FFFFFF !important;
    border: 1px solid #E0E0E0 !important;
}
[data-theme="white"] .properties-panel {
    background: #FFFFFF !important;
    color: #0F172A !important;
    border: 1px solid #E2E8F0 !important;
}
[data-theme="white"] .properties-panel h3 {
    color: #1565C0 !important;
    border-bottom-color: #E3F2FD !important;
}
[data-theme="white"] .m1-tab-btn:not(.active) {
    background: #E8F0FE !important;
    color: #1565C0 !important;
}
[data-theme="white"] .m1-tab-btn.active {
    background: #1565C0 !important;
    color: #FFFFFF !important;
}
[data-theme="white"] .controls-bar { color: #0F172A !important; }
[data-theme="white"] .controls-bar label,
[data-theme="white"] .controls-bar span { color: #0F172A !important; }


/* ================================================================
   MODULE 1 — NEW CSS CLASSES (replace inline styles)
   ================================================================ */

/* Tutorial card (boîte d'explication) */
.m1-tuto-card {
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    background: #FFFFFF;
    transition: background 0.3s, border-color 0.3s;
}
body:not([data-theme="white"]) .m1-tuto-card {
    background: rgba(15,23,42,0.88) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45) !important;
}

/* Step number label */
.m1-step-num { color: #757575; font-size: 13px; font-weight: 600; }
body:not([data-theme="white"]) .m1-step-num { color: #94A3B8 !important; }

/* Method label */
.m1-method-label { font-size: 12px; color: #0288D1; font-weight: 700; }
body:not([data-theme="white"]) .m1-method-label { color: #38BDF8 !important; }

/* Tool badge */
.m1-tool-badge {
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
    color: white; background: #0288D1;
}

/* Step title & description */
.m1-step-title { font-size: 16px; font-weight: 700; color: #1565C0; margin-bottom: 6px; }
.m1-step-desc  { font-size: 14px; line-height: 1.6; color: #333333; }
body:not([data-theme="white"]) .m1-step-title { color: #38BDF8 !important; }
body:not([data-theme="white"]) .m1-step-desc  { color: #E2E8F0 !important; }

/* Geo canvas */
.geo-canvas {
    background: #FAFAFA;
    border: 1px solid #DDD;
    border-radius: 8px;
    display: block;
    max-width: 100%;
}
body:not([data-theme="white"]) .geo-canvas {
    background: rgba(248,250,252,0.96) !important;
    border-color: rgba(255,255,255,0.15) !important;
}

/* Controls row */
.m1-controls-row {
    display: flex; gap: 10px; margin-top: 14px;
    align-items: center; flex-wrap: wrap;
    padding: 12px 16px; border-radius: 8px;
    background: #F8FAFC;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
body:not([data-theme="white"]) .m1-controls-row {
    background: rgba(15,23,42,0.70) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Pills row */
.m1-pills-row { display: flex; gap: 8px; flex: 1; justify-content: center; align-items: center; }

/* Step pills */
.m1-step-pill, .m1-step-pill2 {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: #E0E0E0; color: #555555;
    font-weight: 700; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.m1-step-pill.m1-pill-active, .m1-step-pill2.m1-pill-active {
    background: #1565C0; color: white; transform: scale(1.15);
}
body:not([data-theme="white"]) .m1-step-pill:not(.m1-pill-active),
body:not([data-theme="white"]) .m1-step-pill2:not(.m1-pill-active) {
    background: rgba(255,255,255,0.12) !important;
    color: #CBD5E1 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
}

/* Replay button */
.btn-replay {
    background: #EDE7F6; color: #512DA8; border: none; font-weight: 600;
    padding: 8px 14px;
}
body:not([data-theme="white"]) .btn-replay {
    background: rgba(139,92,246,0.18) !important;
    color: #DDD6FE !important;
    border: 1px solid rgba(139,92,246,0.30) !important;
}

/* Panel title */
.panel-title {
    font-size: 15px; color: #1565C0;
    margin-bottom: 14px; padding-bottom: 8px;
    border-bottom: 2px solid #E3F2FD;
}
body:not([data-theme="white"]) .panel-title {
    color: #38BDF8 !important;
    border-bottom-color: rgba(56,189,248,0.25) !important;
}

/* Step num badge */
.step-num-badge {
    width: 24px; height: 24px; border-radius: 50%; color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px; flex-shrink: 0;
}

/* Step text */
.step-text { font-size: 12px; line-height: 1.4; }
.step-label { display: block; font-weight: 700; }
.step-tool  { opacity: 0.8; }
body:not([data-theme="white"]) .step-text  { color: #CBD5E1 !important; }
body:not([data-theme="white"]) .step-label { color: inherit !important; }
body:not([data-theme="white"]) .step-tool  { color: #94A3B8 !important; }

/* ── Hint boxes ── */
.hint-box {
    border-radius: 8px; padding: 12px 14px;
    margin-top: 12px; border: 1px solid;
}
.hint-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.hint-body  { font-size: 12px; line-height: 1.5; margin: 0; }
.hint-body ul { margin: 6px 0 0 16px; padding: 0; }

.hint-green { background: #E8F5E9; border-color: #A5D6A7; }
.hint-green .hint-title { color: #2E7D32; }
.hint-green .hint-body  { color: #1B5E20; }

.hint-yellow { background: #FFF9C4; border-color: #FFF176; }
.hint-yellow .hint-title { color: #F57F17; }
.hint-yellow .hint-body  { color: #5D4037; }

.hint-purple { background: #EDE7F6; border-color: #D1C4E9; }
.hint-purple .hint-title { color: #512DA8; }
.hint-purple .hint-body  { color: #311B92; }

/* Dark mode hint boxes */
body:not([data-theme="white"]) .hint-green {
    background: rgba(34,197,94,0.12) !important;
    border-color: rgba(34,197,94,0.28) !important;
}
body:not([data-theme="white"]) .hint-green .hint-title { color: #4ADE80 !important; }
body:not([data-theme="white"]) .hint-green .hint-body  { color: #86EFAC !important; }

body:not([data-theme="white"]) .hint-yellow {
    background: rgba(245,158,11,0.13) !important;
    border-color: rgba(245,158,11,0.30) !important;
}
body:not([data-theme="white"]) .hint-yellow .hint-title { color: #FCD34D !important; }
body:not([data-theme="white"]) .hint-yellow .hint-body  { color: #FDE68A !important; }

body:not([data-theme="white"]) .hint-purple {
    background: rgba(139,92,246,0.13) !important;
    border-color: rgba(139,92,246,0.28) !important;
}
body:not([data-theme="white"]) .hint-purple .hint-title { color: #A78BFA !important; }
body:not([data-theme="white"]) .hint-purple .hint-body  { color: #DDD6FE !important; }

/* Info panel */
.info-panel {
    margin-top: 10px; font-size: 13px;
    padding: 10px 14px; border-radius: 8px;
    background: #E3F2FD; color: #0D47A1;
    font-weight: 600;
}
body:not([data-theme="white"]) .info-panel {
    background: rgba(21,101,192,0.18) !important;
    color: #BAE6FD !important;
    border: 1px solid rgba(56,189,248,0.25) !important;
}

/* Controls bar */
.controls-bar {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 12px; flex-wrap: wrap;
    padding: 10px 12px; border-radius: 8px;
    background: #F8FAFC;
}
body:not([data-theme="white"]) .controls-bar {
    background: rgba(15,23,42,0.65) !important;
    color: #E2E8F0 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}
body:not([data-theme="white"]) .controls-bar label,
body:not([data-theme="white"]) .controls-bar span { color: #CBD5E1 !important; }

/* Highlight colors */
.highlight-blue  { color: #1565C0; font-weight: 700; }
.highlight-red   { color: #E53935; font-weight: 700; }
.highlight-orange{ color: #E65100; }
body:not([data-theme="white"]) .highlight-blue   { color: #38BDF8 !important; }
body:not([data-theme="white"]) .highlight-red    { color: #FCA5A5 !important; }
body:not([data-theme="white"]) .highlight-orange { color: #FED7AA !important; }

/* Orange math box variant */
.hint-orange-box { border-color: #FFE0B2 !important; }
body:not([data-theme="white"]) .hint-orange-box {
    background: rgba(249,115,22,0.12) !important;
    border-color: rgba(249,115,22,0.28) !important;
}


/* ================================================================
   MODULE 1 — TABS BAR : FULL CSS (no inline styles)
   ================================================================ */

.m1-tabs-bar {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 10px;
    margin: 16px 0 20px 0;
    padding-bottom: 10px;
    flex-wrap: wrap;
    border-bottom: 3px solid #E0E0E0;
}

.m1-tab-btn {
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #E8F0FE;
    color: #1565C0;
    font-weight: 700;
    cursor: pointer;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.m1-tab-btn.active {
    background: #1565C0;
    color: white;
    box-shadow: 0 2px 6px rgba(21,101,192,0.35);
    border-color: #1565C0;
}

/* Dark theme tabs */
body:not([data-theme="white"]) .m1-tabs-bar {
    border-bottom-color: rgba(255,255,255,0.12) !important;
}

body:not([data-theme="white"]) .m1-tab-btn {
    background: rgba(255,255,255,0.08) !important;
    color: #94A3B8 !important;
    border-color: rgba(255,255,255,0.10) !important;
}

body:not([data-theme="white"]) .m1-tab-btn:hover {
    background: rgba(255,255,255,0.14) !important;
    color: #E2E8F0 !important;
}

body:not([data-theme="white"]) .m1-tab-btn.active {
    background: linear-gradient(135deg, #1E40AF, #0284C7) !important;
    color: #FFFFFF !important;
    border-color: rgba(56,189,248,0.5) !important;
    box-shadow: 0 2px 10px rgba(56,189,248,0.3) !important;
}

/* White theme tabs */
[data-theme="white"] .m1-tab-btn {
    background: #E8F0FE !important;
    color: #1565C0 !important;
}

[data-theme="white"] .m1-tab-btn.active {
    background: #1565C0 !important;
    color: white !important;
}

/* ── Tuto card full reset ── */
.m1-tuto-card {
    position: relative;
    z-index: 2;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
    background: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

body:not([data-theme="white"]) .m1-tuto-card {
    background: rgba(15,23,42,0.88) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}

[data-theme="white"] .m1-tuto-card {
    background: #FFFFFF !important;
}

/* ================================================================
   DEFINITIVE THEME UNIFICATION — CHAPTER 1 & CHAPTER 2
   Harmonious, beautiful card frames for both Dark and White themes
   ================================================================ */

/* ── 1. DARK THEMES: VISIBLE CRISP CARD FRAMES ── */
body:not([data-theme="white"]) {
    --card-border: rgba(255, 255, 255, 0.16);
    --card-bg: rgba(15, 23, 42, 0.82);
    --canvas-bg: rgba(248, 250, 252, 0.96);
}

/* Tutorial cards (M1 & M2) */
body:not([data-theme="white"]) .m1-tuto-card,
body:not([data-theme="white"]) [id^="m1-box-"] {
    background: rgba(15, 23, 42, 0.90) !important;
    border: 1px solid rgba(56, 189, 248, 0.38) !important;
    border-left: 6px solid #38BDF8 !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body:not([data-theme="white"]) .m1-tuto-indigo {
    border-color: rgba(139, 92, 246, 0.40) !important;
    border-left: 6px solid #818CF8 !important;
}

/* Canvas Container in both chapters */
body:not([data-theme="white"]) .canvas-container {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 14px !important;
    padding: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
}

/* Canvas drawing sheet */
body:not([data-theme="white"]) .geo-canvas,
body:not([data-theme="white"]) canvas[id^="c2-m"],
body:not([data-theme="white"]) canvas[id^="m1-canvas"],
body:not([data-theme="white"]) canvas[id^="m2-canvas"] {
    background: rgba(248, 250, 252, 0.97) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

/* Controls bar & buttons rows */
body:not([data-theme="white"]) .m1-controls-row,
body:not([data-theme="white"]) .controls-bar,
body:not([data-theme="white"]) div[style*="display:flex"][style*="border-radius:6px"] {
    background: rgba(15, 23, 42, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.30) !important;
}

/* Properties panels (Right-hand card) */
body:not([data-theme="white"]) .properties-panel {
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
    padding: 18px !important;
}

/* Chapter 2 info boxes inside properties-panel */
body:not([data-theme="white"]) .properties-panel > div {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
}

/* Preserving left accent borders on definition/theorem boxes */
body:not([data-theme="white"]) div[style*="border-left:4px solid #FBC02D"],
body:not([data-theme="white"]) div[style*="border-left: 4px solid #FBC02D"] {
    border-left: 5px solid #F59E0B !important;
}
body:not([data-theme="white"]) div[style*="border-left:4px solid #2E7D32"],
body:not([data-theme="white"]) div[style*="border-left: 4px solid #2E7D32"] {
    border-left: 5px solid #22C55E !important;
}
body:not([data-theme="white"]) div[style*="border-left:4px solid #3949AB"],
body:not([data-theme="white"]) div[style*="border-left: 4px solid #3949AB"] {
    border-left: 5px solid #6366F1 !important;
}
body:not([data-theme="white"]) div[style*="border-left:3px solid #00897B"],
body:not([data-theme="white"]) div[style*="border-left: 3px solid #00897B"] {
    border-left: 5px solid #14B8A6 !important;
}

/* Dynamic status banners under canvas */
body:not([data-theme="white"]) [id$="-info"],
body:not([data-theme="white"]) .info-panel {
    background: rgba(15, 23, 42, 0.80) !important;
    border: 1px solid rgba(56, 189, 248, 0.30) !important;
    border-left: 4px solid #38BDF8 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Themed configuration buttons (Chapter 2) */
.cfg-btn {
    border-radius: 8px;
    font-weight: 700;
    padding: 6px 14px;
    transition: all 0.25s ease;
}

body:not([data-theme="white"]) .cfg-btn-blue {
    background: rgba(56, 189, 248, 0.14) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #38BDF8 !important;
}
body:not([data-theme="white"]) .cfg-btn-blue:hover {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: #38BDF8 !important;
    color: #FFFFFF !important;
}

body:not([data-theme="white"]) .cfg-btn-orange {
    background: rgba(249, 115, 22, 0.14) !important;
    border: 1px solid rgba(249, 115, 22, 0.45) !important;
    color: #FB923C !important;
}
body:not([data-theme="white"]) .cfg-btn-orange:hover {
    background: rgba(249, 115, 22, 0.25) !important;
    border-color: #FB923C !important;
    color: #FFFFFF !important;
}

body:not([data-theme="white"]) .cfg-btn-red {
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #F87171 !important;
}
body:not([data-theme="white"]) .cfg-btn-red:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #F87171 !important;
    color: #FFFFFF !important;
}

body:not([data-theme="white"]) .cfg-btn-green {
    background: rgba(34, 197, 94, 0.14) !important;
    border: 1px solid rgba(34, 197, 94, 0.45) !important;
    color: #4ADE80 !important;
}
body:not([data-theme="white"]) .cfg-btn-green:hover {
    background: rgba(34, 197, 94, 0.25) !important;
    border-color: #4ADE80 !important;
    color: #FFFFFF !important;
}

/* Step pills circular border */
body:not([data-theme="white"]) .m1-step-pill,
body:not([data-theme="white"]) .m1-step-pill2 {
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* ── 2. WHITE THEME : CRISP ACADEMIC STYLING ── */
[data-theme="white"] {
    --card-border: #E2E8F0;
    --card-bg: #FFFFFF;
}

[data-theme="white"] .m1-tuto-card,
[data-theme="white"] [id^="m1-box-"] {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    border-left: 6px solid #0288D1 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="white"] .canvas-container {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="white"] .geo-canvas,
[data-theme="white"] canvas[id^="c2-m"],
[data-theme="white"] canvas[id^="m1-canvas"],
[data-theme="white"] canvas[id^="m2-canvas"] {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="white"] .m1-controls-row,
[data-theme="white"] .controls-bar {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
}

[data-theme="white"] .properties-panel {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="white"] .properties-panel > div {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
}

[data-theme="white"] .cfg-btn-blue {
    background: #E8F0FE !important;
    border: 1px solid #90CAF9 !important;
    color: #1565C0 !important;
}
[data-theme="white"] .cfg-btn-orange {
    background: #FFF3E0 !important;
    border: 1px solid #FFCC80 !important;
    color: #E65100 !important;
}
[data-theme="white"] .cfg-btn-red {
    background: #FFEBEE !important;
    border: 1px solid #FFCDD2 !important;
    color: #C62828 !important;
}
[data-theme="white"] .cfg-btn-green {
    background: #E8F5E9 !important;
    border: 1px solid #A5D6A7 !important;
    color: #2E7D32 !important;
}

/* ================================================================
   ADDITIONAL COMPREHENSIVE THEME STYLING
   Ensures 100% visibility of tabs, hint boxes, math boxes,
   score bars and all frames in dark themes (stellar, grid, aurora, ocean)
   ================================================================ */

/* Tabs bar & Standard Tabs */
body:not([data-theme="white"]) .tabs {
    border-bottom: 2px solid rgba(255, 255, 255, 0.12) !important;
}

body:not([data-theme="white"]) .tab-btn {
    color: #94A3B8 !important;
    background: transparent !important;
}

body:not([data-theme="white"]) .tab-btn:hover {
    color: #38BDF8 !important;
}

body:not([data-theme="white"]) .tab-btn.active {
    color: #38BDF8 !important;
    border-bottom-color: #38BDF8 !important;
    font-weight: 700 !important;
}

/* Hint Boxes in Dark Themes */
body:not([data-theme="white"]) .hint-box {
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

body:not([data-theme="white"]) .hint-green {
    background: rgba(34, 197, 94, 0.14) !important;
    border: 1px solid rgba(34, 197, 94, 0.40) !important;
}
body:not([data-theme="white"]) .hint-green .hint-title { color: #4ADE80 !important; }
body:not([data-theme="white"]) .hint-green .hint-body  { color: #D1FAE5 !important; }

body:not([data-theme="white"]) .hint-yellow {
    background: rgba(245, 158, 11, 0.14) !important;
    border: 1px solid rgba(245, 158, 11, 0.40) !important;
}
body:not([data-theme="white"]) .hint-yellow .hint-title { color: #FBBF24 !important; }
body:not([data-theme="white"]) .hint-yellow .hint-body  { color: #FEF3C7 !important; }

body:not([data-theme="white"]) .hint-purple {
    background: rgba(168, 85, 247, 0.14) !important;
    border: 1px solid rgba(168, 85, 247, 0.40) !important;
}
body:not([data-theme="white"]) .hint-purple .hint-title { color: #C084FC !important; }
body:not([data-theme="white"]) .hint-purple .hint-body  { color: #F3E8FF !important; }

/* Score and progress bars */
body:not([data-theme="white"]) .score-bar {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #F8FAFC !important;
}

/* Guarantee all interactive content layers above background canvas */
.module-page,
.m1-tabs-bar,
.m1-tab-content,
.m1-tuto-card,
[id^="m1-box-"],
.canvas-container,
.properties-panel,
.tools-panel,
.synthese-box,
.math-box {
    position: relative;
    z-index: 2;
}

