/* ================================================================
   LiveDeck — Application Styles
   ================================================================ */

:root {
    --brand-primary:   #6c63ff;
    --brand-secondary: #4ecdc4;
    --dark-bg:         #1a1a2e;
    --panel-bg:        #16213e;
    --card-bg:         #0f3460;
    --text-light:      #e0e0e0;
    --success-green:   #2ecc71;
    --warning-amber:   #f39c12;
    --danger-red:      #e74c3c;
}

/* ── Reset / Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f5f7fa; color: #333; }

/* ── Landing page ──────────────────────────────────────────────── */
.landing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-bg), var(--card-bg));
}
.landing-card {
    text-align: center;
    padding: 3rem 4rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}
.brand { font-size: 3.5rem; font-weight: 800; letter-spacing: -1px; color: var(--brand-primary); }
.tagline { font-size: 1.2rem; opacity: 0.7; margin: 0.5rem 0 2rem; }
.action-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Auth card ─────────────────────────────────────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
}
.auth-card {
    background: var(--panel-bg);
    color: var(--text-light);
    border-radius: 0.75rem;
    padding: 2rem;
    width: min(400px, 95vw);
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.auth-hero-wrapper {
    overflow: hidden;
    margin: -2rem -2rem 0 -2rem;
    border-radius: 0.75rem 0.75rem 0 0;
    flex-shrink: 0;
}
.auth-hero-img {
    display: block;
    width: 100%;
    height: auto;
}
.auth-form-area {
    padding: 1.5rem 0 0;
}
.auth-form-area label { color: var(--text-light); opacity: 0.75; font-size: 0.85rem; }
.auth-form-area .form-control {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
    color: var(--text-light);
}
.auth-form-area .form-control:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--brand-primary);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(108,99,255,0.25);
}
.auth-form-area .form-control::placeholder { color: rgba(224,224,224,0.4); }
@media (max-width: 500px) {
    .auth-container {
        align-items: stretch;
        background: var(--dark-bg);
        padding: 0;
    }
    .auth-card {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        box-shadow: none;
    }
    .auth-hero-wrapper {
        flex: 0 1 auto;
        min-height: 0;
        max-height: none;
        border-radius: 0;
        margin: 0;
    }
    .auth-form-area {
        flex: 0 0 auto;
        padding: 1.5rem 0 2rem;
    }
}
.auth-card h2 { margin-bottom: 1.5rem; }
.auth-welcome-msg { font-size: 1.15rem; font-weight: 600; text-align: center; margin-bottom: 1.25rem; color: var(--text-light); }

/* ── Presenter layout ──────────────────────────────────────────── */
.presenter-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}
.presenter-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.slide-list-panel {
    background: var(--panel-bg);
    color: var(--text-light);
    padding: 1rem;
    overflow-y: auto;
    border-right: 1px solid #333;
}
.slide-list-panel h3 { color: white; margin-bottom: 1rem; }
.slide-thumb {
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
}
.slide-thumb:hover { background: rgba(255,255,255,0.1); }
.slide-thumb.active { background: var(--brand-primary); }
.slide-num { font-size: 0.8rem; opacity: 0.6; }
.slide-title-sm { font-size: 0.85rem; flex: 1; }
.current-badge {
    font-size: 0.65rem;
    background: var(--success-green);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}
.poll-thumb {
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
    background: rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.poll-thumb:hover { background: rgba(255,255,255,0.1); }
.poll-thumb.active { background: var(--brand-primary); }
.poll-type-badge { font-size: 0.65rem; opacity: 0.6; }
.poll-q-preview { font-size: 0.85rem; }
.editor-main {
    background: #f5f7fa;
    overflow-y: auto;
    padding: 1.5rem;
}
.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 0.75rem;
}
.slide-title-input { max-width: 200px; }
.canvas-position-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.empty-editor {
    text-align: center;
    margin-top: 5rem;
    color: #aaa;
    font-size: 1.2rem;
}
.poll-assignment { background: white; padding: 1rem; border-radius: 0.5rem; }

