/* ==========================================================================
   SupTertiaire – Cours Interactifs  |  cours.css
   Design : clean editorial avec accent couleur dynamique par cours
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700;1,9..40,300&display=swap');

:root {
    --stc-accent:        #1e3a5f;
    --stc-accent-light:  color-mix(in srgb, var(--stc-accent) 15%, white);
    --stc-accent-dark:   color-mix(in srgb, var(--stc-accent) 80%, black);
    --stc-bg:            #f7f8fc;
    --stc-surface:       #ffffff;
    --stc-text:          #1a1d2e;
    --stc-text-muted:    #6b7280;
    --stc-border:        #e5e7ef;
    --stc-radius:        16px;
    --stc-radius-sm:     8px;
    --stc-shadow:        0 4px 24px rgba(0,0,0,.08);
    --stc-shadow-lg:     0 12px 48px rgba(0,0,0,.14);
    --stc-font-display:  'DM Serif Display', Georgia, serif;
    --stc-font-body:     'DM Sans', system-ui, sans-serif;
    --stc-transition:    .28s cubic-bezier(.4,0,.2,1);
}

/* ── Reset scoped ── */
.stc-viewer *, .stc-catalogue * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   VIEWER  —  conteneur principal
   ══════════════════════════════════════════════════════════════════════ */

.stc-viewer {
    font-family: var(--stc-font-body);
    color: var(--stc-text);
    background: var(--stc-bg);
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--stc-shadow-lg);
    max-width: 1200px;
    margin: 2rem auto;
}

/* ── Header ── */
.stc-viewer__header {
    background: var(--stc-accent);
    color: #fff;
    padding: 2rem 2.5rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.stc-viewer__header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(255,255,255,.12) 0%, transparent 60%);
    pointer-events: none;
}

.stc-viewer__meta {
    display: flex;
    gap: .5rem;
    margin-bottom: .75rem;
}

.stc-badge {
    font-family: var(--stc-font-body);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .25em .75em;
    border-radius: 99px;
    background: rgba(255,255,255,.18);
    color: #fff;
}

.stc-viewer__title {
    font-family: var(--stc-font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

/* ── Barre de progression ── */
.stc-progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.stc-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,.25);
    border-radius: 99px;
    overflow: hidden;
}

.stc-progress-bar__fill {
    height: 100%;
    background: #fff;
    border-radius: 99px;
    transition: width var(--stc-transition);
}

.stc-progress-label {
    font-size: .8rem;
    opacity: .85;
    white-space: nowrap;
    min-width: 48px;
    text-align: right;
}

/* ── Stage ── */
.stc-viewer__stage {
    min-height: 420px;
    position: relative;
    background: var(--stc-surface);
}

/* ── Slides ── */
.stc-slide {
    display: none;
    padding: 2.5rem 3rem;
    animation: stcFadeIn .35s ease;
}

.stc-slide--active {
    display: block;
}

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

.stc-slide__icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    line-height: 1;
}

.stc-slide__title {
    font-family: var(--stc-font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 400;
    color: var(--stc-accent);
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--stc-accent-light);
}

.stc-slide__body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--stc-text);
}

.stc-slide__body p   { margin-bottom: 1em; }
.stc-slide__body ul  { padding-left: 1.5em; margin-bottom: 1em; }
.stc-slide__body li  { margin-bottom: .4em; }
.stc-slide__body h3  { font-family: var(--stc-font-display); color: var(--stc-accent); margin: 1.25em 0 .5em; }
.stc-slide__body strong { color: var(--stc-accent-dark); }

.stc-slide__body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    font-size: .9rem;
}
.stc-slide__body th,
.stc-slide__body td {
    padding: .6em .9em;
    border: 1px solid var(--stc-border);
    text-align: left;
}
.stc-slide__body th {
    background: var(--stc-accent-light);
    color: var(--stc-accent-dark);
    font-weight: 700;
}
.stc-slide__body tr:nth-child(even) td {
    background: var(--stc-bg);
}

/* ── Écran de fin ── */
.stc-end {
    text-align: center;
    padding: 4rem 2rem;
}

