/* =================================================================
   MOODIA EDITOR - DESIGN BUBUL SPT
   ================================================================= */

@import "../../variables-Uk-6nDi.css";

/* =================================================================
   PAGE CONTAINER
   La page est déjà dans .main-content qui gère le décalage navbar
   ================================================================= */

/* Override main-content pour empêcher le scroll sur cette page */
.main-content:has(.moodia-editor-page) {
    overflow: hidden;
    height: calc(100vh - 60px); /* Tenir compte de la navbar */
    padding: 1.5rem 2rem;
}

.moodia-editor-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    background: transparent;
    font-family: var(--font-primary);
    overflow: hidden;
}

/* =================================================================
   HEADER - Bannière principale
   ================================================================= */

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    z-index: 100;
}

.editor-header__left {
    display: flex;
    align-items: center;
    flex: 1;
}

.editor-header__title-input {
    flex: 1;
    max-width: 500px;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-black);
    background: rgba(0, 0, 0, 0.02);
    border: none;
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease;
}

.editor-header__title-input:hover {
    background: rgba(12, 129, 228, 0.05);
}

.editor-header__title-input:focus {
    outline: none;
    background: rgba(12, 129, 228, 0.08);
}

.editor-header__title-input::placeholder {
    color: var(--color-text-light);
    font-weight: 400;
}

.editor-header__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-header__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-medium);
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius-full);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
}

.status-dot.saving {
    background: var(--color-warning);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.error {
    background: var(--color-error);
}

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

/* =================================================================
   LAYOUT - Flex simple sidebar + main
   ================================================================= */

.editor-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 1.25rem;
}

/* =================================================================
   SIDEBAR (Plan du cours)
   ================================================================= */

.editor-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: linear-gradient(180deg, #FAFBFC 0%, #F5F7FA 100%);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar-title {
    margin: 0;
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-black);
    letter-spacing: -0.01em;
}

.sidebar-toc {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-toc::-webkit-scrollbar {
    width: 5px;
}

.sidebar-toc::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-toc::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.sidebar-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}


/* TOC Loading */
.toc-loading {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toc-skeleton {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

.toc-skeleton.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* TOC Empty message */
.toc-empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.toc-empty-message p {
    margin: 0;
    font-size: 0.8125rem;
    color: #94A3B8;
    font-style: italic;
}

/* =================================================================
   SKELETON LOADER UNIFORME
   Composant réutilisable pour toutes les zones de chargement
   ================================================================= */

.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius-md);
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite ease-in-out;
}

.skeleton-line--title {
    height: 20px;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-line--short {
    width: 40%;
}

.skeleton-line--medium {
    width: 75%;
}

.skeleton-line--full {
    width: 100%;
}

/* Activity Skeleton - Skeleton complet pour une activité en chargement */
.activity-skeleton {
    background: white;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.activity-skeleton .skeleton-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(12, 129, 228, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.activity-skeleton .skeleton-badge {
    width: 80px;
    height: 24px;
    background: linear-gradient(90deg, rgba(12, 129, 228, 0.1) 25%, rgba(12, 129, 228, 0.15) 50%, rgba(12, 129, 228, 0.1) 75%);
    background-size: 200% 100%;
    border-radius: var(--border-radius-full);
    animation: shimmer 1.5s infinite ease-in-out;
}

.activity-skeleton .skeleton-title {
    flex: 1;
    height: 18px;
    max-width: 200px;
    background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite ease-in-out;
}

.activity-skeleton .skeleton-body {
    padding: 1.5rem;
}

.activity-skeleton .skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* Animation pulse pour indiquer le chargement actif */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Skeleton initial au démarrage de la génération */
.initial-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-skeleton {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-skeleton-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(90deg, rgba(12, 129, 228, 0.08) 25%, rgba(12, 129, 228, 0.12) 50%, rgba(12, 129, 228, 0.08) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
}

.section-skeleton-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-loading {
    position: relative;
}

.activity-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    background-size: 200% 100%;
    animation: loading-bar 1.5s infinite;
}

@keyframes loading-bar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton content dans une activité en chargement */
.activity-skeleton-content {
    display: none; /* Caché par défaut */
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

/* Afficher le skeleton quand activity-loading est présent */
.activity-loading .activity-skeleton-content {
    display: flex;
}

/* Cacher le contenu quand activity-loading est présent */
.activity-loading .content-display,
.activity-loading .audio-text-source {
    display: none;
}

.activity-skeleton-content .skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite ease-in-out;
}

.activity-skeleton-content .skeleton-line--full {
    width: 100%;
}

.activity-skeleton-content .skeleton-line--medium {
    width: 75%;
}

.activity-skeleton-content .skeleton-line--short {
    width: 50%;
}

/* Placeholder "En cours de rédaction" */
.activity-placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: rgba(12, 129, 228, 0.03);
    border: 1px dashed rgba(12, 129, 228, 0.2);
    border-radius: var(--border-radius-md);
}

.activity-placeholder-content .placeholder-icon {
    font-size: 1.25rem;
    animation: writing 1.5s ease-in-out infinite;
}

.activity-placeholder-content .placeholder-text {
    font-size: 0.9375rem;
    color: var(--color-text-medium);
    font-style: italic;
}

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

/* TOC Sections */
.toc-section {
    margin-bottom: 0.75rem;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.toc-section-header {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    padding: 0;
    background: white;
    border: none;
    border-left: 3px solid var(--color-primary);
}

.toc-section-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100%;
    padding: 0.875rem 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    transition: all 0.15s ease;
}

.toc-section-toggle:hover {
    color: var(--color-primary);
}

.toc-section-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease-out;
    pointer-events: none;
}

.toc-section.collapsed .toc-section-chevron {
    transform: rotate(-90deg);
}

.toc-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    padding: 0.875rem 1rem 0.875rem 0;
    font-family: var(--font-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-black);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toc-section-title:hover {
    color: var(--color-primary);
}

.toc-section-title .toc-section-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-primary);
    pointer-events: none;
}

