/* ═══════════════════════════════════════════════════════════
   Caly-Elec Classroom — shared styles for host/live/join pages
   ═══════════════════════════════════════════════════════════ */

:root {
    --cls-bg: #0f172a;
    --cls-surface: #1e293b;
    --cls-surface-light: #334155;
    --cls-border: #475569;
    --cls-text: #e2e8f0;
    --cls-text-muted: #94a3b8;
    --cls-primary: #f59e0b;
    --cls-primary-hover: #d97706;
    --cls-success: #22c55e;
    --cls-danger: #ef4444;
    --cls-info: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.classroom-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cls-bg);
    color: var(--cls-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ── Forms (join + host creation) ────────────── */
.cls-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.cls-logo {
    text-align: center;
    margin-bottom: 32px;
}
.cls-logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.9rem;
    color: var(--cls-primary);
    margin-bottom: 4px;
}
.cls-logo p {
    color: var(--cls-text-muted);
    font-size: 0.9rem;
}

.cls-card {
    background: var(--cls-surface);
    border: 1px solid var(--cls-border);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.cls-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.cls-form-group {
    margin-bottom: 18px;
}
.cls-form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--cls-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cls-form-group input,
.cls-form-group select,
.cls-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--cls-bg);
    border: 1px solid var(--cls-border);
    border-radius: 8px;
    color: var(--cls-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
.cls-form-group input:focus,
.cls-form-group select:focus,
.cls-form-group textarea:focus {
    outline: none;
    border-color: var(--cls-primary);
}
.cls-form-group input.code-input {
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    text-align: center;
    font-weight: 700;
}

.cls-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--cls-primary), var(--cls-primary-hover));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.cls-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35); }
.cls-btn:active { transform: translateY(0); }
.cls-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.cls-btn.block { width: 100%; }
.cls-btn.ghost {
    background: transparent;
    border: 1px solid var(--cls-border);
    color: var(--cls-text);
}
.cls-btn.ghost:hover { background: var(--cls-surface-light); box-shadow: none; }
.cls-btn.danger {
    background: linear-gradient(135deg, var(--cls-danger), #b91c1c);
}

.cls-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--cls-danger);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.87rem;
    margin-bottom: 16px;
    display: none;
}
.cls-error.visible { display: block; }

.cls-info {
    color: var(--cls-text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 18px;
}

/* ── Live viewer (trainee) ──────────────────── */

body.classroom-live {
    background: #000;
    overflow: hidden;
    height: 100vh;
}

/* Viewer wrapper — fills the area BELOW the 38px status bar.
   Uses flexbox to guarantee the slide image is vertically + horizontally
   centered no matter its intrinsic dimensions. JS toggles inline
   display:none/flex to show or hide the viewer. */
#classroom-viewer {
    position: fixed !important;
    top: 38px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1 !important;
    background: #000 !important;
    overflow: hidden !important;
    align-items: center !important;
    justify-content: center !important;
    display: none;              /* toggled to flex by JS */
}

#classroom-slide-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Slide relay image — v3.5
   Flexbox-based centering (H + V) via the parent #classroom-viewer which
   is display:flex align-items:center justify-content:center. The image
   uses intrinsic sizing with max-width/max-height constraints so it fits
   the viewport while preserving its aspect ratio — no cropping, perfect
   centering in BOTH trainee mode and projector mode. Works with any
   slide type (title, standard, comparison, image_gallery, schema…). */
#classroom-slide-image {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: auto !important;
    display: block !important;
    background: transparent;
}

/* ── Tool/Lab viewer (POC Phase B) ──
 * Shown when the formateur opens a lab/outil via the Ressources TOC.
 * Mutually exclusive with #classroom-viewer: when one is visible the
 * other is hidden. The iframe loads the lab URL directly — no relay. */
#classroom-tool-viewer {
    position: fixed !important;
    top: 38px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1 !important;
    background: #0f172a !important;
    overflow: hidden !important;
    display: none;
}
#classroom-tool-viewer.visible {
    display: block;
}
#classroom-tool-frame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    background: #fff !important;
    display: block !important;
}
#classroom-tool-title {
    position: fixed;
    top: 38px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 0.95rem;
    padding: 4px 16px;
    background: rgba(245, 158, 11, 0.9);
    z-index: 400;
    pointer-events: none;
    display: none;
}
#classroom-tool-title.has-text {
    display: block;
}
body.classroom-projector-mode #classroom-tool-viewer {
    top: 0 !important;
}
body.classroom-projector-mode #classroom-tool-title {
    display: none !important;
}

/* ── Projector mode (3rd screen / HDMI) ──
 * Applied via body.classroom-projector-mode when the host opens the
 * popup with ?view=projector. Strips the status bar, the trainee
 * name, the waiting-state hints and forces the slide to fill the
 * full window so it looks right on the HDMI output.
 */