.stc-end__trophy {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: stcBounce .7s ease .2s both;
}

@keyframes stcBounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Animations disponibles dans le contenu HTML des slides */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.stc-end h2 {
    font-family: var(--stc-font-display);
    font-size: 2rem;
    color: var(--stc-accent);
    margin-bottom: .5rem;
}

.stc-end p {
    color: var(--stc-text-muted);
    margin-bottom: 1.5rem;
}

/* ════════════════════════════════════════════════════════════════════════
   QUIZ
   ════════════════════════════════════════════════════════════════════════ */

.stc-quiz__title {
    color: #b45309 !important;
    border-color: #fef3c7 !important;
}

.stc-quiz__questions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stc-quiz__question {
    background: var(--stc-bg);
    border-radius: var(--stc-radius-sm);
    padding: 1.25rem;
    border: 1px solid var(--stc-border);
    transition: border-color var(--stc-transition);
}

.stc-quiz__question.is-correct  { border-color: #22c55e; background: #f0fdf4; }
.stc-quiz__question.is-wrong    { border-color: #ef4444; background: #fef2f2; }

.stc-quiz__q-text {
    font-weight: 500;
    margin-bottom: .9rem;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: 1rem;
}

.stc-quiz__q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    min-width: 1.6em;
    border-radius: 50%;
    background: var(--stc-accent);
    color: #fff;
    font-size: .78em;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: .1em;
}

.stc-quiz__answers {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.stc-quiz__answer-btn {
    width: 100%;
    text-align: left;
    background: var(--stc-surface);
    border: 2px solid var(--stc-border);
    border-radius: var(--stc-radius-sm);
    padding: .65rem 1rem;
    cursor: pointer;
    font-family: var(--stc-font-body);
    font-size: .95rem;
    color: var(--stc-text);
    display: flex;
    align-items: center;
    gap: .75rem;
    transition: border-color var(--stc-transition), background var(--stc-transition);
}

.stc-quiz__answer-btn:hover {
    border-color: var(--stc-accent);
    background: var(--stc-accent-light);
}

.stc-quiz__answer-btn.selected {
    border-color: var(--stc-accent);
    background: var(--stc-accent-light);
    font-weight: 600;
}

.stc-quiz__answer-btn.correct-ans {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
}

.stc-quiz__answer-btn.wrong-ans {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.stc-quiz__answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 4px;
    background: var(--stc-border);
    font-size: .8em;
    font-weight: 700;
    flex-shrink: 0;
    transition: background var(--stc-transition), color var(--stc-transition);
}

.selected .stc-quiz__answer-letter  { background: var(--stc-accent); color: #fff; }
.correct-ans .stc-quiz__answer-letter { background: #22c55e; color: #fff; }
.wrong-ans   .stc-quiz__answer-letter { background: #ef4444; color: #fff; }

.stc-quiz__explanation {
    margin-top: .75rem;
    font-size: .88rem;
    color: #4b5563;
    font-style: italic;
    padding: .6rem .9rem;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 0 4px 4px 0;
}

.stc-quiz__actions {
    text-align: center;
    margin-bottom: 1rem;
}

/* Résultat quiz */
.stc-quiz__result {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--stc-radius-sm);
    background: var(--stc-bg);
    border: 1px solid var(--stc-border);
    animation: stcFadeIn .3s ease;
}

.stc-quiz__result-score {
    font-family: var(--stc-font-display);
    font-size: 3rem;
    color: var(--stc-accent);
    margin-bottom: .5rem;
}

.stc-quiz__result-msg {
    font-size: 1rem;
    color: var(--stc-text-muted);
    margin-bottom: 1rem;
}

.stc-quiz__result-msg.passed { color: #166534; font-weight: 600; }
.stc-quiz__result-msg.failed { color: #991b1b; }

/* ════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════════════════════════════════════ */

.stc-viewer__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--stc-surface);
    border-top: 1px solid var(--stc-border);
    gap: 1rem;
}

.stc-viewer__dots {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.stc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--stc-border);
    transition: background var(--stc-transition), transform var(--stc-transition);
    cursor: pointer;
}

.stc-dot--active {
    background: var(--stc-accent);
    transform: scale(1.4);
}

.stc-dot--done {
    background: color-mix(in srgb, var(--stc-accent) 40%, white);
}

/* ════════════════════════════════════════════════════════════════════════
   BOUTONS
   ════════════════════════════════════════════════════════════════════════ */

.stc-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border-radius: var(--stc-radius-sm);
    font-family: var(--stc-font-body);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--stc-accent);
    background: var(--stc-accent);
    color: #fff;
    text-decoration: none;
    transition: background var(--stc-transition), transform var(--stc-transition), box-shadow var(--stc-transition);
}

.stc-btn:hover {
    background: var(--stc-accent-dark);
    border-color: var(--stc-accent-dark);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    transform: translateY(-1px);
    color: #fff;
}

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

.stc-btn:disabled, .stc-btn[disabled] {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stc-btn--prev {
    background: transparent;
    color: var(--stc-accent);
}
.stc-btn--prev:hover { background: var(--stc-accent-light); }

.stc-btn--quiz-submit {
    background: #b45309;
    border-color: #b45309;
    padding: .75rem 2rem;
    font-size: 1rem;
}
.stc-btn--quiz-submit:hover  { background: #92400e; border-color: #92400e; }
.stc-btn--quiz-submit:disabled { opacity:.35; cursor:not-allowed; }

.stc-btn--quiz-retry {
    background: transparent;
    color: var(--stc-accent);
    border-color: var(--stc-accent);
}

/* ════════════════════════════════════════════════════════════════════════
   CATALOGUE
   ════════════════════════════════════════════════════════════════════════ */

.stc-catalogue {
    font-family: var(--stc-font-body);
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.stc-catalogue__header {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.stc-catalogue__header-text {
    text-align: left;
}

.stc-catalogue__title {
    font-family: var(--stc-font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--stc-text);
    margin-bottom: .5rem;
}

.stc-catalogue__sub {
    color: var(--stc-text-muted);
}

/* ══════════════════════════════════════════════════════════════════════
   GALERIE DE COURS
   ══════════════════════════════════════════════════════════════════════ */

.stc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* ── Carte ── */
.stc-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--stc-radius);
    overflow: hidden;
    box-shadow: var(--stc-shadow);
    text-decoration: none;
    color: var(--stc-text);
    background: var(--stc-surface);
    transition: transform var(--stc-transition), box-shadow var(--stc-transition);
    border-bottom: 3px solid var(--card-color, var(--stc-accent));
}

.stc-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--stc-shadow-lg);
}

/* ── Visuel (image) ── */
.stc-card__visual {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: color-mix(in srgb, var(--card-color, var(--stc-accent)) 20%, #1e293b);
}

.stc-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.stc-card:hover .stc-card__img {
    transform: scale(1.06);
}

/* Placeholder quand pas d'image */
.stc-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--card-color, var(--stc-accent)) 80%, #000) 0%,
        color-mix(in srgb, var(--card-color, var(--stc-accent)) 40%, #1e293b) 100%
    );
}

