/* ==========================================================================
   PRIMEFLIX OTT - CINEMA PLAYER & STREAM TELEMETRY
   Amazon Prime X-Ray + Netflix Custom Control Bar + Worker Stream HUD
   ========================================================================== */

body.player-page {
  background-color: #03060b;
  overflow: hidden;
  height: 100vh;
}

.player-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  user-select: none;
}

/* Video Canvas / Simulator */
#player-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000000;
}

/* Player Ambient Glow */
.player-ambient-glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at center, rgba(0, 168, 225, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ---------------- Overlays & Control Shell ---------------- */
.player-controls-shell {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 48px;
  background: linear-gradient(180deg, rgba(3, 6, 11, 0.85) 0%, transparent 25%, transparent 75%, rgba(3, 6, 11, 0.95) 100%);
  transition: opacity 0.3s ease;
}

.player-controls-shell.inactive {
  opacity: 0;
  cursor: none;
  pointer-events: none;
}

/* Top Control Bar */
.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-title-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.player-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--border-radius-full);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-fast);
}

.player-back-btn:hover {
  background: var(--prime-blue);
  color: #070b12;
  border-color: var(--prime-blue);
}

.player-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Bottom Control Bar */
.player-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Scrubber / Progress Bar */
.scrubber-container {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.scrubber-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  transition: height 0.15s ease;
}

.scrubber-container:hover .scrubber-track {
  height: 8px;
}

.scrubber-buffer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 45%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

.scrubber-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 25%;
  background: var(--prime-blue);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--prime-blue);
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 168, 225, 0.8);
  transition: transform 0.15s ease;
}

.scrubber-container:hover .scrubber-thumb {
  transform: translateY(-50%) scale(1);
}

.scrubber-tooltip {
  position: absolute;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid var(--prime-blue);
  color: #ffffff;
  font-size: 0.76rem;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.scrubber-container:hover .scrubber-tooltip {
  opacity: 1;
}

/* Bottom Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ctrl-btn {
  color: #ffffff;
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--prime-blue-hover);
}

.ctrl-time-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

/* Volume Slider Group */
.volume-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--prime-blue);
}

/* ---------------- Prime Video X-Ray Overlay ---------------- */
.xray-panel {
  position: absolute;
  top: 90px;
  left: 48px;
  width: 360px;
  background: rgba(10, 14, 23, 0.92);
  border: 1px solid rgba(0, 168, 225, 0.3);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(14px);
  padding: 20px;
  z-index: 15;
  box-shadow: var(--shadow-modal);
  transform: translateX(-40px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
}

.xray-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.xray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.xray-badge {
  background-color: var(--prime-blue);
  color: #070b12;
  font-weight: 800;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
}

.xray-cast-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xray-cast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.xray-cast-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--prime-blue);
  border: 1px solid rgba(0, 168, 225, 0.4);
}

/* ---------------- Worker Stream Telemetry HUD ---------------- */
.worker-hud {
  position: absolute;
  top: 90px;
  right: 48px;
  width: 380px;
  background: rgba(10, 14, 23, 0.94);
  border: 1px solid var(--prime-blue);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(14px);
  padding: 20px;
  z-index: 15;
  box-shadow: 0 0 25px rgba(0, 168, 225, 0.25);
  font-family: monospace;
  font-size: 0.82rem;
  transform: translateX(40px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
}

.worker-hud.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.worker-hud-title {
  color: #38bdf8;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.worker-hud-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.worker-hud-label {
  color: #94a3b8;
}

.worker-hud-val {
  color: #f8fafc;
  font-weight: 600;
}

.worker-hud-val.hit {
  color: #4ade80;
}

.worker-hud-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* Big Pause Center Indicator */
.center-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.7);
  border: 2px solid var(--prime-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 12;
}

.center-play-indicator.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
