body {
    font-family: 'Outfit', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar-active {
    background-color: rgb(238 242 255 / 0.4);
    color: #312e81;
    border-left: 5px solid #4f46e5;
    font-weight: 700;
    transform: translateX(4px);
}

.transition-sidebar {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent horizontal scroll in resource list */
#resource-list {
    overflow-x: hidden;
}

#resource-list button {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nouveau format de Fiche "Jeu de Prompts" */
.fiche-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.badge-objectif {
    background: #fef2f2;
    color: #b91c1c;
}

.badge-gain {
    background: #f0fdf4;
    color: #15803d;
}

.badge-workflow {
    background: #eff6ff;
    color: #1d4ed8;
}

.fiche-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.fiche-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

.fiche-objectif {
    font-size: 1.1rem;
    color: #334155;
    font-weight: 400;
    line-height: 1.5;
}

.fiche-gain {
    font-size: 1rem;
    color: #15803d;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Typographie Contenu */
.lesson-content {
    line-height: 1.9;
    color: #334155;
    max-width: 100%;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .lesson-content {
        text-align: left;
    }
}

@media (min-width: 769px) {
    .lesson-content {
        text-align: justify;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: none;
    }
}

.lesson-content p {
    margin-bottom: 1.4em;
}

.lesson-content p:empty::before,
.lesson-content p:has(> br:only-child)::before {
    content: "\00a0";
    display: block;
}

.lesson-content hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2.5em 0;
}

.lesson-content h1 {
    color: #0f172a;
    font-weight: 900;
    font-size: 1.875rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.lesson-content h2 {
    color: #4f46e5;
    font-weight: 800;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #4f46e5;
    padding-left: 1rem;
}

.lesson-content h3 {
    color: #334155;
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.lesson-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-content ol {
    list-style-type: decimal;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.lesson-content a {
    color: #4f46e5;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: color 0.2s;
}

.lesson-content a:hover {
    color: #3730a3;
}

.lesson-content blockquote {
    border-left: 4px solid #4f46e5;
    background: #f5f3ff;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #334155;
    font-style: italic;
}

/* Prompt Box (Copiable) */
.prompt-box {
    background: #1e293b;
    color: #f1f5f9;
    padding: 1.5rem;
    border-radius: 1rem;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    position: relative;
    border: 1px solid #334155;
}

.prompt-box::before {
    content: 'PROMPT';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #4f46e5;
    color: white;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Tableaux Premium */
.lesson-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

.lesson-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 1rem;
    overflow: hidden;
}

.lesson-content th {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #64748b;
}

.lesson-content td {
    padding: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Navigation & Header */
@media (max-width: 1023px) {
    header {
        background: rgba(255, 255, 255, 0.9);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

@media (min-width: 1024px) {
    header {
        background: #fff;
        min-height: fit-content;
        overflow: hidden;
    }
}

/* Desktop nav: no scroll, shrink to fit */
#category-nav {
    overflow: hidden;
    flex-wrap: nowrap;
}

/* Custom Scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

/* Global thin scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Quill Editor Customization */
#edit-content {
    min-height: 350px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
}

#edit-content .ql-editor {
    min-height: 350px;
    padding: 1.5rem;
}

#edit-content .ql-editor p {
    margin-bottom: 0.5rem;
}

#editor-toolbar {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    border-color: #e2e8f0;
    background: #f8fafc;
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

#custom-editor-toolbar {
    position: sticky;
    top: 40px;
    z-index: 10;
}

#edit-content.ql-container {
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    border-color: #e2e8f0;
}

.ql-snow .ql-picker-label,
.ql-snow button {
    color: #64748b;
}

.ql-snow .ql-picker-label:hover,
.ql-snow button:hover,
.ql-snow button.ql-active,
.ql-snow .ql-picker-label.ql-active {
    color: #4f46e5;
}

.ql-snow .ql-stroke {
    stroke: #64748b;
}

.ql-snow button:hover .ql-stroke,
.ql-snow button.ql-active .ql-stroke {
    stroke: #4f46e5;
}

.ql-snow .ql-fill {
    fill: #64748b;
}

.ql-snow button:hover .ql-fill,
.ql-snow button.ql-active .ql-fill {
    fill: #4f46e5;
}

.ql-editor blockquote {
    border-left: 4px solid #4f46e5;
    background: #f5f3ff;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #334155;
}

.ql-editor pre.ql-syntax {
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 0.75rem;
    padding: 1.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

.ql-editor a {
    color: #4f46e5;
    text-decoration: underline;
}

.ql-snow .ql-tooltip {
    border-radius: 0.75rem;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.ql-editor hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 1.5em 0;
}

/* ============================================
   LOT 1 — Design & Polish
   ============================================ */

/* Text Shadow for white text on images */
.text-shadow {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Info Boxes */
.info-box {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid;
}

.info-box-success {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.info-box-error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.info-box-warning {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.info-box-admin {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.info-box-info {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

/* Spoiler / Accordion */
.lesson-content details {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px dashed #c7d2fe;
    margin: 1.5rem 0;
}

.lesson-content details summary {
    font-size: 0.875rem;
    font-weight: 700;
    color: #4f46e5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.lesson-content details summary::-webkit-details-marker {
    display: none;
}

.lesson-content details summary::before {
    content: "▶";
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    display: inline-block;
}

.lesson-content details[open] summary::before {
    transform: rotate(90deg);
}

.lesson-content details > *:not(summary) {
    padding-top: 0.75rem;
    padding-left: 1.5rem;
    border-left: 2px solid #e0e7ff;
}

/* Highlight / Mark */
.lesson-content mark,
.lesson-content .highlight {
    background: #fef08a;
    border-radius: 3px;
    padding: 1px 4px;
}

/* Strikethrough */
.lesson-content s,
.lesson-content .strikethrough {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Séparateurs stylés */
.separator {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Gradient Hero */
.gradient-hero {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 40%, #fefce8 100%);
}

/* Gradient Overlay */
.gradient-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%, transparent 100%);
}

/* Scroll Hint Gradient */
.scroll-hint-right::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.9) 40%, white 75%);
    pointer-events: none;
}

/* ============================================
   Transitions & Animations
   ============================================ */

/* Smooth transitions on all interactive elements */
a, input, select, textarea,
.fiche-card, .transition-all {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Buttons: transition color only, not transform/position */
button {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Eye toggle buttons: no transition at all */
button[onclick*="togglePwd"] {
    transition: color 0.15s;
    transform: none !important;
}

/* Modal fade in/out */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-enter {
    animation: modalFadeIn 0.25s ease-out forwards;
}

.modal-exit {
    animation: modalFadeOut 0.2s ease-in forwards;
}

/* Lightbox zoom */
@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-enter {
    animation: lightboxZoomIn 0.25s ease-out forwards;
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bounce-subtle {
    animation: bounce 0.5s ease-in-out;
}

/* Notification pulse */
@keyframes notifPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.notif-pulse {
    animation: notifPulse 2s ease-in-out infinite;
}

/* Focus visible ring */
:focus-visible {
    outline: 3px solid #818cf8;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ============================================
   Responsive Enhancements
   ============================================ */

@media (max-width: 640px) {
    .lesson-content {
        font-size: 0.9375rem;
    }

    .lesson-content h1 {
        font-size: 1.5rem;
    }

    .lesson-content h2 {
        font-size: 1.25rem;
    }

    .lesson-content h3 {
        font-size: 1.1rem;
    }

    .lesson-content blockquote {
        padding: 0.75rem 1rem;
    }

    .lesson-content table {
        font-size: 0.8125rem;
    }

    .lesson-content th,
    .lesson-content td {
        padding: 0.5rem 0.75rem;
    }

    .fiche-card {
        padding: 1rem;
        border-radius: 1rem;
    }

    .prompt-box {
        padding: 1rem;
        border-radius: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Desktop menu scrollbar */
@media (min-width: 1024px) {
    nav[aria-label="Menu principal"]::-webkit-scrollbar {
        height: 3px;
    }
}