/* Overlay au survol */
.stc-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--stc-transition);
}

.stc-card:hover .stc-card__overlay {
    opacity: 1;
}

.stc-card__cta {
    background: #fff;
    color: var(--card-color, var(--stc-accent));
    font-weight: 700;
    font-size: .88rem;
    padding: .55em 1.3em;
    border-radius: 99px;
    letter-spacing: .02em;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    transform: translateY(6px);
    transition: transform var(--stc-transition);
}

.stc-card:hover .stc-card__cta {
    transform: translateY(0);
}

/* Badges sur l'image */
.stc-card__badges {
    position: absolute;
    top: .6rem;
    left: .6rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    align-items: flex-start;
}

.stc-card__badge {
    font-size: .7rem;
    font-weight: 700;
    padding: .2em .6em;
    border-radius: 4px;
    color: #fff;
    line-height: 1.4;
    backdrop-filter: blur(4px);
}

.stc-card__badge--done  { background: rgba(22,163,74,.85); }
.stc-card__badge--wip   { background: rgba(245,158,11,.85); }
.stc-card__badge--level { /* couleur inline via style="" */ }

/* ── Corps texte ── */
.stc-card__body {
    padding: 1rem 1.1rem .9rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.stc-card__title {
    font-family: var(--stc-font-display);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--stc-text);
    line-height: 1.35;
    margin: 0;
}