body.classroom-projector-mode #classroom-status-bar {
    display: none !important;
}
body.classroom-projector-mode #classroom-viewer {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}
body.classroom-projector-mode #classroom-slide-image {
    max-width: calc(100% - 4px) !important;
    max-height: calc(100% - 4px) !important;
}
body.classroom-projector-mode #classroom-slide-title {
    display: none !important;
}
body.classroom-projector-mode #classroom-fullscreen-prompt {
    background: #0f172a !important;
}
body.classroom-projector-mode #classroom-fullscreen-prompt h2 {
    color: #f59e0b !important;
    font-size: 2rem !important;
}
body.classroom-projector-mode #classroom-fullscreen-prompt p {
    color: rgba(255, 255, 255, 0.75) !important;
}
body.classroom-projector-mode #classroom-waiting {
    background: #000 !important;
}
body.classroom-projector-mode #classroom-waiting h2 {
    color: #f59e0b !important;
    font-size: 1.8rem !important;
}

/* Floating fullscreen toggle — shown ONLY in projector mode.
   Lives in the top-right corner, fades out when the mouse is
   idle so the projected image is not polluted. */
#classroom-fs-toggle {
    display: none;
    position: fixed;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #fff;
    cursor: pointer;
    z-index: 2500;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.3s, background 0.15s, border-color 0.15s;
    opacity: 1;
}
#classroom-fs-toggle svg {
    width: 20px;
    height: 20px;
}
#classroom-fs-toggle:hover {
    background: rgba(245, 158, 11, 0.4);
    border-color: var(--cls-primary);
}
body.classroom-projector-mode #classroom-fs-toggle {
    display: flex;
}
body.classroom-projector-mode #classroom-fs-toggle.dim {
    opacity: 0.12;
}
body.classroom-projector-mode #classroom-fs-toggle:hover,
body.classroom-projector-mode #classroom-fs-toggle:focus {
    opacity: 1 !important;
}

/* Slide title overlay — sits right under the status bar */
#classroom-slide-title {
    position: fixed;
    top: 38px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 0.95rem;
    padding: 4px 16px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 400;
    pointer-events: none;
    display: none;              /* shown by JS when a title is available */
}
#classroom-slide-title.has-text {
    display: block;
}

/* pen overlay canvas — absolute on top of the Reveal.js slides area */
#classroom-annotation-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

/* Pause overlay */
#classroom-pause-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
    color: #fff;
    text-align: center;
    padding: 20px;
}
#classroom-pause-overlay.visible { display: flex; }
#classroom-pause-overlay .cls-pause-icon {
    font-size: 4rem;
    color: var(--cls-primary);
}
#classroom-pause-overlay h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    color: #fbbf24;
}
#classroom-pause-overlay p {
    color: var(--cls-text-muted);
    font-size: 1rem;
    max-width: 440px;
}

/* Waiting state (session not yet live) */
#classroom-waiting {
    position: fixed;
    inset: 0;
    background: var(--cls-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 900;
    color: var(--cls-text);
    text-align: center;
    padding: 20px;
}
#classroom-waiting h2 {
    font-family: 'Outfit', sans-serif;
    color: var(--cls-primary);
    font-size: 1.6rem;
}
#classroom-waiting .cls-spinner {
    border: 4px solid rgba(245, 158, 11, 0.15);
    border-top-color: var(--cls-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: cls-spin 0.9s linear infinite;
}
@keyframes cls-spin { to { transform: rotate(360deg); } }

/* Trainee status bar at top of live view */
#classroom-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 14px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--cls-text-muted);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}
#classroom-status-bar .cls-status-left { display: flex; gap: 12px; align-items: center; }
#classroom-status-bar .cls-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--cls-danger);
    transition: background 0.2s;
}
#classroom-status-bar .cls-status-dot.connected { background: var(--cls-success); }
#classroom-status-bar .cls-session-title { color: #fff; font-weight: 500; }

/* Activity modal (QCM Phase 1) */
#classroom-activity-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
#classroom-activity-modal.visible { display: flex; }
.cls-activity-card {
    background: var(--cls-surface);
    border: 1px solid var(--cls-primary);
    border-radius: 14px;
    padding: 28px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.cls-activity-card h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--cls-primary);
    font-size: 1.25rem;
    margin-bottom: 18px;
}
.cls-activity-choices { display: flex; flex-direction: column; gap: 10px; }
.cls-activity-choice {
    background: var(--cls-bg);
    border: 2px solid var(--cls-border);
    border-radius: 10px;
    padding: 14px 18px;
    color: var(--cls-text);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.cls-activity-choice:hover { border-color: var(--cls-primary); }
.cls-activity-choice.selected { border-color: var(--cls-primary); background: rgba(245, 158, 11, 0.1); }
.cls-activity-card .cls-btn { margin-top: 18px; }
.cls-activity-done {
    text-align: center;
    padding: 20px;
    color: var(--cls-success);
    font-size: 1rem;
}

/* ── Host dashboard ─────────────────────────── */

body.classroom-host {
    background: var(--cls-bg);
}

#classroom-host-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "stage"
        "toolbar";
    height: 100vh;
    gap: 0;
    position: relative;
}

