/* ═══════════════════════════════════════════════════════════════
   Presentations — Fullscreen Presenter + Overview Slide
   Uses base.css CSS variables (--bg-darkest, --surface, etc.)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&display=swap');
@import url('base.css');

/* ── Presenter ─────────────────────────────────────────────────── */

.pres-present-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg-darkest);
    font-family: 'Source Sans 3', system-ui, sans-serif;
    height: 100vh;
}

.pres-slide-frame {
    width: 100vw;
    height: 100vh;
    border: none;
    display: block;
    background: var(--bg-darkest);
}

/* Laser overlay — full-viewport mousemove capture, only active during laser mode */
.pres-laser-overlay {
    position: fixed;
    inset: 0;
    z-index: 499;
    pointer-events: none;
}

/* Drawing canvas — sits over the iframe, transparent by default */
.pres-annotation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 500;
}

/* Laser dot */
.pres-laser-dot {
    position: fixed;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 40, 40, 0.92);
    box-shadow: 0 0 8px 3px rgba(255, 40, 40, 0.5), 0 0 22px 8px rgba(255, 40, 40, 0.2);
    pointer-events: none;
    z-index: 600;
    display: none;
    transform: translate(-50%, -50%);
}

/* Floating controls — bottom-left hover cluster */
.pres-floating-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 1000;
    opacity: 0;
    pointer-events: all;
    transition: opacity 0.25s;
    border-radius: 10px;
    padding: 4px;
}

.pres-floating-controls:hover {
    opacity: 1;
}

/* Hide OS cursor when laser pointer is active */
.pres-laser-cursor-hidden,
.pres-laser-cursor-hidden * {
    cursor: none !important;
}

/* Icon color themes — toggled by background detection */
.pres-floating-controls.icon-light .pres-float-btn { color: #ffffff; }
.pres-floating-controls.icon-light .pres-float-counter { color: rgba(255,255,255,0.72); }
.pres-floating-controls.icon-light .pres-float-sep { background: rgba(255,255,255,0.22); }

.pres-floating-controls.icon-dark .pres-float-btn { color: #1e293b; }
.pres-floating-controls.icon-dark .pres-float-counter { color: rgba(30,41,59,0.65); }
.pres-floating-controls.icon-dark .pres-float-sep { background: rgba(30,41,59,0.22); }

.pres-float-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    flex-shrink: 0;
}
.pres-float-btn svg { width: 18px; height: 18px; }

.pres-floating-controls.icon-light .pres-float-btn { background: rgba(255,255,255,0.12); }
.pres-floating-controls.icon-light .pres-float-btn:hover { background: rgba(255,255,255,0.24); }
.pres-floating-controls.icon-dark .pres-float-btn { background: rgba(0,0,0,0.08); }
.pres-floating-controls.icon-dark .pres-float-btn:hover { background: rgba(0,0,0,0.18); }

.pres-float-btn:disabled {
    opacity: 0.28;
    cursor: default;
    pointer-events: none;
}

/* Active tool state (laser / pen) */
.pres-float-btn.active {
    background: rgba(255,55,55,0.18) !important;
    color: #ff4444 !important;
}
.pres-float-btn.active:hover { background: rgba(255,55,55,0.28) !important; }

/* Exit — subtle danger tint on hover */
.pres-floating-controls.icon-light .pres-float-exit:hover { background: rgba(255,55,55,0.18); color: #ff6666; }
.pres-floating-controls.icon-dark .pres-float-exit:hover { background: rgba(180,0,0,0.10); color: #cc2222; }

.pres-float-counter {
    font-size: 12px;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
    letter-spacing: 0.3px;
    user-select: none;
}

.pres-float-sep {
    width: 1px;
    height: 20px;
    margin: 0 5px;
    flex-shrink: 0;
}

/* Slide select modal */
.pres-slide-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.62);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pres-slide-modal-box {
    background: #1a1d2e;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    width: 420px;
    max-height: 68vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}

.pres-slide-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.pres-slide-modal-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
    padding: 0;
}
.pres-slide-modal-close-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.pres-slide-modal-close-btn svg { width: 16px; height: 16px; }

.pres-slide-modal-list {
    overflow-y: auto;
    padding: 8px;
}

.pres-slide-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    color: rgba(255,255,255,0.72);
    font-size: 14px;
}
.pres-slide-modal-item:hover { background: rgba(255,255,255,0.08); }
.pres-slide-modal-item.current { background: rgba(98,216,78,0.12); color: var(--green); }