.stc-card__meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .75rem;
    color: var(--stc-text-muted);
}

.stc-card__meta span::before {
    content: '';
}

.stc-card__meta span + span::before {
    content: '·';
    margin-right: .6rem;
}

/* ── Barre de progression ── */
.stc-card__progress {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: auto;
    padding-top: .3rem;
}

.stc-card__progress-track {
    flex: 1;
    height: 5px;
    background: var(--stc-border);
    border-radius: 99px;
    overflow: hidden;
}

.stc-card__progress-fill {
    height: 100%;
    background: var(--card-color, var(--stc-accent));
    border-radius: 99px;
    transition: width .8s cubic-bezier(.4,0,.2,1);
}

.stc-card__progress-pct {
    font-size: .75rem;
    font-weight: 700;
    color: var(--card-color, var(--stc-accent));
    min-width: 30px;
    text-align: right;
}

/* Carte "Terminé" — légèrement atténuée */
.stc-card--done .stc-card__visual {
    filter: saturate(.7);
}
.stc-card--done .stc-card__progress-fill {
    background: #22c55e;
}
.stc-card--done .stc-card__progress-pct {
    color: #16a34a;
}

/* ════════════════════════════════════════════════════════════════════════
   UTILITAIRES
   ════════════════════════════════════════════════════════════════════════ */

.stc-error  { color: #991b1b; background:#fef2f2; padding:1em; border-radius:6px; border:1px solid #fecaca; }
.stc-notice { color: #1e40af; background:#eff6ff; padding:1em; border-radius:6px; border:1px solid #bfdbfe; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .stc-viewer__header { padding: 1.25rem 1.25rem 1rem; }
    .stc-slide          { padding: 1.5rem 1.25rem; }
    .stc-viewer__nav    { padding: .75rem 1rem; }
    .stc-btn            { padding: .55rem 1rem; font-size: .82rem; }
    .stc-viewer__dots   { max-width: 180px; }
    .stc-dot            { width: 6px; height: 6px; }
    .stc-slide--end     { padding: 2.5rem 1.25rem; }
}

/* ==========================================================================
   NOUVELLES FONCTIONNALITÉS v2.0
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════════
   CORPS — layout flex (slide + notes)
   ══════════════════════════════════════════════════════════════════════ */

.stc-viewer__body {
    display: flex;
    align-items: stretch;
    min-height: 420px;
}

.stc-viewer__stage {
    flex: 1;
    min-width: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR NOTES
   ══════════════════════════════════════════════════════════════════════ */

.stc-viewer__notes {
    width: 260px;
    flex-shrink: 0;
    border-left: 1px solid var(--stc-border);
    background: #fafbff;
    display: flex;
    flex-direction: column;
    transition: width var(--stc-transition);
}

.stc-viewer__notes.stc-notes--collapsed {
    width: 40px;
}

.stc-notes__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .8rem;
    background: var(--stc-accent-light);
    border-bottom: 1px solid var(--stc-border);
    gap: 6px;
}

.stc-notes__title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--stc-accent);
    white-space: nowrap;
    overflow: hidden;
}

.stc-notes--collapsed .stc-notes__title {
    display: none;
}

.stc-notes__toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--stc-accent);
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.stc-notes__toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: .35rem .5rem;
    background: var(--stc-bg);
    border-bottom: 1px solid var(--stc-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.stc-notes__toolbar button {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: .8rem;
    line-height: 1;
    padding: .3em .45em;
    color: var(--stc-text);
    font-family: var(--stc-font-body);
    transition: background .15s, border-color .15s;
    min-width: 26px;
    text-align: center;
}

.stc-notes__toolbar button:hover {
    background: var(--stc-accent-light);
    border-color: var(--stc-accent);
    color: var(--stc-accent);
}

.stc-notes__toolbar button.active {
    background: var(--stc-accent-light);
    border-color: var(--stc-accent);
    color: var(--stc-accent);
}

.stc-notes__toolbar-sep {
    width: 1px;
    height: 16px;
    background: var(--stc-border);
    margin: 0 4px;
    flex-shrink: 0;
}

.stc-notes__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    min-height: 0;
}

