/* =============================================
   Presentation Mode CSS
   Embedded reveal.js - slides fill the viewport.
   Content stretches to use available space.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; overflow: hidden; background: #1a1a2e; }

/* --- Palette --- */
:root {
    --ws-gold: #fdb614;
    --ws-muted: #c0c0d0;
    --ws-subtle: #e0e0ee;
    --ws-demo: #e94560;
    --ws-practice: #10b981;
    --ws-radius: 0.8rem;
    --ws-purple: #a78bfa;
    --ws-green: #34d399;
    --ws-red: #f87171;
    --ws-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --deck-h: calc(100vh - 44px);
    --slide-pad-x: 5vw;
    --slide-pad-top: 4vh;
}

/* --- Viewport container --- */
.presentation-mode {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 44px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
}

.presentation-mode .reveal {
    width: 100%;
    height: 100%;
    background: transparent;
    font-family: var(--ws-font);
}
.presentation-mode .reveal .slide-background { background: transparent !important; }

/* --- Override reveal.js positioning --- */
.presentation-mode .reveal .slides {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
    /* Guard against reveal's upscaling on large screens, which uses `zoom` (not
       `transform`) when the container exceeds its 960x700 design size. */
    zoom: 1 !important;
    perspective: none !important;
}

/* --- Each slide fills the viewport --- */
.presentation-mode .reveal .slides > section {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: var(--deck-h) !important;
    padding: var(--slide-pad-top) var(--slide-pad-x) 2vh !important;
    margin: 0 !important;
    transform: none !important;

    display: flex !important;
    flex-direction: column !important;
    text-align: left;
    color: #fff;
    overflow: hidden;
}
.presentation-mode .reveal .slides > section.present { z-index: 11; }
.presentation-mode .reveal .slides > section:not(.present) { opacity: 0; pointer-events: none; }

