/* ---------------------------------------------------------------
   CTV self-hosted live-stream player
   Drop-in replacement for the DaCast embed.
   Everything is scoped under .ctv-player so it can't leak into
   or be clobbered by the rest of the site's styles.
   ------------------------------------------------------------- */

:root {
    --bg-0: #0a0e16;
    --bg-1: #10161f;
    --panel: #131a24;
    --border: #232c3a;
    --text: #eef2f7;
    --text-dim: #8b96a8;
    --accent: #22d3ee;
    --accent-dim: #0e7490;
    --live: #ff3b4e;
    --offline: #5b6472;
}

.ctv-player {
  max-width: 540px;   /* matches the width DaCast's embed used to occupy */
  width: 100%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.ctv-player * {
  box-sizing: border-box;
}

.ctv-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;   /* ~540x303, same shape as the old embed */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.ctv-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* Loading / buffering / offline overlay */
.ctv-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(10, 14, 22, 0.72);
  backdrop-filter: blur(4px);
  transition: opacity 0.35s ease;
  text-align: center;
  padding: 16px;
  color: var(--ctv-text);
  z-index: 3;
}

.ctv-overlay.ctv-hidden {
  opacity: 0;
  pointer-events: none;
}

.ctv-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(34, 211, 238, 0.18);
  border-top-color: var(--ctv-accent);
  animation: ctv-spin 0.9s linear infinite;
}

@keyframes ctv-spin {
  to { transform: rotate(360deg); }
}

.ctv-overlay-text {
  color: var(--ctv-text-dim);
  font-size: 13px;
  line-height: 1.4;
}

/* Playback controls bar */
.ctv-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
  z-index: 2;
}

.ctv-controls { transition: opacity 0.35s ease; }
.ctv-video-wrap.idle .ctv-controls { opacity: 0; pointer-events: none; }
.ctv-video-wrap.idle { cursor: none; }
.ctrl-spacer { flex: 1; }
.ctrl-btn {
    min-width: 56px;
    height: 56px;
    padding: 0 14px;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.6);
    background: rgba(10,14,22,0.85);
    color: #fff;
    font: 700 16px/1 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ctrl-btn svg { width: 28px; height: 28px; fill: currentColor; flex-shrink: 0; }
.ctrl-btn:hover, .ctrl-btn:focus-visible { background: #fff; color: #0a0e16; transform: translateY(-1px); outline: none; }
.ctrl-btn.attention {
    background: var(--accent);
    border-color: var(--accent);
    color: #04222a;
    animation: nudge 2s ease-in-out infinite;
}
.ctrl-btn.attention:hover { background: #fff; border-color: #fff; }
@keyframes nudge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0.55); }
    50%      { box-shadow: 0 0 0 10px rgba(34,211,238,0); }
}
@media (max-width: 600px) {
    .ctv-controls { gap: 8px; padding: 28px 10px 10px; }
    .ctrl-btn { min-width: 48px; height: 48px; padding: 0 11px; font-size: 14px; }
    .ctrl-btn svg { width: 24px; height: 24px; }
}

section#divMediaDetail {
    padding: 5px 20px;
    box-sizing: border-box;
}