.stc-notes--collapsed .stc-notes__body {
    display: none;
}

.stc-notes__area {
    flex: 1;
    border: none;
    padding: .75rem;
    font-family: var(--stc-font-body);
    font-size: .82rem;
    color: var(--stc-text);
    line-height: 1.6;
    background: #fff;
    outline: none;
    overflow-y: auto;
    min-height: 0;
}

.stc-notes__area:focus-within {
    box-shadow: inset 0 0 0 2px var(--stc-accent-light);
}

/* Placeholder pour contenteditable */
.stc-notes__area:empty::before {
    content: attr(data-placeholder);
    color: var(--stc-text-muted);
    font-style: italic;
    pointer-events: none;
}

/* Styles du contenu riche dans les notes */
.stc-notes__area strong, .stc-notes__area b { font-weight: 700; }
.stc-notes__area em, .stc-notes__area i    { font-style: italic; }
.stc-notes__area u                         { text-decoration: underline; }
.stc-notes__area s                         { text-decoration: line-through; }
.stc-notes__area ul, .stc-notes__area ol   { padding-left: 1.4em; margin: .25em 0; }
.stc-notes__area li                        { margin: .15em 0; }
.stc-notes__area p                         { margin: .25em 0; }

.stc-notes__status {
    font-size: .7rem;
    color: var(--stc-text-muted);
    text-align: right;
    padding: .2rem .5rem;
    background: var(--stc-bg);
    border-top: 1px solid var(--stc-border);
    flex-shrink: 0;
    min-height: 1.4em;
}

/* ══════════════════════════════════════════════════════════════════════
   BARRE DE SESSION (élèves)
   ══════════════════════════════════════════════════════════════════════ */

.stc-session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 1.25rem;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    font-size: .82rem;
}

.stc-session-bar__left {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #991b1b;
    font-weight: 600;
}

.stc-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: stc-blink 1.2s ease-in-out infinite;
}

@keyframes stc-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

.stc-sync-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    color: #7f1d1d;
    font-size: .8rem;
    user-select: none;
}

.stc-sync-toggle {
    accent-color: #ef4444;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════
   MODE PROFESSEUR
   ══════════════════════════════════════════════════════════════════════ */

.stc-viewer--prof {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    background: #0f172a;
    color: #f1f5f9;
}

.stc-viewer--prof .stc-viewer__header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 1rem 2rem;
}

.stc-viewer--prof .stc-viewer__title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #f1f5f9;
}

.stc-viewer--prof .stc-viewer__body {
    flex: 1;
    background: #0f172a;
}

.stc-viewer--prof .stc-viewer__stage {
    padding: 0;
}

.stc-viewer--prof .stc-slide {
    padding: 3rem 4rem;
    min-height: 60vh;
    background: #0f172a;
    color: #f1f5f9;
    border: none;
}

.stc-viewer--prof .stc-slide__title {
    color: #f1f5f9;
    border-color: var(--stc-accent);
    font-size: clamp(1.6rem, 3.5vw, 3rem);
}

.stc-viewer--prof .stc-slide__body {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #cbd5e1;
    line-height: 1.8;
}

.stc-viewer--prof .stc-slide__icon {
    font-size: clamp(2.5rem, 6vw, 5rem);
}

.stc-viewer--prof .stc-slide__body h1,
.stc-viewer--prof .stc-slide__body h2,
.stc-viewer--prof .stc-slide__body h3 {
    color: #f1f5f9;
}

.stc-viewer--prof .stc-slide__body li,
.stc-viewer--prof .stc-slide__body p {
    color: #cbd5e1;
}

.stc-viewer--prof .stc-viewer__nav {
    background: #1e293b;
    border-top: 1px solid #334155;
}