.cls-host-header {
    grid-area: header;
    background: var(--cls-surface);
    border-bottom: 1px solid var(--cls-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 4px 12px;
    gap: 6px;
    min-height: 38px;
}
.cls-host-header .cls-host-title {
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cls-host-header .cls-state-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}
.cls-state-badge.draft   { background: #334155; color: #cbd5e1; }
.cls-state-badge.open    { background: #1e40af; color: #93c5fd; }
.cls-state-badge.live    { background: #166534; color: #86efac; }
.cls-state-badge.paused  { background: #713f12; color: #fde047; }
.cls-state-badge.ended   { background: #7f1d1d; color: #fca5a5; }
.cls-state-badge.expired { background: #1f2937; color: #6b7280; }

.cls-host-header .cls-host-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.cls-host-header .cls-btn { padding: 5px 10px; font-size: 0.78rem; }

.cls-host-stage {
    grid-area: stage;
    background: #000;
    position: relative;
    overflow: hidden;
}
.cls-host-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Sidebar is now a SLIDE-OVER panel that overlays the stage from the
   right. Hidden by default; opened via the "📋 Infos séance" header
   button. This gives the course viewer 100% width at all times. */
.cls-host-sidebar {
    position: fixed;
    top: 42px;                 /* below the compact header */
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: calc(100vh - 56px);
    background: var(--cls-surface);
    border-left: 1px solid var(--cls-border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
    padding: 20px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}
.cls-host-sidebar.open {
    transform: translateX(0);
}

/* Plan sidebar — slides in from the LEFT instead of the right */
#host-plan-sidebar {
    right: auto !important;
    left: 0;
    border-left: 0;
    border-right: 1px solid var(--cls-border);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    transform: translateX(-100%);
}
#host-plan-sidebar.open {
    transform: translateX(0);
}

/* Plan items inside the plan sidebar */
.cls-plan-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--cls-bg);
    border: 1px solid var(--cls-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.cls-plan-item:hover {
    border-color: var(--cls-primary);
    background: rgba(245, 158, 11, 0.05);
}
.cls-plan-item.current {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--cls-primary);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.cls-plan-item.done {
    opacity: 0.55;
}
.cls-plan-item.done .cls-plan-item-num::before {
    content: '✓';
    color: var(--cls-success);
}
.cls-plan-item-num {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cls-surface);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--cls-primary);
    flex-shrink: 0;
}
.cls-plan-item-body {
    flex: 1;
    min-width: 0;
}
.cls-plan-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cls-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cls-plan-item-type {
    display: inline-block;
    padding: 1px 5px;
    margin-right: 5px;
    border-radius: 3px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cls-plan-item-type.course { background: #1e40af; color: #93c5fd; }
.cls-plan-item-type.tool { background: #0f766e; color: #5eead4; }
.cls-plan-item-meta {
    font-size: 0.65rem;
    color: var(--cls-text-muted);
    margin-top: 1px;
}
/* Backdrop behind the slide-over panel */
.cls-host-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 150;
}
.cls-host-sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}
/* Close button inside the sidebar */
.cls-sidebar-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--cls-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}
.cls-sidebar-close:hover { background: var(--cls-surface-light); color: #fff; }
.cls-sidebar-block h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--cls-text-muted);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--cls-border);
}
.cls-trainee-list {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
}
.cls-trainee-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 0.85rem;
    color: var(--cls-text);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}
.cls-trainee-item:last-child { border-bottom: none; }
.cls-trainee-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--cls-success);
}
.cls-code-display {
    background: var(--cls-bg);
    border: 1px solid var(--cls-primary);
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    color: var(--cls-primary);
    font-weight: 700;
    letter-spacing: 0.4em;
}

.cls-host-toolbar {
    grid-area: toolbar;
    background: var(--cls-surface);
    border-top: 1px solid var(--cls-border);
    padding: 8px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 34px;
    padding: 2px 12px;
}

/* External navbar (prev/next/zoom) inside the host footer.
   Lives OUTSIDE the iframe so it never appears in the captured slide. */