/* ── Canvas ────────────────────────────────────────────────────── */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: #e8eaf0;
    border-radius: 0.5rem;
    cursor: grab;
}
.canvas-wrapper:active { cursor: grabbing; }
.canvas-plane {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}
.slide-node {
    position: absolute;
    width: 1100px;
    min-height: 620px;
    background: white;
    overflow: hidden;
}
/* In edit mode, show a subtle dashed outline so slide boundaries are visible */
.slide-node.edit-mode {
    outline: 2px dashed rgba(108, 99, 255, 0.45);
    outline-offset: -1px;
}
.canvas-element {
    position: absolute;
    user-select: none;
    touch-action: none;
}
.canvas-element.dragging { opacity: 0.8; cursor: grabbing; }
.canvas-element.element-selected { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.canvas-element--hidden-preview {
    outline: 1px dashed rgba(108, 99, 255, 0.55);
    outline-offset: 1px;
}
.text-content {
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    outline: none;
    user-select: text;
    cursor: text;
}
.code-block {
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.9rem;
    overflow: auto;
    border-radius: 0.25rem;
}
.drag-handle {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #c4ccd8;
    color: #556277;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.canvas-element:hover .drag-handle,
.canvas-element.element-selected .drag-handle {
    opacity: 1;
}
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: var(--brand-primary);
    cursor: se-resize;
    border-radius: 2px;
}
.element-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}
.canvas-element:hover .element-delete,
.canvas-element.element-selected .element-delete { display: flex; }
.slide-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    pointer-events: none;
    z-index: 100;
}
.slide-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: #aaa;
    padding: 0.25rem;
    background: rgba(0,0,0,0.03);
}

/* ── Element properties bar (editor) ───────────────────────────── */
.element-props-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #eef1f7;
    border: 1px solid #d0d7e6;
    border-radius: 0.4rem;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.element-props-bar .props-label {
    font-weight: 600;
    color: var(--brand-primary);
    white-space: nowrap;
}
.props-element-picker {
    width: 240px !important;
}
.props-empty {
    color: #657187;
}
.props-content-input {
    width: min(360px, 50vw) !important;
}
.props-help {
    color: #657187;
    font-size: 0.78rem;
}
.element-props-bar input[type="text"],
.element-props-bar input[type="number"] {
    padding: 0.2rem 0.45rem;
    border: 1px solid #c4ccd8;
    border-radius: 0.3rem;
    font-size: 0.85rem;
    background: white;
}
.element-props-bar input[type="text"]  { width: 160px; }
.element-props-bar input[type="number"] { width: 72px; }

/* ── Rich-text formatting toolbar ──────────────────────────────── */
.fmt-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
}
.fmt-btn {
    padding: 0.15rem 0.5rem;
    background: white;
    border: 1px solid #c4ccd8;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
    color: #333;
    min-width: 26px;
}
.fmt-btn:hover { background: #eef1f7; border-color: #a0abbe; }
.fmt-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #c4ccd8;
    margin: 0 3px;
}
.fmt-size {
    width: 56px;
    padding: 0.15rem 0.35rem;
    border: 1px solid #c4ccd8;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}
.fmt-color {
    width: 30px;
    height: 26px;
    padding: 1px 2px;
    border: 1px solid #c4ccd8;
    border-radius: 0.25rem;
    cursor: pointer;
}
.html-editor-panel {
    background: white;
    border: 1px solid #d0d7e6;
    border-radius: 0.5rem;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.html-source-input {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.85rem;
}
.html-editor-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.65rem;
    flex-wrap: wrap;
}
.steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.step-card {
    background: white;
    border: 1px solid #dbe1ec;
    border-radius: 0.55rem;
    overflow: hidden;
}
.step-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    user-select: none;
}
.step-card-header:hover {
    background: #f6f8fc;
}
.step-num {
    font-weight: 700;
    color: #556277;
    min-width: 1.25rem;
}
.step-title {
    flex: 1;
    min-width: 0;
}
.step-actions-count {
    flex-shrink: 0;
}
.step-card-body {
    padding: 0.9rem 0.85rem 1rem;
    border-top: 1px solid #eef2f7;
}

/* ── Presentation view ─────────────────────────────────────────── */
.presentation-root {
    position: fixed;
    inset: 0;
    background: #111;
    overflow: hidden;
}
.presentation-root .canvas-wrapper {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background: #1a1a2e;
}