.stc-viewer--prof .stc-btn {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.stc-viewer--prof .stc-btn:hover:not(:disabled) {
    background: #475569;
}

.stc-viewer--prof .stc-dot {
    background: #475569;
}

.stc-viewer--prof .stc-dot--active {
    background: var(--stc-accent);
    transform: scale(1.4);
}

.stc-viewer--prof .stc-dot--done {
    background: color-mix(in srgb, var(--stc-accent) 60%, #475569);
}

/* Contrôles du prof (dans le header) */
.stc-prof-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #334155;
}

.stc-btn--start-session {
    background: #16a34a !important;
    color: white !important;
    border-color: #15803d !important;
}

.stc-btn--start-session:hover:not(:disabled) {
    background: #15803d !important;
}

.stc-btn--end-session {
    background: #dc2626 !important;
    color: white !important;
    border-color: #b91c1c !important;
}

.stc-btn--end-session:hover:not(:disabled) {
    background: #b91c1c !important;
}

.stc-btn--fullscreen {
    margin-left: auto;
}

.stc-prof-session-status {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: #94a3b8;
}

/* Plein écran natif */
.stc-viewer--prof:fullscreen,
.stc-viewer--prof:-webkit-full-screen {
    border-radius: 0;
    overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE v2
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .stc-viewer__body {
        flex-direction: column;
    }

    .stc-viewer__notes {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--stc-border);
        min-height: 160px;
    }

    .stc-viewer__notes.stc-notes--collapsed {
        width: 100%;
        min-height: auto;
    }

    .stc-viewer--prof .stc-slide {
        padding: 2rem 1.5rem;
    }

    .stc-prof-controls {
        gap: .5rem;
    }
}

/* ==========================================================================
   CATALOGUE v2 — stats + badges niveau
   ========================================================================== */

/* Boîtes stats */
.stc-catalogue__stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stc-stat-box {
    flex: 1;
    min-width: 100px;
    background: var(--stc-surface);
    border: 1px solid var(--stc-border);
    border-radius: var(--stc-radius-sm);
    padding: 1rem 1.25rem;
    text-align: center;
    box-shadow: var(--stc-shadow);
}

.stc-stat-box__number {
    display: block;
    font-family: var(--stc-font-display);
    font-size: 2rem;
    color: var(--stc-accent);
    line-height: 1;
    margin-bottom: .25rem;
}