.pres-slide-modal-num {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    color: rgba(255,255,255,0.55);
}
.pres-slide-modal-item.current .pres-slide-modal-num {
    background: rgba(98,216,78,0.18);
    color: var(--green);
}


/* ── Overview Slide ────────────────────────────────────────────── */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.overview-slide {
    height: 100vh;
    background: var(--bg-panel);
    color: var(--text-body);
    font-family: 'Source Sans 3', system-ui, sans-serif;
    padding: 32px 48px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(12px, 3vh, 40px);
    overflow: hidden;
}

.overview-header-centered {
    text-align: center;
    flex-shrink: 0;
}

.overview-account-name {
    font-size: 64px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
    line-height: 1.1;
}

.overview-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    flex-shrink: 0;
}

.overview-kpi {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 20px;
}

.overview-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}

.overview-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.overview-section {
    flex-shrink: 0;
}

.overview-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Products — 2-column grid */
.overview-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.overview-product-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}

.overview-product-name {
    font-size: 17px;
    color: #fff;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-product-qty {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* Support — squares spanning full width */
.overview-support-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.overview-support-square {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
}

.overview-support-sq-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.overview-support-sq-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
}

.overview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    background: var(--bg-panel);
}


/* ── Presentation Builder (viewport) ───────────────────────────── */

.pres-builder {
    display: flex;
    height: 100%;
    gap: 0;
}

.pres-sources {
    width: 320px;
    min-width: 320px;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.pres-sources-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 12px;
}

.pres-category {
    margin-bottom: 4px;
}

.pres-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}
.pres-category-header:hover { background: #e2e8f0; }

.pres-caret {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.pres-caret.expanded { transform: rotate(90deg); }

.pres-category-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.pres-category-items {
    padding-left: 22px;
    overflow: hidden;
}

.pres-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: background 0.12s;
}
.pres-item:hover { background: #e2e8f0; }
.pres-item input[type="checkbox"] { accent-color: var(--purple); }
.pres-item.pres-item-checked { color: #1e293b; font-weight: 500; }
.pres-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-item-edit {
    font-size: 11px;
    color: var(--purple);
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    background: #fff;
    flex-shrink: 0;
}
.pres-item-edit:hover { background: #eef2ff; }

.pres-item-imported .pres-item-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
}
.pres-item-imported .pres-item-name:hover { border-color: #cbd5e1; background: #fff; }
.pres-item-imported .pres-item-name:focus {
    outline: none;
    border-color: var(--purple);
    background: #fff;
}

.pres-item-scope {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}
.pres-item-scope-master { background: #e0e7ff; color: #4338ca; }
.pres-item-scope-account { background: #dcfce7; color: #166534; }
.pres-item-scope-presentation { background: #fef3c7; color: #92400e; }

.pres-item-delete {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #b91c1c;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pres-item-delete:hover { background: #fee2e2; }

/* Slide list (middle panel — fixed width) */
.pres-slide-list-panel {
    overflow-y: auto;
    padding: 20px 24px;
    background: #fff;
}

.pres-slide-list-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 12px;
}

.pres-slide-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}
.pres-slide-list-header .pres-slide-list-title {
    margin-bottom: 0;
}


.pres-slide-list-empty {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

.pres-slide-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: grab;
    transition: box-shadow 0.12s, border-color 0.12s;
}
.pres-slide-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.pres-slide-card.dragging { opacity: 0.5; }
.pres-slide-card.drag-over { border-color: var(--purple); background: #f0f0ff; }

.pres-slide-drag {
    color: #94a3b8;
    cursor: grab;
    flex-shrink: 0;
}

.pres-slide-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--purple);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pres-slide-label-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.pres-slide-category-tag {
    font-size: 11px;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.pres-slide-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.12s, background 0.12s;
}
.pres-slide-remove:hover { color: #ef4444; background: #fef2f2; }

/* Present button in builder toolbar */
.pres-present-toolbar-btn {
    background: var(--purple);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.pres-present-toolbar-btn:hover { background: #4345a8; }
.pres-present-toolbar-btn:disabled { opacity: 0.4; cursor: default; }