/* Poll overlay — base (positioning only; .poll-overlay supplies the box styling) */
.presentation-overlay {
    position: fixed;
    z-index: 200;
}
/* Poll overlay — position variants */
.presentation-overlay.overlay-bottom-right  { bottom: 6rem;   right:  2rem; }
.presentation-overlay.overlay-bottom-left   { bottom: 6rem;   left:   2rem; }
.presentation-overlay.overlay-top-right     { top:    3.5rem; right:  2rem; }
.presentation-overlay.overlay-top-left      { top:    3.5rem; left:   2rem; }
.presentation-overlay.overlay-bottom-center { bottom: 6rem;   left: 50%; transform: translateX(-50%); }
.presentation-overlay.overlay-top-center    { top:    3.5rem; left: 50%; transform: translateX(-50%); }
.presentation-overlay.overlay-center        { top:    50%;    left: 50%; transform: translate(-50%, -50%); }

/* Sentiment bar — base */
.presentation-sentiment-bar {
    position: fixed;
    z-index: 200;
    left: 0;
    right: 0;
    bottom: 0;
    padding-left: 3.75rem;
    background: rgba(0,0,0,0.6);
}
.presentation-sentiment-bar .sentiment-overlay { background: transparent; }
/* Sentiment bar — position variants */
.presentation-sentiment-bar.sentiment-bottom-right,
.presentation-sentiment-bar.sentiment-bottom-left,
.presentation-sentiment-bar.sentiment-bottom-center { bottom: 0; }
.presentation-sentiment-bar.sentiment-top-right,
.presentation-sentiment-bar.sentiment-top-left,
.presentation-sentiment-bar.sentiment-top-center    { top: 0; }
.presentation-status-bar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 300;
}
.connection-status {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}
.connection-status.connected { background: var(--success-green); color: white; }
.connection-status.disconnected { background: var(--danger-red); color: white; }
.connection-status .connection-count { margin-left: 0.4rem; opacity: 0.9; font-weight: 600; }
.sentiment-toggle-btn {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 300;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transition: opacity 0.2s, background 0.2s;
}
.sentiment-toggle-btn:hover { opacity: 0.85; background: rgba(255,255,255,0.25); }
.sentiment-toggle-btn.active { opacity: 0.85; background: transparent; }
.presentation-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: white;
    font-size: 1.5rem;
}

