/* ============================================================
   RESET ET BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales */
    --primary: #4361ee;
    --primary-dark: #3f37c9;
    --primary-light: #e8f0fe;
    --secondary: #764ba2;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    
    /* Couleurs neutres */
    --dark: #1a1a1a;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #eeeeee;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    
    /* Espacements */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    
    /* Ombres */
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow: 0 5px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   CONTENEUR PRINCIPAL
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 40px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-content h1 {
    font-size: 1.4em;
    color: var(--primary);
    font-weight: 600;
}

.header-content h1 a {
    color: inherit;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: var(--text);
    font-size: 0.95em;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

nav a:hover {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

/* ============================================================
   PAGE D'ACCUEIL - SÉQUENCES
   ============================================================ */
.sequences-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 50px 30px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    font-size: 2.2em;
    color: var(--dark);
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1em;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* Section d'un thème */
.theme-section {
    margin-bottom: 60px;
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.theme-header h2 {
    font-size: 1.5em;
    color: var(--dark);
    font-weight: 600;
}

.sequence-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Grille des séquences */
.sequences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.sequence-card {
    display: block;
    padding: 28px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sequence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s;
}

.sequence-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.sequence-card:hover::before {
    transform: scaleY(1);
}

.sequence-number {
    font-size: 0.75em;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    display: block;
}

.sequence-card h3 {
    font-size: 1.2em;
    color: var(--dark);
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.sequence-card p {
    color: var(--text-light);
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 18px;
}

.sequence-arrow {
    color: var(--primary);
    font-size: 1.2em;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.3s;
}

.sequence-card:hover .sequence-arrow {
    transform: translateX(6px);
}

/* ============================================================
   PAGE D'UN CHAPITRE / SÉQUENCE
   ============================================================ */
.chapter-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.chapter-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.chapter-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.chapter-header .back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    font-size: 0.95em;
    position: relative;
    z-index: 1;
}

.chapter-header .back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.chapter-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.chapter-header h1 {
    font-size: 2.2em;
    margin-bottom: 12px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.chapter-theme {
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.chapter-description {
    font-size: 1em;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Navigation par catégorie */
.categories-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 35px;
    flex-wrap: wrap;
    padding: 15px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 80px;
    z-index: 50;
}

.cat-link {
    padding: 10px 22px;
    background: var(--bg-light);
    color: var(--text);
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.cat-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Sections de contenu */
.content-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-section {
    padding: 30px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 150px;
}

.content-section h2 {
    font-size: 1.4em;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Liste des fichiers */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    border: 1px solid transparent;
}

.file-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    padding-left: 30px;
}

.file-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.file-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.95em;
}

.file-action {
    color: var(--primary);
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
}

/* Vidéos */
.video-item {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 15px;
}

.video-item iframe {
    width: 100%;
    height: 350px;
    display: block;
    border: none;
}

.video-item p {
    padding: 12px 18px;
    font-weight: 600;
    color: var(--dark);
}

/* Message vide */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: var(--bg-white);
    border-radius: var(--radius);
    font-size: 1.05em;
}

/* ============================================================
   PAGE D'UN THÈME
   ============================================================ */
.theme-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.theme-page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 50px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    color: white;
}

.theme-page-header h1 {
    font-size: 2.2em;
    margin-bottom: 15px;
    font-weight: 700;
}

.theme-page-header p {
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================
   PAGE DES PARCOURS
   ============================================================ */
.parcours-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.parcours-header .back-link {
    color: var(--primary);
    text-decoration: none;
    padding: 10px 20px;
    background: var(--bg-light);
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s;
}

.parcours-header .back-link:hover {
    background: var(--primary);
    color: white;
}

.parcours-header h2 {
    font-size: 1.8em;
    color: var(--dark);
    font-weight: 700;
}

.parcours-type {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-steps {
    background: var(--success);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.reset-progress {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s;
}

.reset-progress:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* Barre de progression */
.progress-container {
    margin-bottom: 35px;
    overflow-x: auto;
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px 20px;
    box-shadow: var(--shadow-sm);
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
}

.progress-step {
    width: 50px;
    height: 50px;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.progress-step.active {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(67, 97, 238, 0.2);
}

.progress-step.completed {
    background: var(--success);
    color: white;
}

.progress-line {
    width: 60px;
    height: 3px;
    background: var(--border);
    margin: 0 5px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.progress-line.completed {
    background: var(--success);
}

/* Blocs de contenu */
.content-block {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 25px;
    display: none;
}

.content-block.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.block-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 25px;
}

.step-badge {
    display: inline-block;
    padding: 6px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.8em;
    margin-bottom: 12px;
    font-weight: 600;
}

.block-header h3 {
    font-size: 1.3em;
    font-weight: 600;
}

.block-content {
    padding: 25px;
    background: var(--bg-light);
}

.pdf-viewer {
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pdf-viewer embed {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

.pdf-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.btn-download,
.btn-view {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.btn-download {
    background: var(--success);
    color: white;
}

.btn-download:hover {
    background: #45a049;
    transform: translateY(-2px);
    color: white;
}

.btn-view {
    background: var(--primary);
    color: white;
}

.btn-view:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    color: white;
}

.block-footer {
    padding: 18px 25px;
    background: #fff3e0;
    border-top: 1px solid #ffcc80;
    display: flex;
    justify-content: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #e65100;
    font-weight: 600;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.block-navigation {
    padding: 20px 25px;
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}

.nav-prev,
.nav-next,
.btn-finish {
    padding: 12px 28px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s;
}

.nav-prev {
    background: #6c757d;
    color: white;
}

.nav-prev:hover {
    background: #5a6268;
    transform: translateX(-3px);
}

.nav-next {
    background: var(--primary);
    color: white;
}

.nav-next:hover {
    background: var(--primary-dark);
    transform: translateX(3px);
}

.btn-finish {
    background: var(--success);
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-finish:hover {
    background: #45a049;
    color: white;
    transform: scale(1.05);
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.quiz-container {
    padding: 25px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.quiz-intro {
    text-align: center;
    padding: 40px 20px;
}

.quiz-intro p {
    color: var(--text-light);
    margin-bottom: 12px;
}

.btn-start-quiz {
    padding: 16px 40px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.btn-start-quiz:hover {
    background: #45a049;
    transform: scale(1.05);
}

.question-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.question-text {
    font-weight: 700;
    margin-bottom: 18px;
    font-size: 1.05em;
    color: var(--dark);
}

.options-list {
    list-style: none;
    padding: 0;
}

.option-item {
    padding: 14px 18px;
    margin: 8px 0;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.option-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.option-item.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.option-item.correct {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.option-item.wrong {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-submit-quiz {
    padding: 14px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    margin-top: 20px;
    transition: all 0.3s;
}

.btn-submit-quiz:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.quiz-result {
    text-align: center;
    padding: 40px 25px;
    background: white;
    border-radius: var(--radius);
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.result-score {
    font-size: 3.5em;
    font-weight: 700;
    color: var(--primary);
    margin: 15px 0;
}

.result-message {
    font-size: 1.15em;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.result-percentage {
    color: var(--text-light);
    margin-bottom: 20px;
}

.btn-retry-quiz {
    padding: 12px 28px;
    background: var(--warning);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-retry-quiz:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* ============================================================
   FICHE DE RÉVISION
   ============================================================ */
.revision-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 100%;
}

.revision-sheet {
    background: white;
    border-radius: var(--radius);
}

.revision-header {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 3px solid var(--primary);
}

.revision-header h2 {
    color: var(--primary);
    font-size: 1.8em;
    margin-bottom: 12px;
    font-weight: 700;
}

.revision-header h3 {
    color: var(--text);
    font-size: 1.3em;
    margin-bottom: 10px;
}

.revision-date {
    color: var(--text-muted);
    font-size: 0.85em;
}

.pdf-viewer-revision embed {
    width: 100%;
    height: 750px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
}

.revision-footer {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.btn-download,
.btn-back-chapter {
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    font-size: 0.95em;
}

.btn-download {
    background: var(--success);
    color: white;
}

.btn-download:hover {
    background: #45a049;
    color: white;
    transform: translateY(-2px);
}

.btn-back-chapter {
    background: var(--primary);
    color: white;
}

.btn-back-chapter:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.tip {
    color: var(--text-muted);
    font-size: 0.85em;
    font-style: italic;
    margin-top: 15px;
}

.info-message {
    text-align: center;
    padding: 60px 25px;
    color: var(--text-light);
}

.info-message p {
    margin: 12px 0;
    font-size: 1.05em;
}

/* ============================================================
   PARCOURS VIDÉOS
   ============================================================ */
.videos-parcours {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.videos-parcours h2 {
    font-size: 1.8em;
    color: var(--dark);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.video-block {
    margin-bottom: 35px;
    padding: 25px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.video-block h3 {
    color: var(--dark);
    margin-bottom: 18px;
    font-size: 1.15em;
    font-weight: 600;
}

.video-block iframe {
    width: 100%;
    height: 450px;
    border-radius: var(--radius-sm);
    border: none;
}

.nav-buttons {
    text-align: center;
    margin-top: 30px;
}

.btn-back {
    display: inline-block;
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

/* ============================================================
   PARCOURS BREVET
   ============================================================ */
.brevet-parcours {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.brevet-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--warning) 0%, #f57c00 100%);
    border-radius: var(--radius-lg);
    color: white;
}

.brevet-header h2 {
    font-size: 2em;
    margin-bottom: 12px;
    font-weight: 700;
}

.brevet-header p {
    opacity: 0.95;
    margin-bottom: 20px;
    font-size: 1.05em;
}

.brevet-info {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.brevet-info .badge {
    background: rgba(255,255,255,0.25);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.brevet-exercises {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 35px;
}

.brevet-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--warning);
    transition: all 0.3s;
}

.brevet-card:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow);
}

.brevet-number {
    font-size: 0.8em;
    color: var(--warning);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.brevet-card h3 {
    color: var(--dark);
    margin-bottom: 12px;
    font-size: 1.15em;
    font-weight: 600;
}

.brevet-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    font-size: 0.9em;
    color: var(--text-light);
}

.brevet-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.brevet-actions .btn-view {
    background: var(--primary);
    color: white;
    padding: 11px 22px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.brevet-actions .btn-view:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.brevet-actions .btn-download {
    background: var(--success);
    color: white;
    padding: 11px 22px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.brevet-actions .btn-download:hover {
    background: #45a049;
    color: white;
    transform: translateY(-2px);
}

.brevet-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.brevet-footer .btn-back {
    background: #6c757d;
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.brevet-footer .btn-back:hover {
    background: #5a6268;
    color: white;
    transform: translateY(-2px);
}

.brevet-footer .btn-classic {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.brevet-footer .btn-classic:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

/* ============================================================
   DICTIONNAIRE IA
   ============================================================ */
.dict-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dict-header {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.dict-header h1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin-bottom: 12px;
    font-weight: 700;
}

.dict-header p {
    color: var(--text-light);
}

.back-home {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
}

.back-home:hover {
    text-decoration: underline;
}

.dict-container {
    background: white;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 25px;
    overflow: hidden;
    box-shadow: var(--shadow);
    flex: 1;
    min-height: 600px;
}

.words-sidebar {
    width: 320px;
    background: var(--bg-light);
    padding: 25px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: 700px;
}

.search-box {
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background: var(--bg-light);
    padding-bottom: 12px;
    z-index: 10;
}

.search-box input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 30px;
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.3s;
    background: white;
}

.search-box input:focus {
    border-color: var(--primary);
}

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

.word-item {
    padding: 13px 18px;
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    border: 1px solid var(--border);
    font-size: 0.95em;
}

.word-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(5px);
}

.word-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.definition-area {
    flex: 1;
    padding: 35px;
    overflow-y: auto;
    max-height: 700px;
}

.definition-title {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary);
}

.definition-content {
    font-size: 1.05em;
    line-height: 1.7;
    color: var(--text);
}

.formula-box {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    text-align: center;
    margin: 25px 0;
    border-left: 4px solid var(--primary);
    font-weight: 600;
}

.example-box {
    background: #e8f5e9;
    padding: 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
    margin-top: 20px;
    line-height: 1.6;
}

.example-box strong {
    color: #2e7d32;
}

.random-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 20px;
    width: 100%;
    transition: transform 0.3s;
    font-size: 0.95em;
}

.random-btn:hover {
    transform: scale(1.02);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--bg-white);
    padding: 30px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 60px;
    border-top: 1px solid var(--border);
}

footer p {
    margin: 5px 0;
}

/* ============================================================
   ADMINISTRATION
   ============================================================ */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.admin-header h1 {
    color: var(--dark);
    font-size: 1.5em;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

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

.stat-value {
    font-size: 2.3em;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-light);
    margin-top: 8px;
    font-size: 0.85em;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.menu-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 30px 20px;
    text-decoration: none;
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.3s;
}

.menu-card:hover {
    transform: translateY(-5px);
    color: white;
}

.menu-card .icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.menu-card h3 {
    font-size: 1em;
    font-weight: 600;
}

.visitors-table {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.visitors-table h2 {
    margin-bottom: 20px;
    color: var(--dark);
    font-size: 1.3em;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

tr:hover {
    background: var(--bg-light);
}

/* Boutons admin */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c62828;
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #45a049;
    color: white;
}

/* Badges */
.badge-visible {
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-hidden {
    background: var(--warning);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
}

/* Formulaires admin */
.form-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--dark);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Messages */
.message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .page-header h1 {
        font-size: 1.8em;
    }
    
    .chapter-header h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    .container,
    .sequences-page,
    .chapter-page,
    .theme-page,
    .admin-container {
        padding: 0 15px 40px;
    }
    
    .page-header {
        padding: 30px 20px;
        margin-bottom: 40px;
    }
    
    .page-header h1 {
        font-size: 1.6em;
    }
    
    .page-header p {
        font-size: 1em;
    }
    
    .sequences-grid {
        grid-template-columns: 1fr;
    }
    
    .chapter-header {
        padding: 30px 20px;
    }
    
    .chapter-header h1 {
        font-size: 1.5em;
    }
    
    .categories-nav {
        position: static;
        justify-content: center;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .pdf-viewer embed {
        height: 400px;
    }
    
    .progress-step {
        width: 40px;
        height: 40px;
        font-size: 0.9em;
    }
    
    .progress-line {
        width: 30px;
    }
    
    .pdf-actions {
        flex-direction: column;
    }
    
    .block-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-prev,
    .nav-next,
    .btn-finish {
        width: 100%;
        text-align: center;
    }
    
    .dict-container {
        flex-direction: column;
    }
    
    .words-sidebar {
        width: 100%;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .definition-area {
        max-height: 500px;
        padding: 25px;
    }
    
    .video-block iframe {
        height: 250px;
    }
    
    .revision-container {
        padding: 20px;
    }
    
    .pdf-viewer-revision embed {
        height: 450px;
    }
    
    .footer-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        justify-content: center;
        gap: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.8em;
    }
    
    .question-card {
        padding: 18px;
    }
    
    .option-item {
        padding: 12px 15px;
        font-size: 0.9em;
    }
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
    header,
    footer,
    nav,
    .categories-nav,
    .block-navigation,
    .block-footer,
    .btn-download,
    .btn-view,
    .btn-back-chapter,
    .btn-print,
    .tip,
    .reset-progress,
    .parcours-header {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        padding: 0;
    }
    
    .content-section,
    .content-block {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .pdf-viewer embed,
    .pdf-viewer-revision embed {
        height: auto;
    }
}
/* ============================================================
   PAGE D'ACCUEIL MULTI-NIVEAUX
   ============================================================ */
.home-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.home-hero {
    text-align: center;
    margin-bottom: 60px;
    padding: 60px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.home-hero h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.home-hero p {
    font-size: 1.15em;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Grille des niveaux */
.niveaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.niveau-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.niveau-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--niveau-color) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.niveau-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--niveau-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.niveau-card:hover::before {
    opacity: 0.05;
}

.niveau-icon {
    font-size: 3.5em;
    flex-shrink: 0;
    transition: transform 0.4s;
    position: relative;
    z-index: 1;
}

.niveau-card:hover .niveau-icon {
    transform: scale(1.15) rotate(-5deg);
}

.niveau-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.niveau-badge {
    display: inline-block;
    background: var(--niveau-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.niveau-content h2 {
    font-size: 1.5em;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.niveau-content p {
    color: var(--text-light);
    font-size: 0.9em;
    line-height: 1.5;
}

.niveau-arrow {
    font-size: 1.5em;
    color: var(--niveau-color);
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.4s;
    position: relative;
    z-index: 1;
}

.niveau-card:hover .niveau-arrow {
    transform: translateX(8px);
}

/* Section info */
.home-info {
    background: white;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.home-info h3 {
    text-align: center;
    font-size: 1.5em;
    color: var(--dark);
    margin-bottom: 35px;
    font-weight: 700;
}

.home-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.info-item {
    text-align: center;
    padding: 20px;
}

.info-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.info-item h4 {
    font-size: 1.1em;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.info-item p {
    color: var(--text-light);
    font-size: 0.9em;
    line-height: 1.6;
}

/* ============================================================
   PAGE D'UN NIVEAU
   ============================================================ */
.niveau-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.niveau-header {
    padding: 50px 40px;
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.niveau-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.niveau-header .back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    opacity: 0.9;
    margin-bottom: 25px;
    font-size: 0.95em;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.niveau-header .back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.niveau-title {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.niveau-icon-large {
    font-size: 5em;
    flex-shrink: 0;
}

.niveau-badge-large {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.niveau-title h1 {
    font-size: 2.2em;
    margin-bottom: 12px;
    font-weight: 700;
}

.niveau-title p {
    font-size: 1.05em;
    opacity: 0.95;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .home-hero {
        padding: 40px 20px;
    }
    
    .home-hero h1 {
        font-size: 1.8em;
    }
    
    .niveaux-grid {
        grid-template-columns: 1fr;
    }
    
    .niveau-card {
        padding: 22px;
        gap: 15px;
    }
    
    .niveau-icon {
        font-size: 2.5em;
    }
    
    .niveau-content h2 {
        font-size: 1.25em;
    }
    
    .niveau-header {
        padding: 30px 20px;
    }
    
    .niveau-icon-large {
        font-size: 3.5em;
    }
    
    .niveau-title h1 {
        font-size: 1.6em;
    }
    
    .home-info {
        padding: 25px 20px;
    }
    
    .home-info h3 {
        font-size: 1.2em;
    }
}
/* ============================================================
   HEADER (déplacé depuis header.php)
   ============================================================ */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 30px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.header-logo .logo-icon { font-size: 1.8em; }

.header-logo .logo-text {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--primary, #4361ee);
    line-height: 1.1;
}

.header-logo .logo-subtitle {
    font-size: 0.7em;
    color: #999;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.92em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.main-nav a:hover {
    background: #f0f0f0;
    color: var(--primary, #4361ee);
}

.main-nav a.active {
    background: var(--primary, #4361ee);
    color: white;
}

.niveaux-bar {
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.niveaux-bar .header-container { padding: 8px 20px; }

.niveaux-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: white;
    border-radius: 30px;
}

.niveaux-nav a {
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 0.88em;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.niveaux-nav a:hover {
    background: #f0f0f0;
    color: var(--primary, #4361ee);
}

.niveaux-nav a.active {
    background: var(--primary, #4361ee);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px;
    color: #333;
    border-radius: 8px;
    transition: background 0.3s;
}

.menu-toggle:hover { background: #f0f0f0; }

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: var(--primary, #4361ee);
    color: white !important;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: var(--primary-dark, #3f37c9);
    transform: translateY(-2px);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #f0f0f0;
    color: #dc3545 !important;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #dc3545;
    color: white !important;
}

/* ============================================================
   FOOTER (déplacé depuis footer.php)
   ============================================================ */
footer {
    background: white;
    padding: 30px 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

footer p {
    margin: 5px 0;
    font-size: 0.9em;
}

.footer-stats {
    font-size: 12px !important;
    margin-top: 8px !important;
}

/* ============================================================
   COURSES (déplacé depuis theme.php / chapter.php)
   ============================================================ */
.chapter-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.chapter-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.chapter-header .back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.chapter-header .back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.chapter-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 15px;
    font-weight: 600;
}

.chapter-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.chapter-theme {
    opacity: 0.9;
    margin-bottom: 15px;
}

.chapter-description {
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

.categories-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.cat-link {
    padding: 8px 20px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid #eee;
}

.cat-link:hover {
    background: #4361ee;
    color: white;
    border-color: #4361ee;
}

.content-section {
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
}

.content-section h2 {
    font-size: 1.4em;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

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

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.file-item:hover {
    background: #e8f0fe;
    padding-left: 25px;
}

.file-icon { font-size: 1.5em; }
.file-title { font-weight: 500; }
.file-content { flex: 1; }

.file-subtitle {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

.file-action {
    color: #4361ee;
    font-size: 0.9em;
    font-weight: 500;
}

.video-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.video-item iframe {
    width: 100%;
    height: 400px;
    border: none;
    display: block;
}

.video-item p {
    padding: 10px 15px;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: #999;
}

.empty-message {
    color: #999;
    padding: 20px;
}

@media (max-width: 768px) {
    .chapter-header h1 { font-size: 1.5em; }
    .categories-nav { justify-content: center; }
    .video-item iframe { height: 250px; }
}
/* ============================================================
   ACCORDÉON DES SÉQUENCES (theme.php)
   ============================================================ */
/* ============================================================
   CONTENU DÉPLIABLE (COMPACT)
   ============================================================ */
.sequence-content {
    padding: 16px 20px 20px;
    background: #fafbfc;
    animation: slideDown 0.3s ease-out;
}

.sequence-content[hidden] {
    display: none;
}

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

.sequence-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 14px;
    line-height: 1.5;
}

.sequence-empty {
    color: #999;
    text-align: center;
    padding: 15px;
    font-style: italic;
    font-size: 0.9em;
}

/* Grille des catégories : plusieurs catégories côte à côte */
.sequence-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: start;
}

/* Une catégorie */
.sequence-category {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.2s;
}

.sequence-category:hover {
    border-color: #c5cae9;
}

.sequence-category-title {
    font-size: 0.8em;
    font-weight: 700;
    color: #4361ee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.sequence-category-count {
    background: #e8f0fe;
    color: #4361ee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
}

/* Liste des fichiers dans une catégorie */
.sequence-files {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sequence-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 0.88em;
    transition: background 0.2s, color 0.2s;
    line-height: 1.3;
}

.sequence-file:hover {
    background: #e8f0fe;
    color: #4361ee;
}

.sequence-file-icon {
    font-size: 0.95em;
    flex-shrink: 0;
}

.sequence-file-title {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sequence-file-action {
    color: #4361ee;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.sequence-file:hover .sequence-file-action {
    opacity: 1;
}

.sequence-file-video .sequence-file-action {
    opacity: 1;
    color: #f44336;
}

/* Responsive */
@media (max-width: 768px) {
    .sequence-toggle {
        padding: 14px 16px;
    }
    
    .sequence-toggle-left {
        gap: 10px;
    }
    
    .sequence-number {
        padding: 4px 9px;
        font-size: 0.7em;
    }
    
    .sequence-title {
        font-size: 0.95em;
    }
    
    .sequence-badge {
        display: none;
    }
    
    .sequence-content {
        padding: 12px 14px 14px;
    }
    
    .sequence-categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sequence-file-action {
        opacity: 1;
    }
}
.sequence-full-link:hover {
    background: #3f37c9;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .sequence-toggle {
        padding: 16px 18px;
    }
    
    .sequence-toggle-left {
        gap: 10px;
    }
    
    .sequence-number {
        padding: 4px 9px;
        font-size: 0.7em;
    }
    
    .sequence-title {
        font-size: 0.95em;
    }
    
    .sequence-badge {
        display: none;
    }
    
    .sequence-content {
        padding: 15px 18px 18px;
    }
    
    .sequence-file-action {
        opacity: 1;
    }
}
/* ============================================================
   DESCRIPTION DU THÈME
   ============================================================ */
.theme-description {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ============================================================
   ACCORDÉON DES SÉQUENCES (niveau.php)
   ============================================================ */
.sequences-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sequence-item {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.sequence-item:hover {
    border-color: #c5cae9;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.08);
}

.sequence-item.open {
    border-color: #4361ee;
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.12);
}

/* En-tête cliquable */
.sequence-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 24px;
    background: white;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    gap: 15px;
    transition: background 0.2s;
}

.sequence-toggle:hover {
    background: #f8f9fa;
}

.sequence-item.open .sequence-toggle {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.sequence-toggle-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.sequence-number {
    background: #e8f0fe;
    color: #4361ee;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sequence-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sequence-toggle-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sequence-badge {
    background: #4caf50;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.sequence-badge-empty {
    background: #e0e0e0;
    color: #666;
}

.sequence-chevron {
    font-size: 1.2em;
    color: #4361ee;
    transition: transform 0.3s ease;
    display: inline-block;
}

.sequence-item.open .sequence-chevron {
    transform: rotate(180deg);
}

/* Contenu dépliable */
.sequence-content {
    padding: 20px 24px 24px;
    background: #fafbfc;
    animation: slideDown 0.3s ease-out;
}

.sequence-content[hidden] {
    display: none;
}

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

.sequence-description {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 20px;
    line-height: 1.6;
}

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

/* Catégories */
.sequence-category {
    margin-bottom: 18px;
}

.sequence-category:last-of-type {
    margin-bottom: 0;
}

.sequence-category-title {
    font-size: 0.9em;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sequence-category-count {
    background: #e8f0fe;
    color: #4361ee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
}

.sequence-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 4px;
}

.sequence-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    transition: all 0.2s;
}

.sequence-file:hover {
    border-color: #4361ee;
    background: #f0f4ff;
    transform: translateX(3px);
}

.sequence-file-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.sequence-file-title {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sequence-file-action {
    color: #4361ee;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.sequence-file:hover .sequence-file-action {
    opacity: 1;
}

.sequence-file-video .sequence-file-action {
    opacity: 1;
    color: #f44336;
}

/* Footer du contenu */
.sequence-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eee;
    text-align: center;
}

.sequence-full-link {
    display: inline-block;
    padding: 10px 22px;
    background: #4361ee;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.sequence-full-link:hover {
    background: #3f37c9;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .sequence-toggle {
        padding: 16px 18px;
    }
    
    .sequence-toggle-left {
        gap: 10px;
    }
    
    .sequence-number {
        padding: 4px 9px;
        font-size: 0.7em;
    }
    
    .sequence-title {
        font-size: 0.95em;
    }
    
    .sequence-badge {
        display: none;
    }
    
    .sequence-content {
        padding: 15px 18px 18px;
    }
    
      
    .sequence-file-action {
        opacity: 1;
    }
}