/* =================================================================
   MOODIA - PAGE DE GÉNÉRATION DE COURS
   Design moderne avec étapes guidées
   ================================================================= */

/* Container Principal */
.moodia-container {
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-xl);
    min-height: calc(100vh - 120px);
}

/* =================================================================
   HEADER MODERNE
   ================================================================= */
.moodia-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.moodia-header__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(12, 129, 228, 0.08);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius-full);
    margin-bottom: var(--spacing-lg);
    border: 1px solid rgba(12, 129, 228, 0.15);
}

.moodia-header__badge svg {
    color: var(--color-primary);
}

.moodia-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: var(--spacing-md);
    font-family: var(--font-secondary);
    line-height: 1.2;
}

.moodia-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-gray-dark);
    font-weight: var(--font-weight-normal);
    max-width: 600px;
    margin: 0 auto;
}

/* =================================================================
   PROGRESS STEPS - Design minimaliste moderne
   ================================================================= */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-3xl);
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-md);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 0 0 auto;
}

.progress-step__circle {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-xl);
    background: var(--color-white);
    color: var(--color-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-gray);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-step__circle svg {
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step__label {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step__line {
    flex: 0 0 40px;
    height: 2px;
    background: var(--color-gray);
    align-self: flex-start;
    margin-top: 27px;
    border-radius: var(--border-radius-full);
    position: relative;
    overflow: hidden;
}

.progress-step__line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--color-success);
    transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active Step */
.progress-step--active .progress-step__circle {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(12, 129, 228, 0.15);
    transform: scale(1.05);
}

.progress-step--active .progress-step__circle svg {
    transform: scale(1.1);
}

.progress-step--active .progress-step__label {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Completed Step */
.progress-step--completed .progress-step__circle {
    background: var(--color-success);
    color: var(--color-white);
    border-color: transparent;
}

.progress-step--completed + .progress-step__line::after {
    width: 100%;
}

@keyframes labelPop {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Completed Step Animations */
.progress-step--completed .progress-step__circle {
    background-color: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
    animation: stepComplete 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes stepComplete {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

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

/* Progress Line Fill Animation */
.progress-step--completed + .progress-step__line {
    background-color: var(--color-success);
}

.progress-step--completed + .progress-step__line::before {
    left: 0;
}

/* Checkmark animation pour les étapes complétées */
.progress-step--completed .progress-step__circle svg {
    display: none; /* Cache l'icône SVG */
}

.progress-step--completed .progress-step__circle::after {
    content: '✓';
    position: absolute;
    font-size: 1.25rem;
    font-weight: 700;
    animation: checkmarkDraw 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

@keyframes checkmarkDraw {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Step Container */
.moodia-step {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* =================================================================
   STYLES GLOBAUX DES STEPS (réutilisables)
   ================================================================= */

/* Header de Step */
.step-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.step-title {
    font-size: 1.875rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-secondary);
}

.step-description {
    font-size: var(--font-size-base);
    color: var(--color-gray-dark);
    max-width: 500px;
    margin: 0 auto;
}

/* Actions de Step */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-2xl);
}

/* ========================================
   MICRO-ANIMATIONS ENGAGEANTES
   ======================================== */

/* Enhanced Button Animations */
.btn,
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before,
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before,
.btn-primary:hover::before,
.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

/* Card Hover Effects - Désactivé pour éviter le lift */
.moodia-card {
    transition: box-shadow 0.3s ease;
}

/* Input Focus Animations */
.input,
input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(48, 147, 68, 0.15), 0 0 0 3px rgba(48, 147, 68, 0.1);
}

/* Upload Zone Enhanced Animations - Désactivé car trop agressif */

/* Section Collapse Animation Enhanced */
.section-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

.section-content.collapsed {
    transform: scaleY(0);
    opacity: 0;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Activity Hover Effects */
.activity-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-modern:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Badge Animations */
.stat-badge {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

@keyframes badgePop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Icon Bounce on Hover - Icône d'upload désactivée */
.loading-icon,
.success-icon {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Notification Slide In */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Success State Celebration */
.moodia-card--success {
    animation: successCelebrate 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successCelebrate {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.success-icon {
    animation: successIconBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successIconBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-10deg);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
    }
}

/* Moodle Link Hover Animation */
.moodle-course-link {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.moodle-course-link:hover {
    transform: translateY(-4px) scale(1.02);
}

.moodle-course-link:active {
    transform: translateY(-2px) scale(1);
}

/* Add Activity/Section Button Pulse */
.add-activity-btn,
.add-section-btn-main {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.add-activity-btn:hover,
.add-section-btn-main:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(48, 147, 68, 0.15);
}

.add-activity-btn:active,
.add-section-btn-main:active {
    transform: scale(0.98);
}

/* Delete Button Shake on Hover */
.delete-btn:hover,
.delete-btn-small:hover,
.delete-btn-tiny:hover {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Quiz Question Appear */
.quiz-question-item {
    animation: questionAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes questionAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger animations for lists */
.quiz-question-item:nth-child(1) { animation-delay: 0s; }
.quiz-question-item:nth-child(2) { animation-delay: 0.05s; }
.quiz-question-item:nth-child(3) { animation-delay: 0.1s; }
.quiz-question-item:nth-child(4) { animation-delay: 0.15s; }
.quiz-question-item:nth-child(5) { animation-delay: 0.2s; }

/* Activity Settings Panel Slide */
.activity-settings-panel__content {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-settings-panel.is-visible .activity-settings-panel__content {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* =================================================================
   CARD DE BASE
   ================================================================= */
.moodia-card {
    background: var(--color-white);
    border-radius: var(--border-radius-2xl);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06),
                0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-gray);
}

/* =================================================================
   IMPORT DES STEPS
   Les imports CSS des steps sont gérés dans app.js pour AssetMapper
   ================================================================= */

/* Step 3: Loading */
.moodia-card--loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.spinner {
    width: 80px;
    height: 80px;
    border: 6px solid #e5f2fc;
    border-top-color: #0C81E4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-messages {
    margin-top: var(--spacing-md);
}

.loading-message {
    font-size: 1.125rem;
    color: var(--color-dark);
    font-weight: 500;
    min-height: 1.5em;
}

/* ========================================
   MODERN LOADING SKELETON (Step 3)
   ======================================== */

.loading-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
}

.loading-icon {
    width: 64px;
    height: 64px;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.loading-icon-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: drawCircle 2s ease-in-out infinite;
}

@keyframes drawCircle {
    0% {
        stroke-dashoffset: 60;
        transform: rotate(0deg);
        transform-origin: center;
    }
    50% {
        stroke-dashoffset: 0;
        transform: rotate(180deg);
        transform-origin: center;
    }
    100% {
        stroke-dashoffset: 60;
        transform: rotate(360deg);
        transform-origin: center;
    }
}

.loading-icon-check {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: drawCheck 2s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes drawCheck {
    0%, 40% {
        stroke-dashoffset: 20;
    }
    60%, 100% {
        stroke-dashoffset: 0;
    }
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0;
}

.loading-subtitle {
    font-size: 1rem;
    color: var(--color-gray);
    margin: 0;
    min-height: 1.5em;
    animation: fadeIn 0.5s ease-in-out;
}

/* Progress Bar */
.loading-progress {
    width: 100%;
    max-width: 500px;
    margin: var(--spacing-xl) auto;
}

.loading-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #27ae60, var(--color-primary));
    background-size: 200% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s linear infinite;
}

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

.loading-progress-text {
    font-size: 0.875rem;
    color: var(--color-muted);
    text-align: center;
    margin: 0;
}

/* Course Skeleton */
.course-skeleton {
    width: 100%;
    max-width: 700px;
    margin: var(--spacing-2xl) auto 0;
    animation: fadeInUp 0.6s ease-out;
}

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

.skeleton-header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid #e5e7eb;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.skeleton-header.is-visible {
    opacity: 1;
    transform: scale(1);
}

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

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

.skeleton-line--title {
    width: 70%;
    height: 32px;
    margin-bottom: var(--spacing-md);
}

.skeleton-line--section {
    width: 60%;
    height: 18px;
}

.skeleton-stats {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.skeleton-badge {
    width: 100px;
    height: 28px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    border-radius: 20px;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-badge:nth-child(2) {
    animation-delay: 0.2s;
}

.skeleton-section {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.skeleton-section.is-visible {
    opacity: 1;
    transform: scale(1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.skeleton-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.skeleton-circle {
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    border-radius: 50%;
    flex-shrink: 0;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-activities {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-left: calc(24px + var(--spacing-md));
}

.skeleton-activity {
    height: 50px;
    background: linear-gradient(90deg, #f9fafb 25%, #ffffff 50%, #f9fafb 75%);
    background-size: 200% 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-activity:nth-child(1) {
    animation-delay: 0.1s;
}

.skeleton-activity:nth-child(2) {
    animation-delay: 0.2s;
}

/* Step 4: Course Preview */
.course-header {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.course-title-preview {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
}

.course-stats {
    display: flex;
    gap: var(--spacing-lg);
    color: var(--color-gray);
    font-size: 0.9375rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.course-structure {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.section-preview {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.section-header {
    background-color: var(--color-light);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.section-header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.section-icon {
    font-size: 1.25rem;
}

.section-title-input {
    flex: 1;
    border: 1px solid transparent;
    background-color: transparent;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
}

.section-title-input:hover {
    background-color: var(--color-white);
    border-color: var(--color-border);
}

.section-title-input:focus {
    outline: none;
    background-color: var(--color-white);
    border-color: var(--color-primary);
}

.activities-list {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.activity-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
}

.activity-preview:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-primary);
}

.activity-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.activity-icon {
    font-size: 1.25rem;
}

.activity-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.activity-title-input {
    border: 1px solid transparent;
    background-color: transparent;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-dark);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
}

.activity-title-input:hover {
    background-color: var(--color-light);
    border-color: var(--color-border);
}

.activity-title-input:focus {
    outline: none;
    background-color: var(--color-light);
    border-color: var(--color-primary);
}

.activity-type {
    font-size: 0.8125rem;
    color: var(--color-gray);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-base);
}

.btn-icon--danger {
    color: var(--color-error);
}

.btn-icon--danger:hover {
    background-color: rgba(209, 0, 0, 0.1);
}

/* Quiz Questions Display */
.quiz-questions {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-light);
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--color-primary);
}

.quiz-questions-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.quiz-questions-list {
    list-style: none;
    counter-reset: question-counter;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.quiz-question-item {
    padding: var(--spacing-sm);
    background-color: var(--color-white);
    border-radius: var(--border-radius-sm);
    counter-increment: question-counter;
}

.quiz-question-item strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-dark);
    margin-bottom: var(--spacing-xs);
}

.quiz-question-item strong::before {
    content: counter(question-counter) ". ";
    color: var(--color-primary);
    font-weight: 700;
}

.quiz-answers {
    list-style: none;
    padding: 0;
    margin: var(--spacing-xs) 0 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.quiz-answers li {
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--color-light);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: var(--color-dark);
    border-left: 2px solid var(--color-border);
    transition: all var(--transition-base);
}

.quiz-answers li.correct-answer {
    background-color: rgba(48, 147, 68, 0.1);
    border-left-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
    position: relative;
    padding-left: calc(var(--spacing-sm) + 20px);
}

.quiz-answers li.correct-answer::before {
    content: "✓";
    position: absolute;
    left: var(--spacing-sm);
    font-weight: 700;
    color: var(--color-primary);
}

/* Step 4: Summary Preview (Alternative) */
.summary-preview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.summary-section {
    padding: var(--spacing-lg);
    background-color: var(--color-light);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
}

.summary-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.summary-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-dark);
    margin: 0;
}

.summary-params {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.param-item {
    font-size: 0.9375rem;
    color: var(--color-dark);
    padding: var(--spacing-sm);
    background-color: var(--color-white);
    border-radius: var(--border-radius-sm);
}

.param-item strong {
    color: var(--color-primary);
    margin-right: var(--spacing-xs);
}

.key-points-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.key-points-list li {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-white);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--color-primary);
    font-size: 0.9375rem;
    color: var(--color-dark);
}

.summary-usage {
    text-align: center;
    background-color: var(--color-white);
    border: 1px dashed var(--color-border);
}

.summary-usage small {
    color: var(--color-muted);
    font-size: 0.8125rem;
}

/* Step 5: Success */
.moodia-card--success {
    text-align: center;
}

.success-icon {
    margin: var(--spacing-xl) 0;
}

.success-message {
    margin: var(--spacing-xl) 0;
}

.success-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.success-details {
    font-size: 1rem;
    color: var(--color-gray);
}

/* Responsive */
@media (max-width: 768px) {
    .moodia-container {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .moodia-title {
        font-size: 2rem;
    }

    .moodia-subtitle {
        font-size: 1rem;
    }

    .step-title {
        font-size: 1.5rem;
    }

    .step-actions {
        justify-content: stretch;
    }

    .step-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .progress-steps {
        padding: 0 var(--spacing-xs);
    }

    .progress-step__label {
        font-size: 0.75rem;
    }

    .progress-step__circle {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .progress-step__line {
        margin-top: 17px;
    }

    .moodia-card {
        padding: var(--spacing-lg);
    }
}

/* ========================================
   MODERN COURSE EDITOR (Step 4)
   ======================================== */

.course-header-modern {
    margin-bottom: 32px;
}

.course-title-editable {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    padding: 12px 0;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-base);
}

.course-title-editable:hover {
    border-bottom-color: var(--color-border);
}

.course-title-editable:focus {
    outline: none;
    border-bottom-color: var(--color-primary);
}

.course-stats-modern {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

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

.stat-badge-secondary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.course-structure-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Section moderne */
.section-modern {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.section-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

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

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: transform 0.2s ease;
}

.collapse-btn.collapsed svg {
    transform: rotate(-90deg);
}

.collapse-btn:hover {
    color: #111827;
}

.section-title-modern {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-dark);
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color var(--transition-base);
}

.section-title-modern:hover {
    background: rgba(0, 0, 0, 0.03);
}

.section-title-modern:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.05);
}

.section-description {
    width: 100%;
    border: none;
    background: #f9f9f9;
    padding: 12px 20px;
    font-size: 0.875rem;
    color: #374151;
    resize: vertical;
    font-family: inherit;
}

.section-description:focus {
    outline: none;
    background: #f5f5f5;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    border-radius: 4px;
    transition: all var(--transition-base);
}

.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.section-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

/* Activity moderne */
.activity-modern {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.activity-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
    border-radius: 6px 0 0 6px;
}

.activity-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.activity-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

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

.activity-collapse-icon {
    transition: transform 0.2s ease;
}

.activity-modern.collapsed .activity-collapse-icon {
    transform: rotate(-90deg);
}

.activity-title-modern {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color var(--transition-base);
}

.activity-title-modern:hover {
    background: rgba(0, 0, 0, 0.03);
}

.activity-title-modern:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.05);
}

.activity-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    height: 38px; /* Hauteur fixe pour alignement */
}

/* Bouton Paramètres de l'activité */
.activity-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 38px;
    height: 38px;
    background: var(--color-white);
    border: var(--border-width-medium) solid var(--color-gray);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.activity-settings-btn svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.activity-settings-btn .svg-secondary {
    color: var(--color-gray-dark);
    transition: color var(--transition-base);
}

.activity-settings-btn .svg-primary {
    color: var(--color-gray);
    transition: color var(--transition-base);
}

.activity-settings-btn:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.activity-settings-btn:hover .svg-secondary {
    color: var(--color-primary);
}

.activity-settings-btn:hover .svg-primary {
    color: var(--color-primary-light);
}

.activity-settings-btn:hover svg {
    transform: rotate(90deg);
}

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

/* Activity type select styling */
.activity-type-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 38px 0 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    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='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    min-width: 135px;
    height: 38px; /* Hauteur fixe */
    line-height: 38px;
    box-sizing: border-box;
}

.activity-type-select:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.activity-type-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(48, 147, 68, 0.12);
    transform: translateY(0);
}

.activity-type-select option {
    padding: 8px;
    font-weight: 600;
}

.activity-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
    background: rgba(48, 147, 68, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.delete-btn-small {
    background: rgba(243, 244, 246, 0.8);
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 38px;
    height: 38px; /* Même hauteur que les autres */
    flex-shrink: 0;
    box-sizing: border-box;
}

.delete-btn-small:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.delete-btn-small:active {
    transform: translateY(0) scale(1);
}

/* Modal de changement de type d'activité */
.activity-type-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.activity-type-modal.is-visible {
    display: block;
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.activity-type-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease;
}

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

.activity-type-modal__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.activity-type-modal__header {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.activity-type-modal__icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.activity-type-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.activity-type-modal__body {
    padding: 24px 28px;
}

.activity-type-modal__message {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 16px;
}

.activity-type-modal__message strong {
    color: #1f2937;
    font-weight: 600;
}

.activity-type-modal__message strong span {
    color: var(--color-primary);
}

.activity-type-modal__warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    color: #92400e;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.activity-type-modal__footer {
    padding: 20px 28px 28px;
    display: flex;
    gap: 12px;
    justify-content: space-around;
}

.activity-type-modal__btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.activity-type-modal__btn--cancel {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid transparent;
}

.activity-type-modal__btn--cancel:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

.activity-type-modal__btn--confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.activity-type-modal__btn--confirm:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.activity-type-modal__btn--confirm:active {
    transform: translateY(0);
}

/* Modal de confirmation de suppression (réutilise les styles de activity-type-modal) */
.activity-delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.activity-delete-modal.is-visible {
    display: block;
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-delete-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease;
}

.activity-delete-modal__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.activity-delete-modal__header {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.activity-delete-modal__icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.activity-delete-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.activity-delete-modal__body {
    padding: 24px 28px;
}

.activity-delete-modal__message {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 16px;
}

.activity-delete-modal__message strong {
    color: #1f2937;
    font-weight: 600;
}

.activity-delete-modal__message strong span {
    color: var(--color-error);
}

.activity-delete-modal__warning {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    color: #991b1b;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.activity-delete-modal__footer {
    padding: 20px 28px 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.activity-delete-modal__btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.activity-delete-modal__btn--cancel {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid transparent;
}

.activity-delete-modal__btn--cancel:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

.activity-delete-modal__btn--confirm {
    background: linear-gradient(135deg, var(--color-error) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(209, 0, 0, 0.3);
}

.activity-delete-modal__btn--confirm:hover {
    box-shadow: 0 6px 16px rgba(209, 0, 0, 0.4);
    transform: translateY(-2px);
}

.activity-delete-modal__btn--confirm:active {
    transform: translateY(0);
}

/* Modal de suppression de section */
.section-delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.section-delete-modal.is-visible {
    display: block;
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-delete-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease;
}

.section-delete-modal__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-delete-modal__header {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.section-delete-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.section-delete-modal__body {
    padding: 24px 28px;
}

.section-delete-modal__message {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 16px;
}

.section-delete-modal__message strong {
    color: #1f2937;
    font-weight: 600;
}

.section-delete-modal__message strong span {
    color: var(--color-error);
}

.section-delete-modal__warning {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    color: #991b1b;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.section-delete-modal__footer {
    padding: 20px 28px 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.section-delete-modal__btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.section-delete-modal__btn--cancel {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid transparent;
}

.section-delete-modal__btn--cancel:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

.section-delete-modal__btn--confirm {
    background: linear-gradient(135deg, var(--color-error) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(209, 0, 0, 0.3);
}

.section-delete-modal__btn--confirm:hover {
    box-shadow: 0 6px 16px rgba(209, 0, 0, 0.4);
    transform: translateY(-2px);
}

.section-delete-modal__btn--confirm:active {
    transform: translateY(0);
}

/* Panneau de paramètres de l'activité */
.activity-settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-index-modal);
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear 0.3s; /* Devient invisible après 0.3s */
}

.activity-settings-panel.is-visible {
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s; /* Devient visible immédiatement */
}

.activity-settings-panel__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 45, 45, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.activity-settings-panel.is-visible .activity-settings-panel__overlay {
    opacity: 1;
}

.activity-settings-panel__content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90%;
    max-width: 500px;
    background: var(--color-white);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-settings-panel.is-visible .activity-settings-panel__content {
    transform: translateX(0);
}

.activity-settings-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: var(--border-width-thin) solid var(--color-gray);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.activity-settings-panel__title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-secondary);
    color: var(--color-white);
    margin: 0;
}

.activity-settings-panel__title svg {
    flex-shrink: 0;
}

.activity-settings-panel__title .svg-secondary,
.activity-settings-panel__title .svg-primary {
    color: var(--color-white);
}

.activity-settings-panel__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: var(--border-radius-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-white);
}

.activity-settings-panel__close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.activity-settings-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

/* Paramètre individuel (style Duolingo - en ligne) */
.activity-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    background: var(--color-white);
    border: var(--border-width-medium) solid var(--color-gray);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    user-select: none;
}

.activity-setting:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.activity-setting:active {
    transform: translateY(0);
}

.activity-setting__content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.activity-setting__icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.activity-setting__info {
    flex: 1;
}

.activity-setting__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-secondary);
    color: var(--color-black);
    margin: 0 0 4px;
}

.activity-setting__description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--color-gray-dark);
    margin: 0;
}

.activity-setting__control {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Toggle switch moderne */
.activity-setting__toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.activity-setting__toggle-label {
    position: relative;
    display: block;
    width: 56px;
    height: 28px;
    background: var(--color-gray);
    border-radius: var(--border-radius-full);
    transition: all var(--transition-base);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.activity-setting__toggle-label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--color-white);
    border-radius: 50%;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.activity-setting__toggle:checked + .activity-setting__toggle-label {
    background: linear-gradient(135deg, var(--color-success) 0%, #237a33 100%);
    box-shadow: 0 0 12px rgba(48, 147, 68, 0.5);
}

.activity-setting__toggle:checked + .activity-setting__toggle-label::after {
    left: 31px;
    box-shadow: var(--shadow-md);
}

/* Placeholder pour futurs paramètres */
.activity-setting--placeholder {
    background: var(--color-gray-light);
    border-style: dashed;
    border-color: var(--color-gray);
    cursor: default;
}

.activity-setting--placeholder:hover {
    border-color: var(--color-gray);
    box-shadow: none;
    transform: none;
}

.activity-setting__placeholder {
    text-align: center;
    padding: var(--spacing-xl);
}

.activity-setting__placeholder svg {
    color: var(--color-gray-dark);
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.activity-setting__placeholder p {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    margin: 0;
    font-style: italic;
}

.activity-settings-panel__footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: var(--border-width-thin) solid var(--color-gray);
    background: var(--color-gray-light);
}

.activity-settings-panel__btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
}

.activity-settings-panel__btn--close {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.activity-settings-panel__btn--close:hover {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.activity-content-editor {
    width: 100%;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    padding: 12px;
    font-size: 0.875rem;
    color: var(--color-dark);
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color var(--transition-base);
    min-height: 120px;
}

.activity-content-editor:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* HTML Content Rendering */
.activity-content-display {
    width: 100%;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    padding: 16px;
    font-size: 0.875rem;
    color: var(--color-dark);
    border-radius: 4px;
    line-height: 1.6;
    min-height: 60px;
}

.activity-content-display h1,
.activity-content-display h2,
.activity-content-display h3,
.activity-content-display h4 {
    font-weight: 600;
    color: var(--color-dark);
    margin-top: 16px;
    margin-bottom: 8px;
}

.activity-content-display h1 { font-size: 1.5rem; }
.activity-content-display h2 { font-size: 1.25rem; }
.activity-content-display h3 { font-size: 1.125rem; }
.activity-content-display h4 { font-size: 1rem; }

.activity-content-display h1:first-child,
.activity-content-display h2:first-child,
.activity-content-display h3:first-child,
.activity-content-display h4:first-child {
    margin-top: 0;
}

.activity-content-display p {
    margin-bottom: 12px;
}

.activity-content-display ul,
.activity-content-display ol {
    margin-left: 24px;
    margin-bottom: 12px;
}

.activity-content-display li {
    margin-bottom: 6px;
}

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

.activity-content-display em {
    font-style: italic;
}

.activity-content-display code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
}

.activity-content-display pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.activity-content-display blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 16px;
    margin-left: 0;
    margin-bottom: 12px;
    font-style: italic;
    color: #4b5563;
}

.content-toggle-btn {
    background: #f3f4f6;
    border: 1px solid var(--color-border);
    color: #4b5563;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: 8px;
}

.content-toggle-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Quiz Editor */
.quiz-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.quiz-question-editor {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-input {
    flex: 1;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    padding: 10px 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-dark);
    border-radius: 4px;
    transition: border-color var(--transition-base);
}

.question-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.answers-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 8px;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafafa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all var(--transition-base);
}

.answer-item:hover {
    border-color: var(--color-border);
}

.answer-item:has(input[type="radio"]:checked) {
    background: #d1fae5;
    border-color: #10b981;
}

.answer-item:has(input[type="radio"]:checked) .answer-input {
    background: transparent;
    font-weight: 500;
    color: #065f46;
}

.answer-item input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.answer-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 0.875rem;
    color: var(--color-dark);
    border-radius: 4px;
    transition: background-color var(--transition-base);
}

.answer-input:hover {
    background: rgba(0, 0, 0, 0.02);
}

.answer-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.04);
}