.toc-section-header:hover {
    background: rgba(12, 129, 228, 0.04);
}

.toc-section-items-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.15s ease-out;
}

.toc-section.collapsed .toc-section-items-wrapper {
    grid-template-rows: 0fr;
}

.toc-section-items {
    padding: 0.25rem 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    background: rgba(0, 0, 0, 0.01);
    overflow: hidden;
}

.toc-section.collapsed .toc-section-items {
    padding-top: 0;
    padding-bottom: 0;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    padding-left: 1.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-medium);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.toc-item::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    width: 4px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.toc-item:hover {
    background: rgba(12, 129, 228, 0.06);
    color: var(--color-primary);
}

.toc-item:hover::before {
    background: var(--color-primary);
}

.toc-item.active {
    background: rgba(12, 129, 228, 0.1);
    color: var(--color-primary);
    font-weight: 500;
}

.toc-item.active::before {
    background: var(--color-primary);
    width: 6px;
    height: 6px;
}

.toc-item-badge {
    display: inline-flex;
    padding: 0.1875rem 0.5rem;
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: var(--border-radius-full);
    margin-left: auto;
    flex-shrink: 0;
}

.toc-item-badge--page {
    background: #EEF2FF;
    color: #4F46E5;
}

.toc-item-badge--quiz {
    background: #FEF3C7;
    color: #B45309;
}

.toc-item-badge--glossary {
    background: #ECFDF5;
    color: #059669;
}

.toc-item-badge--audio {
    background: #FCE7F3;
    color: #BE185D;
}

/* =================================================================
   MAIN CONTENT AREA
   ================================================================= */

.editor-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    background: linear-gradient(180deg, #F8FAFC 0%, #F0F4F8 100%);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative; /* Nécessaire pour le calcul correct du scroll */
}

.editor-content {
    width: 100%;
}

.course-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.sections-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Bouton ajouter une section */
.add-section-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    background: rgba(12, 129, 228, 0.04);
    border: 2px dashed rgba(12, 129, 228, 0.25);
    border-radius: var(--border-radius-lg);
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-section-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 129, 228, 0.25);
}

.add-section-btn svg {
    transition: transform 0.2s ease;
}

.add-section-btn:hover svg {
    transform: rotate(90deg);
}

/* =================================================================
   GENERATION PLACEHOLDER
   ================================================================= */

.generation-placeholder {
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-radius: var(--border-radius-lg);
    border: 2px dashed rgba(12, 129, 228, 0.2);
}

.generation-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(12, 129, 228, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    margin: 0;
    font-family: var(--font-secondary);
    font-size: 1rem;
    color: var(--color-text-medium);
}

/* =================================================================
   SECTION BLOCK
   ================================================================= */

.section-block {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: none;
    scroll-margin-top: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--gradient-main);
    color: white;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.section-icon {
    width: 20px;
    height: 20px;
    color: white;
    flex-shrink: 0;
    opacity: 0.9;
}

.section-number {
    display: none;
}

.moodia-editor .section-title {
    flex: 1;
    margin: 0;
    font-family: var(--font-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
}

.section-title-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 0.375rem 0.625rem;
    font-family: var(--font-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    outline: none;
    transition: background 0.15s ease;
}

.section-title-input:hover,
.section-title-input:focus {
    background: rgba(255, 255, 255, 0.25);
}

.section-title-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.section-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.375rem;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.section-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.section-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease-out;
}

.section-delete-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-md);
    padding: 0.375rem 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.section-delete-btn:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

.section-delete-btn:active {
    background: #F87171;
    color: white;
}

.section-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.01);
}

.section-block.collapsed .section-content {
    display: none;
}

.section-block.collapsed .section-toggle svg {
    transform: rotate(-90deg);
}