.cls-host-navbar {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--cls-bg);
    border: 1px solid var(--cls-border);
    border-radius: 999px;
    padding: 4px 10px;
}
.cls-nav-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--cls-text);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0;
    transition: background 0.15s;
}
.cls-nav-btn svg {
    width: 15px;
    height: 15px;
}
.cls-nav-btn:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--cls-primary);
    color: var(--cls-primary);
}
.cls-nav-sep {
    width: 1px;
    height: 20px;
    background: var(--cls-border);
    margin: 0 3px;
}
.cls-nav-zoom {
    min-width: 40px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--cls-text-muted);
}
.cls-nav-counter {
    font-size: 0.75rem;
    color: var(--cls-text-muted);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    padding: 0 4px;
}
/* ── Generic modal (host quiz composer + others) ── */
.cls-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cls-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
}
.cls-modal-card {
    position: relative;
    background: var(--cls-surface);
    border: 1px solid var(--cls-border);
    border-radius: 14px;
    padding: 28px 26px 22px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.cls-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--cls-text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    line-height: 1;
}
.cls-modal-close:hover { background: var(--cls-surface-light); color: #fff; }

.cls-quiz-choice-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.cls-quiz-choice-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    background: var(--cls-bg);
    border: 1px solid var(--cls-border);
    border-radius: 6px;
    color: var(--cls-text);
    font-size: 0.85rem;
}
.cls-quiz-choice-row .cls-quiz-correct {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--cls-text-muted);
    cursor: pointer;
}
.cls-quiz-choice-row .cls-quiz-remove {
    background: transparent;
    border: 1px solid var(--cls-border);
    color: var(--cls-danger);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.cls-quiz-choice-row .cls-quiz-remove:hover { background: rgba(239, 68, 68, 0.15); }

/* Live results bars */
.cls-result-bar {
    margin-bottom: 8px;
}
.cls-result-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--cls-text);
    margin-bottom: 3px;
}
.cls-result-bar-track {
    height: 18px;
    background: var(--cls-bg);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--cls-border);
}
.cls-result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cls-primary), var(--cls-primary-hover));
    transition: width 0.3s ease-out;
}
.cls-result-bar.correct .cls-result-bar-fill {
    background: linear-gradient(90deg, var(--cls-success), #16a34a);
}

/* ── Presentation mode (host-only, in-app fullscreen alternative) ──
 * Hides the dashboard chrome (header + footer) so the slide iframe
 * fills the full host window. A floating toolbar stays visible at
 * the bottom so the formateur can still navigate, open the sidebar,
 * launch a quiz, toggle projector, and exit the mode.
 * The user can combine this with browser F11 for true fullscreen. */

#host-present-toolbar {
    display: none;    /* toggled to flex by the .classroom-presentation-mode class */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    padding: 6px 10px;
    gap: 5px;
    align-items: center;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    font-family: inherit;
    opacity: 1;
    transition: opacity 0.3s;
}
.cls-pt-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-family: inherit;
    padding: 0;
    transition: all 0.15s;
}
.cls-pt-btn svg { width: 17px; height: 17px; }
.cls-pt-btn:hover {
    background: rgba(245, 158, 11, 0.3);
    border-color: var(--cls-primary);
    color: var(--cls-primary);
}
.cls-pt-btn.cls-pt-exit {
    width: auto;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}
.cls-pt-btn.cls-pt-exit:hover {
    background: rgba(239, 68, 68, 0.5);
    color: #fff;
}
.cls-pt-btn.cls-pt-return {
    width: auto;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.6);
    color: #fcd34d;
}
.cls-pt-btn.cls-pt-return:hover {
    background: rgba(245, 158, 11, 0.5);
    color: #fff;
}
.cls-pt-counter {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    padding: 0 8px;
    letter-spacing: 0.5px;
}
.cls-pt-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.18);
}

/* When presentation mode is ON, hide the chrome and let the stage
   iframe + the floating toolbar take over the screen. */
body.classroom-presentation-mode .cls-host-header {
    display: none !important;
}
body.classroom-presentation-mode .cls-host-toolbar {
    display: none !important;
}
body.classroom-presentation-mode #classroom-host-layout {
    grid-template-rows: 0 1fr 0 !important;
}
body.classroom-presentation-mode .cls-host-stage {
    height: 100vh !important;
}
body.classroom-presentation-mode #host-present-toolbar {
    display: flex;
}
/* Fade-out toolbar on inactivity (toggled by JS via .dim class) */
#host-present-toolbar.dim {
    opacity: 0.12;
}
#host-present-toolbar:hover,
#host-present-toolbar:focus-within {
    opacity: 1 !important;
}

.cls-pen-picker { display: flex; gap: 6px; }
.cls-pen-color {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s;
}
.cls-pen-color.selected { border-color: #fff; transform: scale(1.15); }

@media (max-width: 900px) {
    .cls-host-sidebar {
        width: 100vw;
        border-left: none;
    }
}
