@font-face {
  font-family: "Netflix Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/inter-500.woff2") format("woff2");
}

@font-face {
  font-family: "Netflix Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/inter-600.woff2") format("woff2");
}

:root {
  --neon: #00ff9c;
  --cyan: #00e5ff;
  --amber: #ffb800;
  --danger: #ff4d6d;
  --bg: #030507;
  --panel: rgba(7, 11, 16, 0.9);
  --border: rgba(0, 255, 156, 0.28);
  --ink: #e8f5ef;
  --muted: #7f9c90;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

.embed-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.jw-host,
#jw-container:not(.jw-flag-fullscreen) {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

#jw-container.jw-flag-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

#jw-container .jw-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Terminal Overlay --------------------------------------------------------- */
.term-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 40%, rgba(0, 255, 156, 0.09), transparent 60%),
    rgba(3, 5, 7, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.term-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.term-box {
  width: min(500px, 100%);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 32px rgba(0, 255, 156, 0.12);
  overflow: hidden;
}

.term-overlay.error .term-box {
  border-color: rgba(255, 77, 109, 0.55);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 28px rgba(255, 77, 109, 0.15);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.r { background: #ff5f56; }
.dot.y { background: #ffbd2e; }
.dot.g { background: #27c93f; }

.term-bar-title {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}

.term-body {
  padding: 16px;
}

.term-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.term-line .prompt {
  color: var(--neon);
  font-weight: 700;
}

.term-overlay.error .term-line .prompt {
  color: var(--danger);
}

.term-sub {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.term-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.term-action-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--neon);
  background: rgba(0, 255, 156, 0.12);
  color: var(--neon);
  font: 600 12px/1 var(--mono);
  text-decoration: none;
  cursor: pointer;
}

.term-action-btn:hover {
  background: rgba(0, 255, 156, 0.22);
}

.term-action-btn.secondary {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

/* Toast -------------------------------------------------------------------- */
.term-toast {
  position: absolute;
  left: 50%;
  bottom: 66px;
  z-index: 50;
  transform: translate(-50%, 10px);
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.94);
  color: var(--neon);
  font-size: 12px;
  white-space: nowrap;
  max-width: calc(100vw - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.term-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Volume Slider Contrast (Unfilled Track White vs Active Accent) ----------- */
#jw-container .jw-slider-volume .jw-rail,
#jw-container .jw-slider-volume .jw-buffer {
  background-color: #ffffff !important;
}

#jw-container .jw-slider-volume .jw-progress,
#jw-container .jw-slider-volume .jw-knob {
  background-color: var(--neon) !important;
}

/* Poster Preview (Vertical Contain + Pure Black Sidebars) ---------------- */
#jw-container .jw-preview {
  background-color: #000000 !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Netflix Subtitle Preset (Auto-applied & Selectable in CC Settings) ------ */
#jw-container.jw-netflix-subs .jw-captions {
  top: 0 !important;
  left: var(--jw-vid-inset-x, clamp(14px, 7vw, 140px)) !important;
  right: var(--jw-vid-inset-x, clamp(14px, 7vw, 140px)) !important;
  bottom: var(--jw-vid-bottom, 14px) !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  transform: none !important;
  transition: none !important;
  font-size: calc(clamp(13.5px, var(--jw-vid-w, 100vw) * 0.01 + var(--jw-vid-h, min(100vh, 56.25vw)) * 0.0185 + 5.5px, 46px) * var(--jw-sub-scale, 1)) !important;
}

#jw-container.jw-netflix-subs.jw-flag-small-player .jw-captions {
  left: var(--jw-vid-inset-x, clamp(10px, 4.5vw, 24px)) !important;
  right: var(--jw-vid-inset-x, clamp(10px, 4.5vw, 24px)) !important;
  bottom: var(--jw-vid-bottom, 14px) !important;
}

@media (max-width: 520px), (max-height: 360px) {
  #jw-container.jw-netflix-subs .jw-captions {
    left: var(--jw-vid-inset-x, clamp(10px, 4.5vw, 24px)) !important;
    right: var(--jw-vid-inset-x, clamp(10px, 4.5vw, 24px)) !important;
    bottom: var(--jw-vid-bottom, 14px) !important;
  }

  .term-toast {
    bottom: 48px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

#jw-container.jw-netflix-subs .jw-video::cue {
  font-family: "Netflix Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: transparent !important;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.96),
    0 0 6px rgba(0, 0, 0, 0.92),
    0 0 12px rgba(0, 0, 0, 0.8),
    0 0 22px rgba(0, 0, 0, 0.62),
    0 2px 4px rgba(0, 0, 0, 0.88) !important;
}

#jw-container.jw-netflix-subs .jw-text-track-display {
  line-height: 1.18 !important;
  padding: 0 !important;
}

#jw-container.jw-netflix-subs .jw-text-track-cue {
  font-family: "Netflix Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.005em !important;
  line-height: 1.18 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.96),
    0 0 6px rgba(0, 0, 0, 0.92),
    0 0 12px rgba(0, 0, 0, 0.8),
    0 0 22px rgba(0, 0, 0, 0.62),
    0 2px 4px rgba(0, 0, 0, 0.88) !important;
}