/* Section pages container */
.section-pages {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Section actions */
.section-actions {
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px dashed rgba(12, 129, 228, 0.15);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.add-activity-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px dashed rgba(12, 129, 228, 0.3);
    border-radius: var(--border-radius-sm);
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-activity-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* =================================================================
   ACTIVITY CARD
   ================================================================= */

/* =================================================================
   ACTIVITY CARDS - Design par type
   ================================================================= */

.activity-card,
.page-card {
    background: white;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
    border: none;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.activity-card:hover,
.page-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.activity-header,
.page-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    background: #FAFBFC;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.activity-badge,
.page-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--border-radius-full);
    font-size: 0.625rem;
    font-family: var(--font-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: default;
    flex-shrink: 0;
}

.activity-badge svg,
.page-badge svg {
    width: 12px;
    height: 12px;
}

/* Badge sélecteur de type - Design moderne */
.activity-type-select {
    appearance: none;
    -webkit-appearance: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.65rem;
    font-family: var(--font-secondary);
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
    background-size: 8px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    min-width: 0;
    min-height: 0;
}

.activity-type-select:hover {
    filter: brightness(0.97);
}

.activity-type-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.activity-type-select--page,
.activity-type-select--intro,
.activity-type-select--glossary,
.activity-type-select--audio {
    background-color: transparent;
    color: var(--color-text);
    border-color: #E2E8F0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.activity-type-select--page:hover,
.activity-type-select--intro:hover,
.activity-type-select--glossary:hover,
.activity-type-select--audio:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

/* Quiz select - Même style que les autres */
.activity-type-select--quiz {
    background-color: transparent;
    color: var(--color-text);
    border-color: #E2E8F0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.activity-type-select--quiz:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

/* Page / Intro - Bleu */
.activity-badge--intro,
.page-badge--intro,
.activity-badge--page,
.page-badge--page {
    background: #EFF6FF;
    color: #2563EB;
}

.activity-card--page,
.activity-card--intro,
.page-card--page,
.page-card--intro {
    border-left: 3px solid #3B82F6;
}

/* Quiz - Bleu primary */
.activity-badge--quiz,
.page-badge--quiz {
    background: rgba(12, 129, 228, 0.12);
    color: var(--color-primary);
}

.activity-card--quiz,
.page-card--quiz {
    border-left: 3px solid #F59E0B;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
}

/* Glossaire - Vert */
.activity-badge--glossary,
.page-badge--glossary {
    background: #ECFDF5;
    color: #059669;
}

.activity-card--glossary,
.page-card--glossary {
    border-left: 3px solid #10B981;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
}

/* Audio - Rose #EC4899 */
.activity-badge--audio {
    background: #FDF2F8;
    color: #EC4899;
}

.activity-card--audio,
.page-card--audio {
    border-left: 3px solid #EC4899;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
}

/* Glossaire - Liste des termes */
.glossary-terms-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.glossary-terms-list li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E2E8F0;
    line-height: 1.5;
}

.glossary-terms-list li:last-child {
    border-bottom: none;
}

.glossary-terms-list li strong {
    color: inherit;
    font-weight: 600;
}

.glossary-terms-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.activity-title,
.page-title {
    flex: 1;
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-black);
    margin: 0;
}

.activity-title-input {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-black);
    outline: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.activity-title-input:hover {
    background: rgba(12, 129, 228, 0.04);
}

.activity-title-input:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.95);
}

/* Titre statique (non-éditable) pour les activités fixes comme Introduction, Crédits, etc. */
.activity-title-static {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.35rem 0.625rem;
}

/* Fix: Background visible pour les inputs de titre dans les headers colorés */
.section-header .section-title-input,
.section-header-modern .section-title-modern {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    padding: 0.375rem 0.625rem;
}

.section-header .section-title-input:focus,
.section-header-modern .section-title-modern:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

.activity-delete-btn {
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.25rem;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
    opacity: 0.5;
}

.activity-card:hover .activity-delete-btn {
    opacity: 1;
}

.activity-delete-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
    opacity: 1;
}

.activity-delete-btn:active {
    background: #FECACA;
    color: #B91C1C;
}

.activity-toggle,
.activity-toggle-btn {
    background: transparent;
    border: none;
    padding: 0.25rem;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-toggle:hover,
.activity-toggle-btn:hover {
    background: rgba(12, 129, 228, 0.08);
    color: var(--color-primary);
}

.activity-toggle svg,
.activity-toggle-btn svg {
    transition: transform 0.15s ease;
}

.activity-card.collapsed .activity-body {
    display: none;
}

.activity-card.collapsed .activity-toggle svg,
.activity-card.collapsed .activity-toggle-btn svg {
    transform: rotate(-90deg);
}

.activity-body,
.page-body {
    padding: 1rem 1.25rem;
}

/* Highlight animation */
.activity-card.highlight,
.page-card.highlight,
.section-block.highlight,
.section-modern.highlight {
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0%, 100% { box-shadow: 0 0 0 0 rgba(12, 129, 228, 0); }
    25% { box-shadow: 0 0 0 3px rgba(12, 129, 228, 0.3); }
}

/* =================================================================
   CONTENT DISPLAY
   ================================================================= */

.content-display {
    min-height: 40px;
    line-height: 1.6;
    color: var(--color-text-medium);
    font-size: 0.9375rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: background-color 0.15s ease;
}

.content-display:focus {
    outline: none;
    background: rgba(99, 102, 241, 0.03);
}

.content-display.generating::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--color-primary);
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Désactivé - on utilise le placeholder JS à la place
.content-display:empty::before {
    content: 'Contenu en cours de génération...';
    color: var(--color-text-light);
    font-style: italic;
}
*/