/* ── Poll results ──────────────────────────────────────────────── */
.poll-results { padding: 0.5rem 0; }
.result-row {
    display: grid;
    grid-template-columns: 180px 1fr 80px;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.result-label { font-size: 0.9rem; }
.result-bar-track { background: #e9ecef; border-radius: 1rem; height: 18px; overflow: hidden; }
.result-bar { background: var(--brand-primary); height: 100%; border-radius: 1rem; transition: width 0.4s ease; }
.result-count { font-size: 0.85rem; text-align: right; }
.result-participants { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -0.25rem 0 0.75rem 0; }
.rating-stats { display: flex; gap: 1.5rem; }
.stat { text-align: center; }
.stat-val { display: block; font-size: 2rem; font-weight: 700; color: var(--brand-primary); }
.stat-lbl { font-size: 0.75rem; color: #888; text-transform: uppercase; }
.text-responses { display: flex; flex-direction: column; gap: 0.5rem; }
.text-response-item {
    background: #f8f9fa;
    border-left: 3px solid var(--brand-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.25rem 0.25rem 0;
    font-style: italic;
    font-size: 0.9rem;
}

/* ── Poll overlay (on canvas) ──────────────────────────────────── */
.poll-overlay {
    background: rgba(0,0,0,0.82);
    color: white;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    min-width: 260px;
}
.poll-canvas-overlay {
    display: flex;
    align-items: stretch;
    z-index: 160;
    pointer-events: none;
}
.poll-canvas-overlay .poll-overlay {
    width: 100%;
    min-width: 0;
}
.poll-overlay-question { font-weight: 700; margin-bottom: 0.5rem; }
.poll-overlay-responses { font-size: 0.75rem; opacity: 0.7; margin-bottom: 0.75rem; }
.overlay-choices { display: flex; flex-direction: column; gap: 0.5rem; }
.overlay-choice-item {
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    background: rgba(255,255,255,0.08);
    font-size: 0.85rem;
    line-height: 1.3;
}
.overlay-bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.overlay-label { font-size: 0.8rem; width: 120px; }
.overlay-bar-track { flex: 1; background: rgba(255,255,255,0.2); border-radius: 1rem; height: 12px; overflow: hidden; }
.overlay-bar { background: var(--brand-secondary); height: 100%; border-radius: 1rem; transition: width 0.4s ease; }
.overlay-pct { font-size: 0.75rem; width: 36px; text-align: right; }
.overlay-rating { font-size: 1rem; }

/* ── Poll overlay preview pane (Poll Manager) ─────────────────── */
.poll-preview-pane {
    flex: 1;
    min-width: 260px;
    background: #1a1a2e;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.poll-preview-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.25rem;
}

/* ── Sentiment overlay ─────────────────────────────────────────── */
.sentiment-overlay { padding: 0.5rem; background: rgba(0,0,0,0.6); }
.sentiment-overlay-label { font-size: 0.7rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.25rem; }
.sentiment-bar-container { display: flex; height: 12px; border-radius: 1rem; overflow: hidden; background: rgba(255,255,255,0.12); }
.segment { height: 100%; transition: width 0.6s ease; }
.seg-very-negative { background: #c0392b; }
.seg-negative      { background: #e67e22; }
.seg-positive      { background: #7cb342; }
.seg-very-positive { background: #16a085; }
.sentiment-avg { font-size: 0.7rem; color: rgba(255,255,255,0.6); margin-top: 0.25rem; }
.sentiment-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 0.4rem;
    max-height: 120px;
    overflow-y: auto;
}
.sentiment-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.sentiment-dot--vn { background: #c0392b; }
.sentiment-dot--n  { background: #e67e22; }
.sentiment-dot--p  { background: #7cb342; }
.sentiment-dot--vp { background: #16a085; }

.sentiment-participant {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px 1px 1px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.9);
    max-width: 160px;
}
.sentiment-participant .sentiment-dot { width: 18px; height: 18px; }
.sentiment-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* ── Connected-audience badges on presenter dashboard ─────────────── */
.connected-audience { margin-top: 0.75rem; margin-bottom: 1rem; }
.connected-audience-label { font-size: 0.85rem; color: #555; margin-bottom: 0.4rem; }
.connected-audience-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.connected-audience-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    font-size: 0.72rem;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Audience participation ─────────────────────────────────────── */
.participate-container {
    min-height: 100vh;
    background: var(--dark-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}
.participate-header {
    background: var(--panel-bg);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}
.session-title { font-weight: 700; font-size: 1.1rem; }
.nickname-badge {
    background: var(--brand-primary);
    color: inherit;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: filter 0.15s;
}
.nickname-badge:hover { filter: brightness(1.15); }
.nickname-input {
    background: var(--panel-bg);
    color: var(--text-light);
    border: 1px solid var(--brand-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    outline: none;
    max-width: 12rem;
}
.participate-body { padding: 1.5rem; flex: 1; max-width: 600px; margin: 0 auto; width: 100%; }

.sentiment-section { margin-bottom: 2rem; }
.sentiment-faces {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.sentiment-face {
    background: none;
    border: 3px solid transparent;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: transform 0.15s, opacity 0.15s, background 0.15s, border-color 0.15s;
}
.sentiment-face:hover { opacity: 0.65; transform: scale(1.1); }
.sentiment-face--vn:hover { border-color: #c0392b; }
.sentiment-face--n:hover  { border-color: #e67e22; }
.sentiment-face--z:hover  { border-color: #e0b800; }
.sentiment-face--p:hover  { border-color: #7cb342; }
.sentiment-face--vp:hover { border-color: #16a085; }
.sentiment-face--vn.active { opacity: 1; transform: scale(1.18); border-color: #c0392b; background: rgba(192,57,43,0.15); }
.sentiment-face--n.active  { opacity: 1; transform: scale(1.18); border-color: #e67e22; background: rgba(230,126,34,0.15); }
.sentiment-face--z.active  { opacity: 1; transform: scale(1.18); border-color: #e0b800; background: rgba(224,184,0,0.15); }
.sentiment-face--p.active  { opacity: 1; transform: scale(1.18); border-color: #7cb342; background: rgba(124,179,66,0.15); }
.sentiment-face--vp.active { opacity: 1; transform: scale(1.18); border-color: #16a085; background: rgba(22,160,133,0.15); }

.poll-section {
    background: var(--panel-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
}
.poll-question { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.poll-options { display: flex; flex-direction: column; gap: 0.5rem; }
.poll-option {
    background: rgba(255,255,255,0.07);
    border: 2px solid transparent;
    color: var(--text-light);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}
.poll-option:hover { background: rgba(255,255,255,0.12); }
.poll-option.selected { border-color: var(--brand-primary); background: rgba(108,99,255,0.2); }
.poll-option.disabled, .poll-option[disabled] { opacity: 0.4; cursor: not-allowed; }
.poll-option.disabled:hover, .poll-option[disabled]:hover { background: rgba(255,255,255,0.07); }
.poll-hint { font-size: 0.85rem; opacity: 0.75; margin-bottom: 0.5rem; }
.rating-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.rating-btn {
    background: rgba(255,255,255,0.07);
    border: 2px solid transparent;
    color: var(--text-light);
    width: 44px;
    height: 44px;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
}
.rating-btn:hover { background: rgba(255,255,255,0.15); }
.rating-btn.selected { border-color: var(--brand-primary); background: rgba(108,99,255,0.3); }

.voted-message {
    text-align: center;
    font-size: 1.5rem;
    padding: 2rem;
    color: var(--success-green);
}
.checkmark { font-size: 2rem; }
.waiting-message {
    text-align: center;
    padding: 3rem;
    color: rgba(255,255,255,0.4);
}
.status-message { display: flex; align-items: center; gap: 1rem; justify-content: center; padding: 3rem; color: var(--text-light); }

/* ── Dashboard ──────────────────────────────────────────────────── */
.dashboard-layout { min-height: 100vh; background: #f5f7fa; display: flex; flex-direction: column; }
.dashboard-header {
    background: var(--dark-bg);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.dashboard-header h1 { font-size: 1.4rem; color: var(--brand-primary); }
.dashboard-nav { display: flex; gap: 1.25rem; }
.dashboard-brand { color: var(--brand-primary); text-decoration: none; }
.dashboard-nav a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.dashboard-nav a:hover, .dashboard-nav a.active { color: white; }
.dashboard-nav a.active { font-weight: 600; }
.dashboard-nav-link { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.dashboard-nav-link:hover { color: white; }
.dashboard-body { padding: 1.5rem 2rem; flex: 1; }
.session-panel { background: white; border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.session-meta { font-size: 0.85rem; color: #666; margin: 0.25rem 0 0.75rem; }
.slides-panel { background: white; border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.slide-nav-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.slide-nav-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 0.4rem;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.slide-nav-btn:hover { background: #f8f9fa; }
.slide-nav-btn.current { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.dashboard-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.poll-panel, .sentiment-panel {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.poll-question-live { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.75rem; }
.no-session-panel { text-align: center; padding: 4rem 2rem; }
.create-session-form { max-width: 400px; margin: 1.5rem auto 0; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .presenter-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .slide-list-panel { border-right: none; border-bottom: 1px solid #333; max-height: 200px; }
    .dashboard-columns { grid-template-columns: 1fr; }
    .result-row { grid-template-columns: 120px 1fr 60px; }
    .landing-card { padding: 2rem 1.5rem; }
    .brand { font-size: 2.5rem; }
}

/* ── Presentation editor split layout ─────────────────────────── */
.presentation-editor {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #f5f7fa;
}
.editor-steps-panel {
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    flex: 0 0 var(--steps-panel-width, 360px);
    min-width: 0;
    order: 1;
}
.editor-splitter {
    flex: 0 0 6px;
    background: #c4c9d4;
    cursor: col-resize;
    transition: background 0.12s;
    user-select: none;
    position: relative;
    order: 2;
}
/* Wider transparent hit area so the 6px splitter is easy to grab. */
.editor-splitter::before {
    content: '';
    position: absolute;
    inset: 0 -4px;
}
.editor-splitter:hover,
.editor-splitter.editor-splitter--dragging { background: var(--brand-primary); }
.editor-canvas-panel {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    overflow: hidden;
    flex: 1 1 0;
    min-width: 0;
    order: 3;
}
.editor-canvas-panel .canvas-wrapper {
    flex: 1;
    height: auto;
    min-height: 0;
}
.steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e4ea;
    flex-shrink: 0;
}
.steps-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 0.5rem;
    min-width: 0;
}
.step-card {
    background: #f8f9fa;
    border: 1px solid #e0e4ea;
    border-radius: 0.4rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 0;
}
.step-card-body > * { min-width: 0; }
.step-card-body .form-control,
.step-card-body .form-select { min-width: 0; }
.step-actions-count { display: flex; gap: 4px; flex-shrink: 0; }
.step-actions-count .badge { font-size: 0.65rem; }
.step-card--open { border-color: var(--brand-primary); }
.step-card--dragging { opacity: 0.45; }
.step-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    user-select: none;
}
.step-card-header:hover { background: rgba(99,102,241,0.07); }
.step-card-header:hover .step-title { color: #6366f1; }
.step-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: #999;
    min-width: 18px;
}
.step-title {
    font-size: 0.84rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: grab;
}
.step-title:active { cursor: grabbing; }
.step-card-body {
    padding: 0.75rem;
    border-top: 1px solid #e0e4ea;
    background: white;
}

/* ── Step drag-and-drop drop zones ─────────────────────────────── */
.step-drop-zone {
    height: 4px;
    border-radius: 3px;
    margin: 1px 4px;
    background: transparent;
    transition: background 0.12s;
    position: relative;
    flex-shrink: 0;
}
.step-drop-zone::after {
    content: '';
    display: block;
    height: 3px;
    border-radius: 2px;
    background: transparent;
    margin: 4px 0;
    transition: background 0.12s;
}
.step-drop-zone--active { background: rgba(99,102,241,0.18); }
.step-drop-zone--active::after { background: var(--brand-primary); }

/* When any step is being dragged, make all drop zones visible & larger hit targets */
.steps-list--dragging .step-drop-zone {
    height: 22px;
    background: rgba(99,102,241,0.05);
    border: 1px dashed rgba(99,102,241,0.35);
}
.steps-list--dragging .step-drop-zone::after {
    background: rgba(99,102,241,0.35);
    height: 2px;
}
.steps-list--dragging .step-drop-zone--active {
    background: rgba(99,102,241,0.22);
    border-color: var(--brand-primary);
}

/* ── Bootstrap btn-xs (not in Bootstrap 5) ─────────────────────── */
.btn-xs {
    padding: 0.1rem 0.3rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ── Move indicator (in /present) ──────────────────────────────── */
.move-indicator {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    padding: 0.2rem 0.75rem;
    border-radius: 1rem;
    z-index: 300;
    pointer-events: none;
}
.move-label { font-style: italic; }

/* ── Participate header right cluster ──────────────────────────── */
.participate-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Audience question icon button ─────────────────────────────── */
.question-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}
.question-icon-btn:hover {
    background: rgba(108,99,255,0.25);
    border-color: var(--brand-primary);
    color: white;
}

/* ── Question / Comment modal overlay ──────────────────────────── */
.question-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.question-modal-card {
    background: var(--panel-bg);
    color: var(--text-light);
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: min(480px, 100%);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.question-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}
.question-modal-textarea {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0.5rem;
    color: var(--text-light);
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    font-family: inherit;
}
.question-modal-textarea:focus {
    border-color: var(--brand-primary);
    background: rgba(255,255,255,0.1);
}
.question-modal-textarea::placeholder { color: rgba(224,224,224,0.35); }
.question-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.question-submitted-msg {
    text-align: center;
    font-size: 1.3rem;
    color: var(--success-green);
    padding: 0.5rem 0;
}

/* ── Dashboard: audience questions panel ───────────────────────── */
.questions-panel {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.question-entries {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 400px;
    overflow-y: auto;
}
.question-entry {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-left: 3px solid var(--brand-primary);
}
.question-entry-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}
.question-entry-nickname {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--brand-primary);
}
.question-entry-time {
    font-size: 0.75rem;
    color: #999;
}
.question-entry-text {
    font-size: 0.95rem;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Questions toggle button on /present (next to ☺) ───────────── */
.questions-toggle-btn {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    border: none;
    background: var(--success-green);
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.questions-toggle-btn:hover { opacity: 1; }
.questions-toggle-btn.active { opacity: 1; }

/* ── Questions HUD overlay on /present ─────────────────────────── */
.presentation-questions-hud {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 200;
    width: 300px;
    max-height: 60vh;
    pointer-events: none;
}

/* ── QuestionsOverlay component (dark canvas theme) ────────────── */
.questions-overlay {
    background: rgba(15, 52, 96, 0.88);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light);
}
.questions-overlay-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 0.5rem;
}
.questions-overlay-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: calc(60vh - 3rem);
    overflow-y: auto;
}
.questions-overlay-entry {
    border-left: 3px solid var(--brand-primary);
    padding-left: 0.5rem;
}
.questions-overlay-nickname {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    display: block;
    margin-bottom: 0.1rem;
}
.questions-overlay-text {
    font-size: 0.85rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    opacity: 0.9;
}
