/*
 * Pulse::Studio Video, public pages. The dark Studio look of the Flask app.
 * Copyright (c) 2026 Rocket Science Computing Corporation Ltd. All rights reserved.
 */
:root {
	--bg: #0f0f0f; --panel: #1a1a1a; --panel-2: #252525; --line: #303030;
	--text: #e0e0e0; --muted: #8a8a8a; --white: #fff; --accent: #4a9eff; --accent-2: #3a8eef;
	--good: #22c55e; --warn: #fbbf24; --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; padding: 20px; line-height: 1.5; }
html.is-embed body { padding: 0; min-height: 0; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.psv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.psv-muted { color: var(--muted); }
.psv-link { background: none; border: 0; color: var(--accent); cursor: pointer; }

.psv-top { max-width: 1400px; margin: 0 auto 18px; }
.psv-logo { max-height: 48px; width: auto; display: block; }
.psv-wrap { max-width: 1400px; margin: 0 auto; }
.psv-head { margin-bottom: 18px; }
.psv-head h1 { font-size: 24px; color: var(--white); margin-bottom: 8px; }
.psv-head p { color: var(--muted); font-size: 15px; max-width: 80ch; }

.psv-main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
html.is-embed .psv-main { grid-template-columns: minmax(0, 1fr) 340px; gap: 0; background: var(--panel); border-radius: var(--radius); overflow: hidden; align-items: stretch; }
@media (max-width: 1000px) { .psv-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { html.is-embed .psv-main { grid-template-columns: 1fr; } }

.psv-player { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
html.is-embed .psv-player { border-radius: 0; }
.psv-stage { position: relative; background: #000; aspect-ratio: 16 / 9; }
.psv-stage video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.psv-stage video.is-hidden { display: none; }
.psv-stage video::cue { background: rgba(0, 0, 0, .78); color: #fff; font-size: 1.05em; }
.psv-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(0, 0, 0, .45); border: 0; color: #fff; cursor: pointer; }
.psv-overlay[hidden] { display: none; }
.psv-play { display: block; width: 72px; height: 72px; border-radius: 50%; background: rgba(74, 158, 255, .92); position: relative; }
.psv-play::after { content: ""; position: absolute; left: 29px; top: 22px; border-left: 22px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.psv-overlay-label { font-size: 15px; font-weight: 600; }
.psv-cc { position: absolute; right: 12px; top: 12px; padding: 4px 9px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .05em; cursor: pointer; }
.psv-cc[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.psv-embed-title { padding: 10px 14px; font-weight: 600; }
.psv-embed-title a { color: var(--white); text-decoration: none; }
.psv-embed-title a:hover { text-decoration: underline; }

.psv-side { display: grid; gap: 16px; min-width: 0; }
/* Wide embeds: the sidebar takes the player's height and scrolls, so the embed's height is set by the video. */
html.is-embed .psv-side { gap: 0; contain: size; overflow-y: auto; border-left: 1px solid var(--line); }
@media (max-width: 760px) { html.is-embed .psv-side { contain: none; overflow: visible; border-left: 0; } }
.psv-search, .psv-results, .psv-moments, .psv-transcript { background: var(--panel); border-radius: var(--radius); padding: 16px; }
html.is-embed .psv-search, html.is-embed .psv-results, html.is-embed .psv-moments, html.is-embed .psv-transcript { border-radius: 0; border-bottom: 1px solid var(--line); }
.psv-search { display: flex; gap: 8px; }
.psv-search input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; }
.psv-search input:focus { outline: none; border-color: var(--accent); }
.psv-search button { padding: 10px 16px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.psv-search button:disabled { opacity: .6; cursor: wait; }
.psv-results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.psv-results-head h3 { font-size: 15px; color: var(--white); }
.psv-match { display: grid; gap: 4px; width: 100%; text-align: left; padding: 10px 12px; margin-top: 8px; border: 0; border-left: 3px solid var(--muted); border-radius: 8px; background: var(--panel-2); color: var(--text); cursor: pointer; }
.psv-match:hover { background: #2d2d2d; }
.psv-match.is-high { border-left-color: var(--good); }
.psv-match.is-medium { border-left-color: var(--warn); }
.psv-match-head { display: flex; gap: 10px; align-items: center; }
.psv-rel { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.psv-match-title { font-weight: 600; color: var(--white); }
.psv-match-ctx { font-size: 13px; color: var(--muted); font-style: italic; }
.psv-left { margin-top: 10px; font-size: 12px; color: var(--muted); }
.psv-signin { display: block; color: var(--muted); font-size: 14px; }

.psv-moments h2 { font-size: 16px; color: var(--white); margin-bottom: 10px; }
.psv-moment-list { list-style: none; display: grid; gap: 6px; }
.psv-moment { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-left: 3px solid transparent; border-radius: 8px; background: var(--panel-2); color: var(--text); cursor: pointer; }
.psv-moment:hover { background: #2d2d2d; }
.psv-moment.is-active { border-left-color: var(--accent); background: #1f2a38; }
.psv-time { grid-row: span 2; font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--accent); }
.psv-moment-title { font-weight: 600; color: var(--white); }
.psv-moment-desc { grid-column: 2; font-size: 13px; color: var(--muted); }

.psv-transcript summary { cursor: pointer; font-weight: 600; color: var(--white); }
.psv-transcript-body { margin-top: 10px; max-height: 360px; overflow-y: auto; font-size: 14px; scroll-behavior: smooth; }
.psv-transcript-body p { margin: 0 0 6px; }
.psv-tline { border: 0; background: none; color: var(--accent); font-family: ui-monospace, Menlo, monospace; font-size: 12px; cursor: pointer; padding: 0 4px 0 0; }
.psv-tline.is-current { color: #fff; background: var(--accent); border-radius: 4px; padding: 0 4px; }

.psv-stats-note { margin: 22px 0 0; font-size: 12px; color: var(--muted); }
.psv-stats-note summary { cursor: pointer; }
.psv-stats-note p { margin-top: 6px; max-width: 80ch; }
html.is-embed .psv-stats-note { margin: 0; padding: 8px 14px; }

.psv-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.psv-card { display: block; height: 100%; background: var(--panel); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s ease; }
.psv-card:hover { transform: translateY(-2px); }
.psv-card-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1f2a38, #0f0f0f) center / cover no-repeat; }
.psv-stage video[poster] { object-fit: contain; }
.psv-card-num { position: absolute; left: 12px; top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.psv-card-dur { position: absolute; right: 10px; bottom: 8px; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #fff; }
.psv-card-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.psv-card-title { font-weight: 600; color: var(--white); }
.psv-card-desc { font-size: 14px; color: var(--muted); }
.psv-card-meta { font-size: 12px; color: var(--accent); }
.psv-empty, .psv-message { text-align: center; padding: 60px 20px; }
.psv-message h1 { color: var(--white); font-size: 22px; margin-bottom: 8px; }
.psv-message p { color: var(--muted); }
.psv-spinner { width: 28px; height: 28px; margin: 10px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: psv-spin .8s linear infinite; }
@keyframes psv-spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { body { padding: 12px; } .psv-head h1 { font-size: 20px; } }