/* Content Typography */
.content-display h3 {
    margin: 1.5rem 0 0.75rem;
    font-family: var(--font-secondary);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-black);
}

.content-display h3:first-child {
    margin-top: 0;
}

.content-display h4 {
    margin: 1.25rem 0 0.5rem;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-black);
}

.content-display p {
    margin: 0 0 0.875rem;
}

.content-display ul,
.content-display ol {
    margin: 0.5rem 0 1rem;
    padding-left: 1.75rem;
    list-style-position: outside;
}

.content-display ul {
    list-style-type: disc;
}

.content-display ol {
    list-style-type: decimal;
}

.content-display li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.content-display li::marker {
    color: var(--color-primary);
}

/* Listes imbriquées */
.content-display ul ul,
.content-display ol ul {
    list-style-type: circle;
    margin-top: 0.375rem;
    margin-bottom: 0.375rem;
}

.content-display ul ul ul,
.content-display ol ul ul {
    list-style-type: square;
}

.content-display strong {
    font-weight: 600;
    color: var(--color-black);
}

.content-display blockquote {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--color-primary);
    background: #EFF6FF;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.content-display blockquote p {
    margin: 0;
    color: var(--color-black);
}

.content-display .example {
    margin: 1rem 0;
    padding: 1rem;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--border-radius-sm);
    color: #065F46;
}

.content-display .warning {
    margin: 1rem 0;
    padding: 1rem;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--border-radius-sm);
    color: #92400E;
}

/* =================================================================
   QUIZ PREVIEW - Style moderne et éditable
   ================================================================= */

/* =================================================================
   QUIZ - Design moderne
   ================================================================= */

.quiz-preview {
    padding: 1rem;
    background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
    border-radius: var(--border-radius-md);
}

/* Badge type de question (QCM, Vrai/Faux, etc.) */
.quiz-question-type {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    background: #FEF3C7;
    color: #B45309;
    border-radius: var(--border-radius-full);
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.quiz-question {
    margin-bottom: 0.875rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.quiz-question:hover {
    box-shadow: 0 4px 12px rgba(12, 129, 228, 0.12);
    transform: translateY(-1px);
}

.quiz-question:last-child {
    margin-bottom: 0;
}

.quiz-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.quiz-question-text {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    font-weight: 500;
    color: var(--color-black);
    margin: 0;
}

.quiz-question-text strong {
    color: var(--color-primary);
    font-weight: 600;
    flex-shrink: 0;
}

/* Input pour éditer le texte de la question */
.quiz-question-input {
    flex: 1;
    border: none;
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-black);
    padding: 0.375rem 0.625rem;
    border-radius: var(--border-radius-md);
    transition: all 0.15s ease;
}

.quiz-question-input:hover {
    background: rgba(0, 0, 0, 0.04);
}

.quiz-question-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px rgba(12, 129, 228, 0.2);
}

.quiz-question-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.quiz-question:hover .quiz-question-actions {
    opacity: 1;
}

.quiz-question-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-question-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-medium);
}

.quiz-question-btn.delete:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.quiz-question-number {
    min-width: 26px;
    height: 26px;
    background: var(--gradient-main);
    color: white;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-left: 2.25rem;
    list-style: none;
    margin: 0;
}

.quiz-answers li,
.quiz-answer {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: #FAFBFC;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius-md);
    font-size: 0.8125rem;
    color: var(--color-text-medium);
    transition: all 0.15s ease;
}

/* Bouton pour marquer comme bonne réponse */
.answer-check {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.6875rem;
    color: transparent;
    background: white;
    border: 2px solid #D1D5DB;
    transition: all 0.15s ease;
}

.answer-check:hover {
    border-color: #10B981;
    background: #ECFDF5;
}

.quiz-answers li.correct .answer-check,
.answer-item.correct .answer-check,
.answer-check.is-correct {
    background: #10B981;
    border-color: #10B981;
    color: white;
}

/* Input pour éditer le texte de la réponse */
.quiz-answer-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    color: var(--color-text-medium);
    padding: 0.25rem 0.375rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.15s ease;
}

.quiz-answer-input:hover {
    background: rgba(255, 255, 255, 0.8);
}

.quiz-answer-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px rgba(12, 129, 228, 0.15);
}

.quiz-answers li.correct .quiz-answer-input {
    color: #065F46;
    font-weight: 500;
}