/* --- Content area fills remaining space --- */
.presentation-mode .slide-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--ws-radius);
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    padding: 3vh 3vw;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2vh;
    overflow: hidden;
}
/* Reset all child margins inside card - gap handles spacing */
.presentation-mode .slide-card > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* --- Typography: viewport-relative --- */
.presentation-mode .reveal h1 {
    font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
    font-size: clamp(28px, 4.5vw, 72px);
    font-weight: 900;
    color: #fff;
    text-transform: none;
    text-shadow: 0 2px 16px rgba(0,0,0,0.3);
    margin: 0 0 1vh 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.presentation-mode .reveal h2 {
    font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
    font-size: clamp(20px, 2.8vw, 44px);
    font-weight: 700;
    color: #fff;
    text-transform: none;
    letter-spacing: -0.02em;
    margin: 0 0 1.5vh 0;
    flex-shrink: 0;
}
.presentation-mode .reveal h3 { font-size: clamp(14px, 1.4vw, 22px); font-weight: 600; color: var(--ws-gold); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1vh; }
.presentation-mode .reveal h4 { color: #fff; font-size: clamp(14px, 1.3vw, 20px); margin-bottom: 0.8vh; }
.presentation-mode .reveal p { color: #fff; margin: 0 0 0.5vh 0; font-size: clamp(13px, 1.3vw, 22px); }
.presentation-mode .reveal strong { color: #fff; }

/* --- Lists --- */
.presentation-mode .reveal ul,
.presentation-mode .reveal ol { text-align: left; margin: 0 0 0 0.5em; padding-left: 1em; }
.presentation-mode .reveal li {
    margin-bottom: 1.2vh;
    line-height: 1.6;
    font-size: clamp(16px, 1.7vw, 30px);
    color: #fff;
}

/* --- Comparison columns (all styles) --- */
.presentation-mode .comp-columns {
    display: flex;
    gap: 2vw;
    width: 100%;
    flex: 1;
    align-items: stretch;
}

.presentation-mode .comp-col {
    flex: 1;
    border-radius: var(--ws-radius);
    padding: 3vh 2.5vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Parallel style */
.presentation-mode .comp-parallel .comp-col {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Before/After style */
.presentation-mode .comp-ba .before {
    background: rgba(233,69,96,0.08);
    border: 1px solid rgba(233,69,96,0.25);
}
.presentation-mode .comp-ba .after {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.25);
}

/* Column header */
.presentation-mode .comp-col-header {
    font-size: clamp(16px, 1.6vw, 26px);
    font-weight: 700;
    color: #fff;
    padding-bottom: 1.5vh;
    margin-bottom: 1.5vh;
    border-bottom: 2px solid var(--ws-gold);
    flex-shrink: 0;
}
.presentation-mode .comp-col-header i { color: var(--ws-gold); margin-right: 0.3em; }
.presentation-mode .comp-ba .before .comp-col-header { color: var(--ws-demo); border-bottom-color: var(--ws-demo); }
.presentation-mode .comp-ba .before .comp-col-header i { color: var(--ws-demo); }
.presentation-mode .comp-ba .after .comp-col-header { color: var(--ws-practice); border-bottom-color: var(--ws-practice); }
.presentation-mode .comp-ba .after .comp-col-header i { color: var(--ws-practice); }

/* Column items */
.presentation-mode .comp-col-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 1vh;
}

.presentation-mode .comp-item {
    font-size: clamp(14px, 1.4vw, 24px);
    line-height: 1.45;
    color: #fff;
    padding: 1.4vh 1.4vw;
    border-radius: var(--ws-radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-left: 4px solid var(--lc-accent, rgba(255, 255, 255, 0.22));
}
.presentation-mode .comp-item strong { color: var(--lc-accent, #fff); }

/* Styled items inside columns */
.presentation-mode .comp-item-good {
    background: rgba(253,182,20,0.12);
    border-radius: 0.4rem;
    padding: 1vh 1.2vw;
}
.presentation-mode .comp-item-bad {
    background: rgba(233,69,96,0.12);
    border-radius: 0.4rem;
    padding: 1vh 1.2vw;
}
.presentation-mode .comp-item-warn {
    background: rgba(253,182,20,0.1);
    border-radius: 0.4rem;
    padding: 1vh 1.2vw;
}

/* Legacy classes (keep for non-comparison usage) */
.presentation-mode .before-after { display: flex; gap: 2vw; width: 100%; flex: 1; align-items: stretch; }
.presentation-mode .before-after > div { flex: 1; border-radius: var(--ws-radius); padding: 3vh 2.5vw; font-size: clamp(14px, 1.4vw, 24px); line-height: 1.6; display: flex; flex-direction: column; justify-content: space-evenly; }
.presentation-mode .before-after .before { background: rgba(233,69,96,0.08); border: 1px solid rgba(233,69,96,0.25); color: #fff; }
.presentation-mode .before-after .after { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #fff; }

/* --- Icon grid --- */
.presentation-mode .icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5vw;
    width: 100%;
    flex: 1;
    align-content: stretch;
}
.presentation-mode .icon-grid .tile {
    background: rgba(255,255,255,0.04);
    border-radius: var(--ws-radius);
    padding: 2.5vh 2vw;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 1.5vw;
}
.presentation-mode .icon-grid .tile i { color: var(--ws-gold); font-size: clamp(22px, 2.5vw, 40px); flex-shrink: 0; }
.presentation-mode .icon-grid .tile .tile-text { font-size: clamp(14px, 1.4vw, 24px); line-height: 1.5; color: #fff; }
.presentation-mode .icon-grid .tile .tile-text strong { display: block; color: #fff; font-size: 1.15em; margin-bottom: 0.3em; }

/* --- Title slides --- */
.presentation-mode .title-slide {
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
}

.presentation-mode .title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
    max-width: 80%;
}

.presentation-mode .title-slide h1 {
    font-size: clamp(32px, 5.5vw, 80px) !important;
    line-height: 1.15;
    margin: 0;
    text-align: center;
}

.presentation-mode .title-subtitle {
    font-size: clamp(16px, 2vw, 32px);
    color: var(--ws-subtle);
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

.presentation-mode .title-footer {
    font-size: clamp(12px, 1.1vw, 18px);
    color: var(--ws-muted);
    margin-top: 2vh;
    letter-spacing: 0.05em;
}

/* --- Gold accent in all headings via ==word== markup --- */
.presentation-mode .reveal h1 .gold,
.presentation-mode .reveal h2 .gold {
    color: var(--ws-gold);
    font-weight: inherit;
}

/* --- Statement --- */
.presentation-mode .statement { font-size: clamp(20px, 3vw, 48px); font-weight: 700; line-height: 1.4; max-width: 80%; margin: 0 auto; color: #fff; text-align: center; }

/* --- Fragments --- */
.presentation-mode .reveal .fragment.fade-up { transform: translateY(15px); opacity: 0; transition: all 0.4s ease; }
.presentation-mode .reveal .fragment.fade-up.visible { transform: translateY(0); opacity: 1; }

/* ===========================================================
   COMPONENTS
   =========================================================== */

.presentation-mode .glass-box { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 0.5rem; padding: 1.5vh 1.5vw; color: #fff; font-size: clamp(15px, 1.6vw, 28px); line-height: 1.5; }
.presentation-mode .glass-box strong { color: #fff; }

.presentation-mode .callout { background: rgba(255,255,255,0.04); border-left: 4px solid var(--ws-gold); padding: 1.5vh 2vw; font-size: clamp(14px, 1.5vw, 26px); border-radius: 0 0.5rem 0.5rem 0; color: #fff; flex-shrink: 0; line-height: 1.5; margin-top: 2vh; }
.presentation-mode .callout strong { color: #fff; }

.presentation-mode .info-line {
    font-size: clamp(12px, 1.1vw, 18px);
    color: var(--ws-subtle);
    flex-shrink: 0;
    margin-top: 2.5vh;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--ws-gold);
    padding: 1vh 1.5vw;
    border-radius: 0 0.4rem 0.4rem 0;
    text-align: left;
    line-height: 1.5;
}
.presentation-mode .slide-subtitle { font-size: clamp(13px, 1.2vw, 20px); color: var(--ws-subtle); }
.presentation-mode .brand-footer { font-size: clamp(11px, 0.9vw, 15px); color: var(--ws-muted); }
.presentation-mode .speaker-notes { display: none; }

/* --- Sequence --- */
.presentation-mode .seq-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.presentation-mode .seq-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8vh;
}

.presentation-mode .seq-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.5rem;
    padding: 2.5vh 2.5vw;
    display: flex;
    align-items: center;
    gap: 1.2vw;
    flex: 1;
}

.presentation-mode .seq-item-warn {
    background: rgba(253,182,20,0.1);
    border-color: rgba(253,182,20,0.25);
}

.presentation-mode .seq-label {
    font-size: clamp(14px, 1.4vw, 24px);
    font-weight: 700;
    color: var(--ws-gold);
    white-space: nowrap;
    flex-shrink: 0;
}

.presentation-mode .seq-item-warn .seq-label {
    color: #fff;
}

.presentation-mode .seq-text {
    font-size: clamp(14px, 1.4vw, 24px);
    line-height: 1.5;
    color: #fff;
}

/* --- Breakdown --- */
.presentation-mode .breakdown-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.presentation-mode .breakdown-highlight {
    background: rgba(253,182,20,0.1);
    border: 1px solid rgba(253,182,20,0.25);
    border-radius: var(--ws-radius);
    padding: 2vh 2.5vw;
    font-size: clamp(16px, 1.8vw, 30px);
    font-weight: 600;
    color: #fff;
    text-align: center;
    line-height: 1.5;
}

.presentation-mode .breakdown-items {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2vh 2vw;
    align-content: center;
}

.presentation-mode .breakdown-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5vw;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--ws-radius);
    padding: 2.5vh 2vw;
}

.presentation-mode .breakdown-icon {
    font-size: clamp(24px, 2.5vw, 40px);
    flex-shrink: 0;
    width: 1.5em;
    text-align: center;
}

.presentation-mode .breakdown-text {
    font-size: clamp(15px, 1.5vw, 26px);
    line-height: 1.5;
    color: #fff;
}
.presentation-mode .breakdown-text strong { color: #fff; }

.presentation-mode .step-num { display: inline-block; background: var(--ws-gold); color: #141414; font-weight: 700; border-radius: 0.3rem; padding: 0.05em 0.35em; font-size: 0.85em; margin-right: 0.2em; }
.presentation-mode .code-block { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); border-radius: 0.4rem; padding: 1vh 1vw; font-family: monospace; font-size: clamp(12px, 1.1vw, 18px); line-height: 1.5; color: #fff; }

/* --- Marks --- */
.presentation-mode .mark-gold { background: rgba(253,182,20,0.2); padding: 0.1em 0.3em; border-radius: 0.2rem; color: var(--ws-gold); }
.presentation-mode .mark-gold-lg { background: rgba(253,182,20,0.2); padding: 0.3em 0.6em; border-radius: 0.3rem; color: var(--ws-gold); }
.presentation-mode .mark-warn { background: rgba(253,182,20,0.12); padding: 0.4em 0.8em; border-radius: 0.4rem; color: #fff; }
.presentation-mode .mark-warn strong { color: #fff; }
.presentation-mode .mark-warn-lg { background: rgba(253,182,20,0.12); padding: 0.5em 0.8em; border-radius: 0.4rem; color: #fff; }
.presentation-mode .mark-warn-inline { background: rgba(253,182,20,0.12); padding: 0.3em 0.5em; border-radius: 0.3rem; font-weight: 600; color: #fff; }
.presentation-mode .mark-bad { background: rgba(233,69,96,0.15); padding: 1.5vh 1.5vw; border-radius: 0.5rem; color: #fff; font-size: clamp(15px, 1.6vw, 28px); line-height: 1.5; }
.presentation-mode .mark-good { background: rgba(253,182,20,0.15); padding: 1.5vh 1.5vw; border-radius: 0.5rem; color: #fff; font-size: clamp(15px, 1.6vw, 28px); line-height: 1.5; }
.presentation-mode .mark-green { background: rgba(16,185,129,0.12); padding: 0.4em 0.8em; border-radius: 0.4rem; color: #fff; }

/* --- Colors --- */
.presentation-mode .color-muted { color: var(--ws-muted); }
.presentation-mode .color-subtle { color: var(--ws-subtle); }
.presentation-mode .color-gold { color: var(--ws-gold); }
.presentation-mode .color-white { color: #fff; }
.presentation-mode .color-explore { color: var(--ws-gold); }
.presentation-mode .color-define { color: var(--ws-purple); }
.presentation-mode .color-generate { color: var(--ws-green); }
.presentation-mode .color-evaluate { color: var(--ws-red); }
.presentation-mode .gold { color: var(--ws-gold); font-weight: 700; }
.presentation-mode .highlight { color: #fff; font-weight: 700; }
.presentation-mode .muted { color: #b0b0c4; font-size: 0.8em; }

/* --- Layout --- */
.presentation-mode .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1vw; font-size: clamp(12px, 1.1vw, 18px); }
.presentation-mode .grid-2.narrow-gap { gap: 0.8vw; }
.presentation-mode .text-center { text-align: center; }
.presentation-mode .text-left { text-align: left; }
.presentation-mode .font-bold { font-weight: 700; }
.presentation-mode .font-italic { font-style: italic; opacity: 0.8; }
.presentation-mode .prompt-pill { background: rgba(255,255,255,0.06); padding: 0.8vh 1.2vw; border-radius: 0.4rem; border: 1px solid rgba(255,255,255,0.08); text-align: center; color: #fff; font-size: clamp(14px, 1.4vw, 24px); }

/* --- Spacing --- */
.presentation-mode .mb-0 { margin-bottom: 0; }
.presentation-mode .mb-xs { margin-bottom: 0.3vh; }
.presentation-mode .mb-sm { margin-bottom: 0.5vh; }
.presentation-mode .mb-md { margin-bottom: 0.8vh; }
.presentation-mode .mb-lg { margin-bottom: 1vh; }
.presentation-mode .mt-xs { margin-top: 0.3vh; }
.presentation-mode .mt-sm { margin-top: 0.5vh; }
.presentation-mode .mt-md { margin-top: 0.8vh; }
.presentation-mode .mt-lg { margin-top: 1vh; }
.presentation-mode .mt-xl { margin-top: 1.5vh; }
.presentation-mode .mt-2xl { margin-top: 3vh; }
.presentation-mode .mr-xs { margin-right: 0.5vw; }

/* --- Text sizes --- */
.presentation-mode .text-xs { font-size: 0.7em; }
.presentation-mode .text-sm { font-size: 0.75em; }
.presentation-mode .text-md { font-size: 0.8em; }
.presentation-mode .text-base { font-size: 0.85em; }
.presentation-mode .text-lg { font-size: 0.9em; }
.presentation-mode .text-xl { font-size: 0.95em; }
.presentation-mode .text-2xl { font-size: 1em; }
.presentation-mode .text-3xl { font-size: 1.1em; }
.presentation-mode .text-4xl { font-size: 1.2em; }

/* ===========================================================
   CONTROLS
   =========================================================== */

.pres-controls {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 44px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: #0a0a1a;
    font-family: var(--ws-font);
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
}

.pres-controls button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 0.4rem;
    padding: 0.35em 0.8em;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s;
    white-space: nowrap;
}
.pres-controls button:hover { background: rgba(255,255,255,0.2); }
.pres-controls button.active { background: var(--ws-gold); color: #1a1a2e; border-color: var(--ws-gold); }

/* Pulsate the Next button whenever it's visible — draws the eye to
   the call-to-action after the user reaches the end of the current
   slide. Display:none on the button suppresses the animation
   naturally. */
#pres-next {
    animation: presNextPulsate 1.2s ease-in-out infinite;
}

/* Pulsate the play/pause button whenever it is showing the play icon
   (i.e. playback is paused/available). The button loses its .active
   class in that state, so :not(.active) targets exactly the moments a
   play action is offered. Drops the animation as soon as playback
   resumes (.active is re-added). */
#pres-play-pause:not(.active) {
    animation: presNextPulsate 1.2s ease-in-out infinite;
}

/* Start gate: full-screen dark overlay with a big centred play button shown
   before the first slide runs. Clicking it starts playback and supplies the
   user gesture browsers need to allow audio. */
.pres-start-gate {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.pres-start-gate-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--ws-gold);
    color: #1a1a2e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    padding-left: 0.4rem; /* optically centre the play triangle */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: presStartPulse 1.6s ease-in-out infinite;
}
.pres-start-gate-btn:hover { background: #fff; }

@keyframes presStartPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(253, 182, 20, 0.55), 0 8px 32px rgba(0, 0, 0, 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 28px rgba(253, 182, 20, 0), 0 8px 32px rgba(0, 0, 0, 0.5);
    }
}

@keyframes presNextPulsate {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(253, 182, 20, 0.55);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 10px rgba(253, 182, 20, 0);
    }
}

.pres-controls-center {
    display: flex; align-items: center; gap: 0.5rem;
    flex: 1; justify-content: center;
    max-width: 350px; margin: 0 1rem;
}
.pres-controls .pres-progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; overflow: hidden; }
.pres-controls .pres-progress-bar .pres-progress-fill { height: 100%; background: var(--ws-gold); transition: width 0.3s ease; }
.pres-controls .pres-slide-counter { font-size: 0.75rem; color: rgba(255,255,255,0.5); min-width: 3em; text-align: center; }
.pres-countdown { font-size: 0.75rem; color: rgba(255,255,255,0.5); min-width: 4em; text-align: right; }

/* --- Top overlays --- */
.pres-back-btn {
    position: fixed; top: 1vh; left: 1vw; z-index: 200;
    display: flex; align-items: center; gap: 0.3em;
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15); border-radius: 0.4rem;
    padding: 0.3em 0.7em; color: rgba(255,255,255,0.7); text-decoration: none;
    font-size: clamp(11px, 1vw, 14px); font-family: var(--ws-font);
}
.pres-back-btn:hover { color: #fff; background: rgba(0,0,0,0.7); }

.pres-lang-toggle {
    position: fixed; top: 1vh; right: 1vw; z-index: 200;
    display: flex; gap: 0.3rem;
}
.pres-lang-toggle button {
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6); border-radius: 0.3rem;
    padding: 0.2em 0.5em; font-size: clamp(10px, 0.9vw, 13px); font-weight: 600; cursor: pointer;
}
.pres-lang-toggle button.active { background: var(--ws-gold); color: #1a1a2e; border-color: var(--ws-gold); }

/* ===========================================================
   QUIZ
   =========================================================== */

.presentation-mode .quiz-slide { text-align: left; }
.presentation-mode .quiz-slide h2,
.presentation-mode .quiz-slide .slide-subtitle { display: none !important; height: 0 !important; margin: 0 !important; padding: 0 !important; line-height: 0 !important; }

.presentation-mode .quiz-questions { display: flex; flex-direction: column; gap: 1.5vh; width: 100%; flex: 1; justify-content: center; }
.presentation-mode .quiz-question { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 0.5rem; padding: 1.5vh 1.5vw; }
.presentation-mode .quiz-question-text { font-size: clamp(13px, 1.3vw, 20px); font-weight: 600; color: #fff; margin-bottom: 1vh; }
.presentation-mode .quiz-options { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 0.5vw; }
.presentation-mode .quiz-option {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 0.4rem;
    padding: 0.8vh 0.8vw; color: rgba(255,255,255,0.8); font-size: clamp(11px, 1vw, 16px); cursor: pointer;
    text-align: left; transition: all 0.15s; line-height: 1.4;
}
.presentation-mode .quiz-option:hover { background: rgba(255,255,255,0.1); color: #fff; }
.presentation-mode .quiz-option.selected { background: rgba(253,182,20,0.15); border-color: var(--ws-gold); color: #fff; }
.presentation-mode .quiz-option.correct { background: rgba(16,185,129,0.2); border-color: #10b981; color: #fff; }
.presentation-mode .quiz-option.incorrect { background: rgba(233,69,96,0.2); border-color: #e94560; color: #fff; }
.presentation-mode .quiz-option.was-correct { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.4); color: #10b981; }
.presentation-mode .quiz-option[disabled] { cursor: default; opacity: 0.9; }
.presentation-mode .quiz-explanation { margin-top: 0.5vh; padding: 0.5vh 1vw; background: rgba(253,182,20,0.08); border-left: 3px solid var(--ws-gold); border-radius: 0 0.3rem 0.3rem 0; font-size: clamp(10px, 0.9vw, 14px); color: var(--ws-subtle); line-height: 1.4; }
.presentation-mode .quiz-actions { margin-top: 1.5vh; text-align: center; flex-shrink: 0; }
.presentation-mode .quiz-submit-btn { background: var(--ws-gold); color: #1a1a2e; border: none; padding: 0.6em 2em; border-radius: 0.4rem; font-weight: 700; font-size: clamp(13px, 1.1vw, 18px); cursor: pointer; }
.presentation-mode .quiz-submit-btn:hover:not([disabled]) { background: #fff; }
.presentation-mode .quiz-submit-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.presentation-mode .quiz-submit-btn.submitted { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }
.presentation-mode .quiz-result { margin-top: 1vh; text-align: center; font-size: clamp(13px, 1.2vw, 18px); font-weight: 600; }
.presentation-mode .quiz-result.all-correct { color: #10b981; }
.presentation-mode .quiz-result.has-errors { color: var(--ws-gold); }

/* ===========================================================
   MOBILE
   =========================================================== */

@media (max-width: 768px) {
    :root { --slide-pad-x: 4vw; --slide-pad-top: 2vh; }

    .presentation-mode .comp-columns,
    .presentation-mode .before-after { flex-direction: column; gap: 1vh; }

    .presentation-mode .icon-grid { grid-template-columns: 1fr; gap: 1vh; }
    .presentation-mode .grid-2 { grid-template-columns: 1fr; gap: 1vh; }
    .presentation-mode .breakdown-items { grid-template-columns: 1fr; }
    .presentation-mode .quiz-options { grid-template-columns: 1fr 1fr; }

    .pres-controls { padding: 0 0.5rem; }
    .pres-controls button { padding: 0.3em 0.5em; font-size: 0.7rem; }
    .pres-controls-center { max-width: 180px; margin: 0 0.3rem; }
}

@media (max-width: 480px) {
    .presentation-mode .quiz-options { grid-template-columns: 1fr; }
}

/* ===========================================================
   LARGE SCREENS (desktops / external monitors, not laptops)
   The control bar is sized for laptops; on bigger displays it
   looks too thin and the buttons too small. Scale it up so the
   navigation stays comfortably clickable and clearly visible.
   =========================================================== */
@media (min-width: 1600px) {
    /* Control bar is taller here - keep the slide area clear of it. */
    :root { --deck-h: calc(100vh - 60px); }
    .presentation-mode { bottom: 60px; }
    .pres-controls { height: 60px; padding: 0 2rem; font-size: 1rem; }
    .pres-controls button { padding: 0.5em 1.2em; font-size: 1rem; border-radius: 0.5rem; }
    .pres-controls-center { max-width: 480px; margin: 0 1.5rem; gap: 0.8rem; }
    .pres-controls .pres-progress-bar { height: 6px; }
    .pres-controls .pres-slide-counter { font-size: 0.95rem; }
    .pres-countdown { font-size: 0.95rem; }
    .pres-start-gate-btn { width: 160px; height: 160px; font-size: 4rem; }
}

@media (min-width: 2200px) {
    :root { --deck-h: calc(100vh - 74px); }
    .presentation-mode { bottom: 74px; }
    .pres-controls { height: 74px; padding: 0 3rem; font-size: 1.2rem; }
    .pres-controls button { padding: 0.55em 1.4em; font-size: 1.2rem; }
    .pres-controls-center { max-width: 600px; }
    .pres-controls .pres-progress-bar { height: 8px; }
    .pres-controls .pres-slide-counter { font-size: 1.1rem; }
    .pres-countdown { font-size: 1.1rem; }
    .pres-start-gate-btn { width: 200px; height: 200px; font-size: 5rem; }
}

/* ===========================================================
   CATALOG
   =========================================================== */

.pres-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; padding: 1rem 0; }
.pres-catalog-card { background: var(--card-bg, rgba(255,255,255,0.05)); border: 1px solid var(--border-color, rgba(255,255,255,0.08)); border-radius: 0.8rem; padding: 1.2rem; cursor: pointer; transition: border-color 0.2s; }
.pres-catalog-card:hover { border-color: var(--ws-gold, #fdb614); }
.pres-catalog-card .card-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.3rem; }
.pres-catalog-card .card-level { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.pres-catalog-card .card-progress { height: 4px; background: rgba(128,128,128,0.2); border-radius: 2px; overflow: hidden; margin-bottom: 0.5rem; }
.pres-catalog-card .card-progress-fill { height: 100%; background: var(--ws-gold, #fdb614); }
.pres-catalog-card .card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; }
.pres-catalog-card .card-langs { display: flex; gap: 0.3rem; }
.pres-catalog-card .lang-badge { font-size: 0.65rem; font-weight: 600; padding: 0.1em 0.4em; border-radius: 0.2rem; background: rgba(128,128,128,0.15); text-transform: uppercase; }
.pres-catalog-card .card-state { font-size: 0.75rem; font-weight: 600; }
.pres-catalog-card .card-state.completed { color: var(--ws-practice, #10b981); }
.pres-catalog-card .card-state.in-progress { color: var(--ws-gold, #fdb614); }

/* =========================================================
   LAYOUT slide type - rows of full-width lines and grid cells
   ========================================================= */
.presentation-mode .layout-card { gap: 2.6vh; }
.presentation-mode .layout-row {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    gap: 1.2vw;
    width: 100%;
}
.presentation-mode .layout-cell,
.presentation-mode .layout-line {
    border-radius: var(--ws-radius);
    padding: 1.7vh 1.8vw;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-size: clamp(14px, 1.5vw, 26px);
    line-height: 1.45;
}
.presentation-mode .layout-cell { text-align: left; display: flex; flex-direction: column; justify-content: center; }
.presentation-mode .lc-points { text-align: left; margin: 0.5em 0 0; padding-left: 1.1em; }
.presentation-mode .lc-points li { margin-bottom: 0.4em; line-height: 1.4; }
.presentation-mode .layout-cell .lc-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.06em;
    margin-bottom: 0.45em;
    color: var(--lc-accent, #fff);
}
.presentation-mode .layout-cell .lc-text { text-align: left; opacity: 0.95; }
.presentation-mode .layout-line { text-align: left; border-left: 4px solid var(--lc-accent, rgba(255,255,255,0.25)); }
.presentation-mode .layout-line strong { color: var(--lc-accent, #fff); }

/* Color palette (shared by cells and lines via ls-*) */
.presentation-mode .ls-glass  { }
.presentation-mode .ls-blue   { --lc-accent: #93c5fd; background: rgba(59,130,246,0.16);  border-color: rgba(96,165,250,0.45); }
.presentation-mode .ls-teal   { --lc-accent: #5eead4; background: rgba(20,184,166,0.16);  border-color: rgba(45,212,191,0.45); }
.presentation-mode .ls-green  { --lc-accent: #86efac; background: rgba(34,197,94,0.16);   border-color: rgba(74,222,128,0.45); }
.presentation-mode .ls-amber  { --lc-accent: #fcd34d; background: rgba(245,158,11,0.16);  border-color: rgba(251,191,36,0.50); }
.presentation-mode .ls-red    { --lc-accent: #fca5a5; background: rgba(239,68,68,0.16);   border-color: rgba(248,113,113,0.50); }
.presentation-mode .ls-purple { --lc-accent: #c4b5fd; background: rgba(139,92,246,0.18);  border-color: rgba(167,139,250,0.50); }
.presentation-mode .ls-gold   { --lc-accent: #fdb614; background: rgba(253,182,20,0.16);  border-color: rgba(253,182,20,0.55); }
.presentation-mode .ls-cream  { --lc-accent: #f5e9c8; background: rgba(245,233,200,0.14); border-color: rgba(245,233,200,0.45); }
.presentation-mode .ls-dark   { --lc-accent: #cbd5e1; background: rgba(15,23,42,0.55);    border-color: rgba(148,163,184,0.45); }

/* image cell: PNG / JPG / GIF / SVG via a plain <img> */
.presentation-mode .layout-img-cell { align-items: center; justify-content: center; padding: 1vh 1vw; }
.presentation-mode .lc-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--ws-radius);
    display: block;
    margin: 0 auto;
}
.presentation-mode .lc-caption { text-align: center; font-size: 0.82em; opacity: 0.8; margin-top: 0.6em; }
/* size "full": let a wide/tall information diagram use the full card height */
.presentation-mode .lc-image-full { max-height: 78vh; }

/* native charts (bar / pie) - reusable inside any layout slide */
.presentation-mode .layout-chart { width: 100%; padding: 1vh 0.5vw; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.presentation-mode .chart-bars { display: flex; flex-direction: column; flex: 1; justify-content: space-evenly; gap: 2vh; }
.presentation-mode .chart-bar-row { display: grid; grid-template-columns: 26% 1fr; align-items: center; gap: 1.2em; }
.presentation-mode .chart-bar-label { text-align: right; font-size: clamp(15px, 1.5vw, 26px); font-weight: 600; opacity: 0.95; line-height: 1.2; }
.presentation-mode .chart-bar-track {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    height: clamp(2.2em, 7vh, 3.6em);
    box-shadow: inset 0 2px 7px rgba(0,0,0,0.40);
}
.presentation-mode .chart-bar-fill {
    width: 0;
    height: 100%; border-radius: 999px; min-width: 2.8em;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 0.9em;
    position: relative; overflow: hidden;
    background: var(--bar-color, #3b82f6);
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--bar-color, #3b82f6) 78%, #000) 0%,
        var(--bar-color, #3b82f6) 58%,
        color-mix(in srgb, var(--bar-color, #3b82f6) 50%, #fff) 100%);
    box-shadow: 0 0 24px -4px var(--bar-color, #3b82f6), inset 0 1px 0 rgba(255,255,255,0.45);
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
/* sheen stripe - sweeps once when the bar reveals */
.presentation-mode .chart-bar-fill::after {
    content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.40), transparent);
    transform: translateX(-130%);
}
.presentation-mode .reveal .fragment.visible .chart-bar-fill { width: var(--bar-w, 0); }
.presentation-mode .reveal .fragment.visible .chart-bar-fill::after {
    animation: chart-sheen 1.5s ease-out 0.55s 1 forwards;
}
@keyframes chart-sheen { to { transform: translateX(360%); } }
.presentation-mode .chart-bar-val { font-weight: 800; font-size: clamp(14px, 1.4vw, 24px); color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.55); }
/* pie: each slice reveals paired with its legend row. Wedges (conic-gradient layers)
   stack in column 1; legend rows fill column 2. Grid placement decouples the visual
   layout from the interleaved wedge/row DOM order used for paired reveal. */
.presentation-mode .chart-pie2 {
    display: grid;
    grid-template-columns: min(46vh, 32vw) minmax(0, 1fr);
    align-items: center;
    gap: 0 4vw;
    width: 100%; height: 100%;
    padding: 0 2vw;
}
.presentation-mode .pie2-base,
.presentation-mode .pie2-wedge {
    grid-column: 1; grid-row: 1 / -1;
    align-self: center; justify-self: center;
    width: min(46vh, 32vw); height: min(46vh, 32vw); aspect-ratio: 1 / 1;
    border-radius: 50%;
}
/* base ring: shape + glow + gloss, always visible (placeholder the slices fill in) */
.presentation-mode .pie2-base {
    position: relative;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
    box-shadow: 0 0 34px -6px rgba(125,185,255,0.40), 0 8px 22px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.25);
}
.presentation-mode .pie2-base::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle at 38% 30%, rgba(255,255,255,0.26), rgba(255,255,255,0) 56%);
}
/* wedge reveal: grow from the centre (override the default translateY fade-up) */
.presentation-mode .reveal .fragment.fade-up.pie2-wedge { transform: scale(0.5); opacity: 0; transform-origin: center; }
.presentation-mode .reveal .fragment.fade-up.pie2-wedge.visible { transform: scale(1); opacity: 1; }
/* legend rows in column 2, auto-placed into successive rows */
.presentation-mode .pie2-legrow {
    grid-column: 2;
    display: flex; align-items: flex-start; gap: 0.8em;
    font-size: clamp(15px, 1.5vw, 24px); line-height: 1.35;
}
.presentation-mode .pie2-swatch {
    width: 1.15em; height: 1.15em; border-radius: 4px; flex: 0 0 auto; margin-top: 0.12em;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--swatch-color, #3b82f6) 78%, #000),
        var(--swatch-color, #3b82f6) 60%,
        color-mix(in srgb, var(--swatch-color, #3b82f6) 50%, #fff));
    box-shadow: 0 0 14px -3px var(--swatch-color, #3b82f6), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* left-to-right process flow: boxes (title + body) with arrows between, up to ~4 per row */
.presentation-mode .layout-flow { display: flex; align-items: stretch; justify-content: center; width: 100%; gap: 0; }
.presentation-mode .flow-item { display: flex; align-items: center; flex: 1 1 0; min-width: 0; gap: clamp(0.4em, 1.1vw, 1.2em); }
.presentation-mode .flow-arrow { flex: 0 0 auto; color: #93c5fd; font-size: clamp(18px, 2.4vw, 40px); opacity: 0.8; }
.presentation-mode .flow-step {
    flex: 1 1 0; min-width: 0; align-self: stretch;
    display: flex; flex-direction: column; justify-content: center; gap: 0.55em;
    padding: clamp(1em, 2.8vh, 2.1em) clamp(0.7em, 1.3vw, 1.5em);
    border: 1px solid var(--lc-accent, rgba(255,255,255,0.22));
    border-radius: var(--ws-radius);
    text-align: center;
}
.presentation-mode .flow-step-title { font-weight: 800; color: var(--lc-accent, #fff); font-size: clamp(15px, 1.5vw, 26px); line-height: 1.2; }
.presentation-mode .flow-step-text { opacity: 0.95; font-size: clamp(12px, 1.1vw, 19px); line-height: 1.35; }

/* native line chart: SVG line that draws itself on slide activation; points
   light up per fragment. Same glow + easing family as the bars/pie. */
.presentation-mode .chart-line-svg { width: 100%; height: 100%; max-height: 72vh; overflow: visible; display: block; }
.presentation-mode .chart-line-area { fill: var(--line-color, #06b6d4); fill-opacity: 0.14; opacity: 0; }
.presentation-mode .chart-line-path {
    fill: none; stroke: var(--line-color, #06b6d4); stroke-width: 5;
    stroke-linecap: round; stroke-linejoin: round;
    filter: drop-shadow(0 0 8px var(--line-color, #06b6d4));
    stroke-dasharray: 1; stroke-dashoffset: 1;
}
.presentation-mode .chart-line-dot { fill: var(--line-color, #06b6d4); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 6px var(--line-color, #06b6d4)); }
.presentation-mode .chart-line-val { fill: #fff; font-weight: 800; font-size: 28px; text-anchor: middle; }
.presentation-mode .chart-line-xlabel { fill: rgba(255,255,255,0.85); font-size: 25px; text-anchor: middle; }
@keyframes line-draw { to { stroke-dashoffset: 0; } }
@keyframes line-area-in { to { opacity: 1; } }
.presentation-mode .reveal section.present .chart-line-path { animation: line-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.presentation-mode .reveal section.present .chart-line-area { animation: line-area-in 1.2s ease 0.3s forwards; }

/* full_image slide: image fills the viewport, optional caption band */
.presentation-mode .full-image-slide { padding: 0 !important; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.presentation-mode .full-image { max-width: 100%; max-height: 100vh; width: auto; height: auto; object-fit: contain; }

/* video slide: title + large muted/looping video (narration is the audio) */
.presentation-mode .video-slide { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.presentation-mode .video-slide h2 { margin: 0; flex: 0 0 auto; }
.presentation-mode .full-video {
    max-width: 100%; max-height: 82vh; width: auto; height: auto;
    object-fit: contain; border-radius: var(--ws-radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    background: #000;
}

/* icon cell: FontAwesome tile (rebuild graphical icon/tile grids natively, not as baked images) */
.presentation-mode .layout-icon-cell { align-items: center; justify-content: flex-start; text-align: center; }
.presentation-mode .lc-icon {
    font-size: clamp(28px, 3.4vw, 52px);
    color: var(--lc-accent, #fff);
    margin-bottom: 0.5em;
    line-height: 1;
}
.presentation-mode .layout-icon-cell .lc-title,
.presentation-mode .layout-icon-cell .lc-text { text-align: center; }

/* native data table: static header row + row-by-row revealed body.
   Adapts to row count: few rows -> bigger font + taller rows so it fills the
   card instead of floating as a thin strip. (.lt-roomy <=3 rows, .lt-comfy <=6) */
.presentation-mode .layout-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed;
    font-size: clamp(15px, 1.35vw, 24px);   /* default / many rows */
    --lc-accent: rgba(255,255,255,0.30);
    --cell-pad-y: 0.7em;
}
.presentation-mode .layout-table.lt-comfy { font-size: clamp(17px, 1.6vw, 28px); --cell-pad-y: 1.6vh; }
.presentation-mode .layout-table.lt-roomy { font-size: clamp(19px, 1.9vw, 34px); --cell-pad-y: 3.4vh; }
.presentation-mode .layout-table thead th {
    color: #fff;
    font-weight: 800;
    padding: var(--cell-pad-y) 0.8em;
    border-bottom: 2px solid var(--lc-accent, rgba(255,255,255,0.45));
    vertical-align: bottom;
}
.presentation-mode .layout-table tbody td {
    padding: var(--cell-pad-y) 0.8em;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    vertical-align: middle;
    line-height: 1.35;
}
.presentation-mode .layout-table tbody td:first-child { font-weight: 700; color: #fff; }
.presentation-mode .layout-table tbody tr.fragment { transition: opacity 0.4s ease; }

@media (max-width: 760px) {
    .presentation-mode .layout-row { grid-template-columns: 1fr; }
}

/* --- Audio preloader (loading screen shown until all narration is cached) --- */
.pres-preloader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1830;
    transition: opacity 0.4s ease;
}
.pres-preloader.hide { opacity: 0; pointer-events: none; }
.pres-preloader-box {
    width: min(86vw, 360px);
    text-align: center;
    color: #fff;
    font-family: Inter, system-ui, sans-serif;
}
.pres-preloader-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.1rem; color: #fff; }
.pres-preloader-track {
    height: 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.pres-preloader-fill {
    height: 100%;
    width: 0;
    background: #fdb614;
    border-radius: 99px;
    transition: width 0.2s ease;
}
.pres-preloader-pct { margin-top: 0.65rem; font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); }