.delete-btn-tiny {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    border-radius: 3px;
    transition: all var(--transition-base);
}

.delete-btn-tiny:hover {
    background: #fee2e2;
    color: #dc2626;
}

.add-answer-btn,
.add-question-btn,
.add-activity-btn,
.add-section-btn-main {
    background: none;
    border: 1px dashed #d1d5db;
    color: #4b5563;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: block;
    margin: 16px auto 0;
    text-align: center;
}

.add-answer-btn:hover,
.add-question-btn:hover,
.add-activity-btn:hover,
.add-section-btn-main:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(48, 147, 68, 0.02);
}

.add-section-btn-main {
    margin-top: 20px;
    padding: 14px 20px;
    font-size: 0.9375rem;
}

/* Bouton lien vers le cours Moodle */
.moodle-course-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #309344 0%, #27a844 100%);
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(48, 147, 68, 0.3);
    margin-top: 20px;
}

.moodle-course-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(48, 147, 68, 0.4);
    background: linear-gradient(135deg, #27a844 0%, #309344 100%);
    color: white;
}

.moodle-course-link svg {
    flex-shrink: 0;
}

/* Responsive pour le mode moderne */
@media (max-width: 768px) {
    .course-title-editable {
        font-size: 1.5rem;
    }

    .section-header-modern {
        padding: 12px 16px;
    }

    .section-content {
        padding: 16px;
    }

    .activity-modern {
        padding: 12px;
    }

    .activity-header-modern {
        flex-wrap: wrap;
    }

    .moodle-course-link {
        font-size: 1rem;
        padding: 14px 24px;
    }
}