.quiz-answers li:hover,
.quiz-answer:hover {
    background: white;
    border-color: #D1D5DB;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.quiz-answers li.correct,
.quiz-answer.correct {
    background: #ECFDF5;
    border-color: #6EE7B7;
}

/* Bouton ajouter question */
.quiz-add-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    margin-top: 1rem;
    background: transparent;
    border: 2px dashed rgba(12, 129, 228, 0.25);
    border-radius: var(--border-radius-md);
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-add-question:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(12, 129, 228, 0.06);
}

/* État vide du quiz */
.quiz-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--color-gray-dark);
    font-size: var(--font-size-sm);
    font-style: italic;
}

/* Bouton ajouter une réponse */
.quiz-add-answer {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin-top: 0.5rem;
    background: transparent;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-light);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-add-answer:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(12, 129, 228, 0.03);
}

.quiz-add-answer:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Bouton supprimer réponse */
.answer-delete {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--color-text-light);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.quiz-answers li:hover .answer-delete {
    opacity: 1;
}

.answer-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

/* =================================================================
   QUIZ ONLY MODE (Mode Quiz Uniquement)
   ================================================================= */

.quiz-only-card {
    border: 1px solid rgba(12, 129, 228, 0.12);
    background: linear-gradient(180deg, rgba(12, 129, 228, 0.03) 0%, #FFFFFF 100%);
}

.quiz-only-card .activity-badge--quiz {
    background: var(--gradient-main);
    color: white;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
}

.quiz-only-card .quiz-questions-count {
    font-size: 0.8125rem;
    color: var(--color-primary);
    background: rgba(12, 129, 228, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-weight: 500;
    margin-left: auto;
    margin-right: 0.5rem;
}

.quiz-only-card .quiz-questions {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.quiz-only-card .quiz-question {
    background: white;
    border: 1px solid rgba(12, 129, 228, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* =================================================================
   SECTION QUIZ-ONLY - Même style que les autres sections
   ================================================================= */

/* Le section-block quiz-only hérite du style de base */
.section-block--quiz-only {
    background: var(--color-white);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: none;
}

/* Le section-header quiz hérite du style de base .section-header */
/* Pas besoin de redéfinir - il utilise déjà les bons styles */

/* =================================================================
   TOC STYLES - Quiz items
   ================================================================= */

/* TOC item avec sous-titre (nombre de questions) */
.toc-item--with-subtitle {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.toc-item--with-subtitle > span:first-child {
    font-weight: 500;
}

.toc-item-subtitle {
    font-size: 0.6875rem;
    color: var(--color-text-light);
    margin: 0;
}

/* =================================================================
   AUDIO ACTIVITY
   ================================================================= */

.audio-activity-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-text-source {
    min-height: 80px;
    padding: 0.75rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text-medium);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.audio-text-source:focus {
    border-color: var(--color-primary);
}

.audio-text-source:empty::before {
    content: 'Entrez le texte à convertir en audio...';
    color: var(--color-text-light);
    font-style: italic;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.audio-voice-select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-black);
    cursor: pointer;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230C81E4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.audio-voice-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.generate-audio-btn,
.audio-generate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    font-family: var(--font-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.generate-audio-btn:hover:not(:disabled),
.audio-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #DB2777 0%, #BE185D 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

.generate-audio-btn:disabled,
.audio-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-audio-btn .spinner,
.audio-generate-btn .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.audio-player-container {
    display: none;
    padding: 1rem;
    background: #FDF2F8;
    border-radius: var(--border-radius-sm);
    border: 1px solid #FBCFE8;
}

.audio-player-container.visible {
    display: block;
}

.audio-player-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #BE185D;
}

.audio-player-label svg {
    width: 18px;
    height: 18px;
}

.audio-player {
    width: 100%;
    height: 40px;
    border-radius: var(--border-radius-full);
}

.audio-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--border-radius-sm);
    color: #DC2626;
    font-size: 0.875rem;
}

/* =================================================================
   AUDIO ACTIVITY CARD (Nouvelle structure)
   ================================================================= */

.activity-card--audio {
    border-left: 4px solid #EC4899;
}

.activity-card--audio .activity-badge--audio {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.audio-activity-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-player-container {
    display: block;
    padding: 1.5rem;
    background: linear-gradient(135deg, #FDF2F8 0%, #FCE7F3 100%);
    border-radius: var(--border-radius-md);
    border: 1px solid #FBCFE8;
}

.audio-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.audio-placeholder svg {
    color: #EC4899;
    opacity: 0.6;
}

.audio-placeholder p {
    margin: 0;
    color: #9D174D;
    font-size: 0.9375rem;
}

.btn-generate-audio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-full);
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.btn-generate-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

.btn-generate-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-generate-audio.loading {
    pointer-events: none;
}

.btn-generate-audio.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

.audio-script-details {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.audio-script-details summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-medium);
    background: rgba(0, 0, 0, 0.02);
    transition: background 0.2s ease;
}

.audio-script-details summary:hover {
    background: rgba(0, 0, 0, 0.04);
}

.audio-script-details[open] summary {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.audio-script-details .content-display {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-medium);
    max-height: 300px;
    overflow-y: auto;
}

/* Audio player visible (quand l'audio est généré) */
.audio-player-generated {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audio-player-generated audio {
    width: 100%;
}

.audio-player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9D174D;
}

/* =================================================================
   GLOSSARY PREVIEW
   ================================================================= */

.glossary-list,
.glossary-terms-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.glossary-item,
.glossary-term-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: #ECFDF5;
    border-radius: var(--border-radius-sm);
    border: 1px solid #A7F3D0;
}

.glossary-term,
.glossary-term-item dt {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: #065F46;
    margin: 0;
}

.glossary-definition,
.glossary-term-item dd {
    color: #047857;
    margin: 0;
    line-height: 1.5;
}

/* Glossary editable (mode edition) */
.glossary-terms {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.glossary-term-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #F8FAFC;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.glossary-term-row:hover {
    background: #F1F5F9;
    border-color: rgba(0, 0, 0, 0.08);
}

.term-word,
.term-definition {
    padding: 0.5rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
}

.term-word {
    font-weight: 600;
    color: #065F46;
}

.term-definition {
    color: var(--color-text-medium);
}

.term-word:focus,
.term-definition:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(12, 129, 228, 0.1);
}

.term-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--color-text-light);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.glossary-term-row:hover .term-delete {
    opacity: 1;
}

.term-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

/* =================================================================
   CREDITS
   ================================================================= */

.credits-block {
    padding: 1.5rem;
    background: #EFF6FF;
    border-radius: var(--border-radius-md);
    text-align: center;
    border: 1px solid #BFDBFE;
}

.credits-block p {
    margin: 0;
    font-family: var(--font-secondary);
    font-weight: 500;
    color: #1E40AF;
}

/* =================================================================
   LEGACY SUPPORT
   ================================================================= */

.section-modern {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.section-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--gradient-main);
    color: white;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.collapse-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    color: white;
    cursor: pointer;
}

