/* =========================================================
   cinema.css — styles for the CINEMA tab (both dashboards).
   Loaded AFTER styles.css and leans on its variables
   (--ink, --f-pixel …) and shell classes (.frame, .stage).
   Card/player classes mirror xbd.css so the look matches.
   ========================================================= */

/* ---------- theme: warm projector amber ---------- */

body.theme-cinema {
  --hue-1: #ffb13d;
  --hue-1-soft: #ffb13d66;
  --hue-1-faint: #ffb13d22;
  --hue-2: #e8dcd6;
}

/* lights off while a movie is playing */
body.cinema-dark {
  background: #050404;
}

body.cinema-dark .bg-grid,
body.cinema-dark .bg-glow {
  opacity: 0.06;
}

body.cinema-dark .scanlines,
body.cinema-dark .vignette {
  opacity: 0.25;
}

/* empty/error notes — defined in altdevsecure/styles.css but not in the
   root stylesheet, and the public page needs them too */
.gx-empty {
  font-family: var(--f-mono);
  font-size: 15px;
  color: var(--ink-mute);
  text-transform: none;
  letter-spacing: 0.02em;
}

.gx-empty code {
  font-family: var(--f-mono);
  color: var(--hue-2);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--hue-1-faint);
  padding: 1px 5px;
}

/* ---------- movie grid ---------- */

.vid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.cine-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.vid-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--hue-1-faint);
  background: rgba(0, 0, 0, 0.35);
  padding: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vid-card:hover {
  border-color: var(--hue-1);
  box-shadow: 0 0 16px var(--hue-1-faint);
}

.vid-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.vid-thumb img,
.vid-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* no poster yet: a quiet film glyph on black */
.cine-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  opacity: 0.5;
  filter: grayscale(0.6);
}

.vid-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--hue-1-soft);
  color: var(--hue-1);
  font-size: 13px;
  text-shadow: 0 0 8px var(--hue-1-soft);
}

.vid-card:hover .vid-play {
  background: var(--hue-1);
  color: #0a0506;
}

/* subtitles available */
.cine-cc {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--hue-1-soft);
  color: var(--hue-1);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1px;
}

.vid-name {
  margin-top: 8px;
  font-family: var(--f-pixel);
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.vid-card:hover .vid-name {
  color: var(--hue-1);
}

.vid-meta {
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

/* ---------- cinema mode: the dark player ---------- */

.cinema {
  position: relative;
  background: #000;
  border: 1px solid var(--hue-1-faint);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  margin-bottom: 18px;
}

.cinema video {
  display: block;
  width: 100%;
  max-height: 74vh;
  background: #000;
}

.cine-fallback {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--f-pixel);
  font-size: 13px;
  color: var(--ink-mute);
  border-top: 1px solid var(--hue-1-faint);
}

.cine-fallback a {
  color: var(--hue-1);
}

/* mkv/avi conversion in progress — shown where the video would be */
.cine-convert {
  min-height: min(48vh, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
}

.cc-glyph {
  font-size: 40px;
  opacity: 0.6;
  filter: grayscale(0.5);
}

.cc-title {
  font-family: var(--f-display);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--hue-1);
  text-shadow: 0 0 10px var(--hue-1-soft);
}

.cc-bar {
  width: min(420px, 80%);
  height: 10px;
  border: 1px solid var(--hue-1-soft);
  background: rgba(0, 0, 0, 0.6);
}

.cc-bar i {
  display: block;
  height: 100%;
  background: var(--hue-1);
  box-shadow: 0 0 12px var(--hue-1-soft);
  transition: width 0.6s ease;
}

.cc-pct {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-mute);
}

.cc-note {
  margin: 0;
  max-width: 560px;
  font-family: var(--f-pixel);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-mute);
}

.cc-note a {
  color: var(--hue-1);
}

.cine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px) {
  .cine-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cine-title {
  font-family: var(--f-display);
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--ink);
  margin: 0 0 10px;
  word-break: break-all;
}

.cine-meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.7;
}

.cine-meta a {
  color: var(--hue-1);
  text-decoration: none;
}

.cine-meta a:hover {
  text-decoration: underline;
}

.cine-autonext {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--f-pixel);
  font-size: 12px;
  color: var(--ink-mute);
  cursor: pointer;
  user-select: none;
}

.cine-autonext input {
  accent-color: var(--hue-1);
}

/* ---------- up-next side column ---------- */

.rec-frame {
  padding-bottom: 14px;
}

.rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(62vh, 600px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.rec-list a {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-decoration: none;
  border: 1px solid transparent;
  padding: 3px;
  transition: border-color 0.15s, background 0.15s;
}

.rec-list a:hover {
  border-color: var(--hue-1-soft);
  background: var(--hue-1-faint);
}

.rec-thumb {
  width: 96px;
  height: 60px;
  object-fit: cover;
  display: block;
  background: #000;
  border: 1px solid var(--hue-1-faint);
}

.rec-thumb-ph {
  width: 96px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid var(--hue-1-faint);
  color: var(--hue-1);
  font-size: 18px;
}

.rec-name {
  font-family: var(--f-pixel);
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.rec-list a:hover .rec-name {
  color: var(--hue-1);
}
