/* Occasion recorder overlay (occasion-recorder.js builds the DOM at
   runtime; this file only styles it). A camera surface is dark by nature,
   so the overlay stays dark on the light occasions pages — everything is
   scoped under .ocr-overlay so nothing leaks into the page theme. Coral
   reads from the page's --occ-coral with the brand literal as fallback. */

.ocr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500; /* over the builder, under nothing that matters here */
    display: none;
    background: #000000;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ocr-overlay.open { display: block; }

/* The beam.css lesson, applied up front: an author display beats the UA
   [hidden] rule, and this component drives ALL visibility via hidden. */
.ocr-overlay [hidden] { display: none !important; }

.ocr-stage {
    position: absolute;
    inset: 0;
}

.ocr-view,
.ocr-playback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
}
/* Front camera self-view mirrors like every camera app; the recording and
   the preview playback stay unmirrored (what the recipient gets). */
.ocr-view { transform: scaleX(-1); }

/* ── Top band: close, prompt, timer ─────────────────────── */
.ocr-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 24px;
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    pointer-events: none; /* the gradient must not eat stage taps */
}
.ocr-top > * { pointer-events: auto; }

.ocr-close {
    position: absolute;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #FFFFFF;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

/* The teleprompter line: high on the screen so the sender's eyes stay near
   the front camera. A button (tap cycles), styled as a caption. */
.ocr-prompt {
    max-width: min(520px, calc(100% - 112px)); /* clear of the close button */
    margin: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.25s ease;
}
.ocr-prompt.dimmed { opacity: 0.45; }

.ocr-prompt-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.ocr-timer {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.ocr-timer.warn {
    background: var(--occ-coral, #FF6B6B);
    color: #FFFFFF;
    font-weight: 600;
}

/* ── Bottom band: record button / preview actions ───────── */
.ocr-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    padding: 24px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
}

.ocr-record-btn {
    width: 72px;
    height: 72px;
    border: 4px solid #FFFFFF;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.ocr-record-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--occ-coral, #FF6B6B);
    transition: all 0.2s ease;
}
.ocr-record-btn.recording .ocr-record-inner {
    width: 28px;
    height: 28px;
    border-radius: 6px; /* the square = stop, camera-app convention */
}

.ocr-preview-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 420px;
}
.ocr-preview-actions .ocr-btn { flex: 1.4; }
.ocr-preview-actions .ocr-btn-quiet { flex: 1; }

/* ── Buttons (dark-surface variants, standalone on purpose) ─ */
.ocr-btn {
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    background: var(--occ-coral, #FF6B6B);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.ocr-btn-quiet {
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    background: transparent;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Permission / failure message ───────────────────────── */
.ocr-message {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    background: #000000;
    text-align: center;
}
.ocr-message-text {
    margin: 0;
    max-width: 340px;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}
.ocr-message-actions {
    display: flex;
    gap: 12px;
}