.section-title-modern {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
}

.activity-modern {
    background: white;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    scroll-margin-top: 20px;
}

.activity-header-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #FAFBFC;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.activity-title-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.activity-type-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--border-radius-full);
    font-size: 0.6875rem;
    font-family: var(--font-secondary);
    font-weight: 700;
    text-transform: uppercase;
}

.activity-type-badge[data-type="intro"],
.activity-type-badge[data-type="page"] {
    background: #DBEAFE;
    color: #1D4ED8;
}

.activity-type-badge[data-type="quiz"] {
    background: #FEF3C7;
    color: #D97706;
}

.activity-type-badge[data-type="glossary"] {
    background: #D1FAE5;
    color: #059669;
}

.activity-title-modern {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-black);
}

.activity-modern .activity-body {
    padding: 0;
}

.content-wrapper {
    padding: 1.25rem;
}

.activity-content-display {
    min-height: 60px;
    line-height: 1.7;
    color: var(--color-text-medium);
    font-size: 0.9375rem;
}

.activity-content-display.generating::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--color-primary);
}

/* Désactivé - on utilise le placeholder JS à la place
.activity-content-display:empty::before {
    content: 'Contenu en cours de génération...';
    color: var(--color-text-light);
    font-style: italic;
}
*/

.activity-content-display h3 {
    margin: 1.5rem 0 0.75rem;
    font-family: var(--font-secondary);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-black);
}

.activity-content-display h3:first-child {
    margin-top: 0;
}

.activity-content-display h4 {
    margin: 1.25rem 0 0.5rem;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-black);
}

.activity-content-display p {
    margin: 0 0 0.875rem;
}

.activity-content-display ul,
.activity-content-display ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.activity-content-display li {
    margin-bottom: 0.375rem;
}

.activity-content-display strong {
    font-weight: 600;
    color: var(--color-black);
}

.activity-content-display blockquote {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--color-primary);
    background: #EFF6FF;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.activity-content-display blockquote p {
    margin: 0;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-radius: var(--border-radius-lg);
    border: 2px dashed rgba(12, 129, 228, 0.2);
}