.stc-stat-box__label {
    font-size: .78rem;
    color: var(--stc-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stc-stat-box--green .stc-stat-box__number { color: #16a34a; }
.stc-stat-box--orange .stc-stat-box__number { color: #d97706; }
.stc-stat-box--blue .stc-stat-box__number   { color: #2563eb; }
.stc-stat-box--purple .stc-stat-box__number { color: #7c3aed; }

/* (anciennes classes supprimées — remplacées par .stc-card) */

/* Bouton outline */
.stc-btn--outline {
    background: transparent;
    color: var(--stc-accent);
    border: 2px solid var(--stc-accent);
}

.stc-btn--outline:hover {
    background: var(--stc-accent-light);
    color: var(--stc-accent);
}

/* ==========================================================================
   PAGE RÉSULTATS QUIZ (élève)
   ========================================================================== */

.stc-resultats {
    font-family: var(--stc-font-body);
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.stc-resultats__header {
    margin-bottom: 1.5rem;
}

.stc-resultats__back {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--stc-accent);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.stc-resultats__back:hover { text-decoration: underline; }

.stc-resultats__title {
    font-family: var(--stc-font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--stc-text);
    margin-bottom: .25rem;
}

.stc-resultats__sub {
    color: var(--stc-text-muted);
}

.stc-resultats__stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stc-resultats__empty {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--stc-surface);
    border-radius: var(--stc-radius);
    border: 1px solid var(--stc-border);
    color: var(--stc-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Bloc par cours */
.stc-resultats__course {
    background: var(--stc-surface);
    border-radius: var(--stc-radius);
    overflow: hidden;
    box-shadow: var(--stc-shadow);
    margin-bottom: 1.5rem;
    border-top: 4px solid var(--card-color, var(--stc-accent));
}

.stc-resultats__course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--stc-border);
    gap: 1rem;
    flex-wrap: wrap;
}

.stc-resultats__course-title {
    font-family: var(--stc-font-display);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--stc-text);
}

.stc-resultats__course-score {
    font-size: .82rem;
    font-weight: 600;
    color: var(--stc-text-muted);
    background: var(--stc-bg);
    padding: .3em .8em;
    border-radius: 99px;
    border: 1px solid var(--stc-border);
}

/* Tableau résultats */
.stc-resultats__table {
    width: 100%;
    border-collapse: collapse;
    font-size: .87rem;
}

.stc-resultats__table th {
    background: var(--stc-bg);
    padding: .65rem 1.25rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--stc-text-muted);
    border-bottom: 1px solid var(--stc-border);
}

.stc-resultats__table td {
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--stc-border);
    vertical-align: middle;
}

.stc-resultats__table tr:last-child td {
    border-bottom: none;
}

.stc-resultats__row--pass { background: #f0fdf4; }
.stc-resultats__row--fail { background: #fff7f7; }

.stc-resultats__row--pass:hover { background: #dcfce7; }
.stc-resultats__row--fail:hover { background: #fee2e2; }

.stc-resultats__quiz-name {
    font-weight: 600;
    color: var(--stc-text);
}

.stc-resultats__date {
    font-size: .78rem;
    color: var(--stc-text-muted);
    white-space: nowrap;
}

/* Chip de score */
.stc-score-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25em .75em;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 700;
}

.stc-score-chip--pass {
    background: #dcfce7;
    color: #166534;
}

.stc-score-chip--fail {
    background: #fee2e2;
    color: #991b1b;
}

.stc-score-chip__num { font-weight: 700; }
.stc-score-chip__pct { font-size: .72rem; opacity: .75; }

/* Badge statut */
.stc-status-badge {
    display: inline-block;
    padding: .2em .65em;
    border-radius: 4px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.stc-status-badge--pass {
    background: #dcfce7;
    color: #166534;
}

.stc-status-badge--fail {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Responsive résultats ── */
@media (max-width: 640px) {
    .stc-resultats__table th:nth-child(4),
    .stc-resultats__table td:nth-child(4) { display: none; }

    .stc-resultats__table th:nth-child(3),
    .stc-resultats__table td:nth-child(3) { display: none; }

    .stc-catalogue__header { flex-direction: column; align-items: flex-start; }
    .stc-catalogue__stats  { gap: .5rem; }
    .stc-stat-box { padding: .75rem; }
    .stc-stat-box__number { font-size: 1.5rem; }

    /* Galerie mobile : 2 colonnes */
    .stc-gallery { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .stc-card__visual { height: 140px; }
    .stc-card__title { font-size: .95rem; }
}

@media (max-width: 400px) {
    /* Très petit écran : 1 colonne */
    .stc-gallery { grid-template-columns: 1fr; }
    .stc-card__visual { height: 180px; }
}

/* ══════════════════════════════════════════════════════════════════════
   MODE PPT  —  iframe pleine surface
   ══════════════════════════════════════════════════════════════════════ */

.stc-viewer--ppt .stc-viewer__body--ppt {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 600px;
}

/* Zone iframe */
.stc-ppt-stage {
    flex: 1 1 0;
    min-width: 0;
    background: #000;
}

.stc-ppt-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    border: none;
}

/* Sidebar notes côte à côte avec l'iframe */
.stc-viewer--ppt .stc-viewer__notes {
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid var(--stc-border);
    display: flex;
    flex-direction: column;
    background: var(--stc-surface);
}

.stc-viewer--ppt .stc-notes__body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stc-viewer--ppt .stc-notes__area {
    flex: 1;
}

/* Plein écran : iframe occupe tout */
.stc-viewer--ppt:fullscreen .stc-ppt-stage,
.stc-viewer--ppt:-webkit-full-screen .stc-ppt-stage {
    min-height: 100vh;
}

/* Responsive : empilé sur mobile */
@media (max-width: 768px) {
    .stc-viewer--ppt .stc-viewer__body--ppt {
        flex-direction: column;
    }
    .stc-ppt-stage {
        min-height: 56vw; /* ratio 16/9 approx */
    }
    .stc-viewer--ppt .stc-viewer__notes {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--stc-border);
    }
}