.empty-state p {
    margin: 0;
    font-family: var(--font-secondary);
    color: var(--color-text-medium);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 1024px) {
    .editor-sidebar {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .main-content:has(.moodia-editor-page) {
        padding: 0.5rem;
    }

    .moodia-editor-page {
        border-radius: var(--border-radius-lg);
    }

    .editor-header {
        padding: 0.875rem 1rem;
    }

    .editor-header__title {
        font-size: 1rem;
    }

    .editor-layout {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .editor-main {
        padding: 1.5rem;
    }

    .section-header {
        padding: 0.875rem 1rem;
    }

    .section-content {
        padding: 1rem;
    }

    .glossary-item,
    .glossary-term-item {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    .audio-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .audio-voice-select,
    .generate-audio-btn {
        width: 100%;
    }
}

/* =================================================================
   ACCESSIBILITY
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* =================================================================
   EMPTY STATE MESSAGES
   ================================================================= */

.empty-activities-message,
.empty-sections-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #F8FAFC;
    border: 2px dashed #E2E8F0;
    border-radius: var(--border-radius-lg);
}

.empty-message-icon {
    color: #94A3B8;
    margin-bottom: 1rem;
}

.empty-message-text {
    color: #64748B;
    font-size: 0.9375rem;
    font-family: var(--font-secondary);
    margin: 0 0 1.25rem 0;
}

.empty-activities-message .add-activity-btn,
.empty-sections-message .add-section-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.empty-activities-message .add-activity-btn:hover,
.empty-sections-message .add-section-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* =================================================================
   QUIZ EDITOR - Nouvelle structure
   ================================================================= */

/* Select type de quiz (legacy - gardé pour compatibilité) */
.quiz-type-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid #E2E8F0;
    border-radius: var(--border-radius-sm);
    font-size: 0.65rem;
    font-family: var(--font-secondary);
    font-weight: 600;
    color: #64748B;
    cursor: not-allowed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
    background-size: 10px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Container des questions */
.quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-left: none;
}

/* Question editor */
.quiz-question-editor {
    background: #F8FAFC;
    border: 1px solid rgba(12, 129, 228, 0.15);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(12, 129, 228, 0.06) 0%, #F8FAFC 100%);
    border-bottom: 1px solid rgba(12, 129, 228, 0.1);
}

.question-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    color: white;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.question-input {
    flex: 1;
    padding: 0.375rem 0.625rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-black);
    transition: all 0.15s ease;
}

.question-input:hover {
    border-color: #D1D5DB;
}

.question-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(12, 129, 228, 0.15);
}

.question-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.5;
    flex-shrink: 0;
}

.quiz-question-editor:hover .question-delete-btn {
    opacity: 1;
}

.question-delete-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
    opacity: 1;
}

/* Liste des réponses */
.answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius-sm);
    transition: all 0.15s ease;
}

.answer-item:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.answer-item.correct {
    background: #ECFDF5;
    border-color: #6EE7B7;
}

.answer-item.correct .answer-input {
    color: #065F46;
    font-weight: 500;
}

.answer-input {
    flex: 1;
    padding: 0.25rem 0.375rem;
    background: transparent;
    border: none;
    font-size: 0.8125rem;
    color: var(--color-text-medium);
    transition: all 0.15s ease;
}

.answer-input:focus {
    outline: none;
}

.answer-delete-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
    flex-shrink: 0;
}

.answer-item:hover .answer-delete-btn {
    opacity: 1;
}

.answer-delete-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* Bouton ajouter une réponse */
.answer-add-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0 1rem 0.75rem 1rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px dashed #D1D5DB;
    border-radius: var(--border-radius-sm);
    color: #64748B;
    font-size: 0.75rem;
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.answer-add-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(12, 129, 228, 0.05);
}

.answer-add-btn svg {
    opacity: 0.7;
}

/* Bouton ajouter une question */
.quiz-add-question-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: calc(100% - 2rem);
    margin: 0.75rem 1rem 1rem 1rem;
    padding: 0.75rem;
    background: transparent;
    border: 2px dashed rgba(12, 129, 228, 0.25);
    border-radius: var(--border-radius-md);
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-add-question-btn:hover {
    border-color: var(--color-primary);
    background: rgba(12, 129, 228, 0.06);
}

/* =================================================================
   SECTION ANNEXES (Documents additionnels)
   Section non supprimable contenant glossaire et crédits
   ================================================================= */

.section-block--annexes {
    background: linear-gradient(180deg, #FAFBFC 0%, #F5F7FA 100%);
    border: 1px dashed #CBD5E1;
}

.section-header--annexes {
    background: linear-gradient(135deg, #64748B 0%, #475569 100%);
    padding: 0.875rem 1.25rem;
}

.section-title-readonly {
    flex: 1;
    font-family: var(--font-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
}

/* Contenu en lecture seule (crédits) */
.content-display--readonly {
    color: var(--color-text-medium);
    pointer-events: none;
    user-select: none;
}

/* TOC Section Annexes */
.toc-section--annexes {
    margin-top: 1rem;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
}

.toc-section--annexes .toc-section-header {
    border-left: 3px solid #64748B;
}

.toc-section-title--annexes {
    color: #475569;
}

.toc-section-title--annexes:hover {
    color: #334155;
}

.toc-section-title--annexes .toc-section-icon {
    color: #64748B;
}

/* =================================================================
   SIDEBAR FOOTER
   ================================================================= */

.sidebar-footer {
    padding: 1rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: auto;
}

/* Override du hover pour cohérence avec la sidebar */
.sidebar-footer .btn {
    transition: all 0.15s ease;
}

.sidebar-footer .btn:hover:not(:disabled) {
    transform: none;
    opacity: 0.85;
    color: white;
}

/* Responsive adjustment for sidebar footer */
@media (max-width: 768px) {
    .sidebar-footer {
        padding: 0.75rem;
    }
}

/* =================================================================
   ACTIVITY BADGE - Badge simple pour le type d'activité
   ================================================================= */

.activity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-radius: var(--border-radius-full);
    flex-shrink: 0;
}

.activity-badge--page {
    background: #EEF2FF;
    color: #4F46E5;
}

.activity-badge--quiz {
    background: #FEF3C7;
    color: #B45309;
}

.activity-badge--audio {
    background: #FCE7F3;
    color: #BE185D;
}

.activity-badge--intro {
    background: #EEF2FF;
    color: #4F46E5;
}

/* =================================================================
   ACTIVITY MODAL - Modal d'ajout d'activité style Moodle
   ================================================================= */

.activity-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalOverlayIn 0.2s ease-out;
}

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

.activity-modal {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}

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

.activity-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.activity-modal__title {
    margin: 0;
    font-family: var(--font-secondary);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-black);
}

.activity-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-md);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.15s ease;
}

.activity-modal__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

.activity-modal__body {
    padding: 1.5rem;
}

.activity-modal__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.activity-modal__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.02);
    border: 2px solid transparent;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.activity-modal__item:hover {
    background: rgba(12, 129, 228, 0.05);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.activity-modal__item--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.activity-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease;
}

.activity-modal__icon--page {
    background: #EEF2FF;
    color: #4F46E5;
}

.activity-modal__item:hover .activity-modal__icon--page {
    background: #E0E7FF;
}

.activity-modal__icon--quiz {
    background: #FEF3C7;
    color: #B45309;
}

.activity-modal__item:hover .activity-modal__icon--quiz {
    background: #FDE68A;
}

.activity-modal__icon--audio {
    background: #FCE7F3;
    color: #BE185D;
}

.activity-modal__item:hover .activity-modal__icon--audio {
    background: #FBCFE8;
}

.activity-modal__label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-black);
}

.activity-modal__desc {
    font-size: 0.75rem;
    color: var(--color-text-light);
    line-height: 1.4;
}

.activity-modal__coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    border-radius: var(--border-radius-md);
    color: #64748B;
    font-size: 0.8125rem;
    font-style: italic;
}

.activity-modal__coming-soon svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 500px) {
    .activity-modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .activity-modal__grid {
        grid-template-columns: 1fr;
    }

    .activity-modal__item {
        flex-direction: row;
        text-align: left;
        padding: 1rem;
    }

    .activity-modal__icon {
        width: 48px;
        height: 48px;
    }

    .activity-modal__icon svg {
        width: 24px;
        height: 24px;
    }
}

/* =================================================================
   IMAGES DU COURS
   ================================================================= */

.content-display figure.course-image,
.activity-content figure.course-image {
    display: block;
    margin: 1.5rem auto;
    padding: 0;
    max-width: 70%;
    width: auto;
}

.content-display figure.course-image img,
.activity-content figure.course-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.content-display figure.course-image figcaption,
.activity-content figure.course-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* Images simples sans figure */
.content-display img:not([class]),
.activity-content img:not([class]) {
    display: block;
    max-width: 70%;
    height: auto;
    margin: 1.5rem auto;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .content-display figure.course-image,
    .activity-content figure.course-image {
        max-width: 95%;
    }

    .content-display img:not([class]),
    .activity-content img:not([class]) {
        max-width: 95%;
    }
}

/* =================================================================
   GALERIE D'IMAGES (Documents additionnels)
   ================================================================= */

.activity-card--gallery {
    border-left-color: #10b981;
}

.activity-badge--gallery {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: #d1fae5;
    color: #065f46;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
}

.activity-badge--gallery svg {
    width: 14px;
    height: 14px;
}

.toc-item-badge--gallery {
    background: #d1fae5;
    color: #065f46;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

.gallery-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.gallery-item:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.gallery-item-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

.gallery-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.gallery-item-page {
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
    background: #d1fae5;
    padding: 0.15rem 0.5rem;
    border-radius: var(--border-radius-sm);
}

.gallery-item-size {
    font-size: 0.7rem;
    color: #6b7280;
}

.gallery-item-description {
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.4;
    background: white;
    border-top: 1px solid #f3f4f6;
}

/* Responsive galerie */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .gallery-item-description {
        font-size: 0.75rem;
    }
}

/* ============================================================================
   SOURCE PDF (Document de base)
   ============================================================================ */

.source-pdf-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.source-pdf-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.source-pdf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f59e0b;
    border-radius: 8px;
    color: white;
}

.source-pdf-icon svg {
    width: 18px;
    height: 18px;
}

.source-pdf-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #92400e;
}

.source-pdf-download {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #b45309;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.source-pdf-download:hover {
    background: #fffbeb;
    border-color: #d97706;
    color: #92400e;
}

.source-pdf-download svg {
    width: 16px;
    height: 16px;
}

.source-pdf-description {
    font-size: 0.8125rem;
    color: #78716c;
    margin: 0;
    font-style: italic;
}

/* Resource activity icon */
.activity-icon--resource {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
