/* Video Player Styles */

.player-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Controls Overlay */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 60px 20px 20px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.player-page:hover .player-controls,
.player-page.controls-visible .player-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Top bar */
.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(rgba(0,0,0,0.8), transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.player-page:hover .player-top-bar,
.player-page.controls-visible .player-top-bar {
  opacity: 1;
  pointer-events: auto;
}

.player-back-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  padding: 4px 8px;
  cursor: pointer;
}

.player-title-bar {
  flex: 1;
  min-width: 0;
}

.player-title-text {
  font-size: 16px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-episode-text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.player-title-logo {
  max-height: 44px;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
}

/* Progress bar */
.player-progress-container {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}

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

.player-progress-container:hover .player-progress-track {
  height: 6px;
}

.player-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.player-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent, #7c5cfc);
  border-radius: 2px;
}

.player-progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--accent, #7c5cfc);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s;
}

.player-progress-container:hover .player-progress-thumb {
  opacity: 1;
}

/* Control buttons */
.player-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.player-btn:hover { opacity: 1; }

.player-time {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin: 0 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-spacer { flex: 1; }

/* Active button state (subtitles, cast) */
.player-btn.active { color: var(--accent, #7c5cfc); }

/* Volume slider */
.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
}

/* ===== SKIP MARKERS ===== */
.skip-marker {
  position: absolute;
  bottom: 100px;
  right: 24px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius, 8px);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
  z-index: 10;
  transition: background 0.2s;
}
.skip-marker:hover { background: rgba(255,255,255,0.25); }

/* ===== AUTOPLAY OVERLAY ===== */
.autoplay-overlay {
  position: absolute;
  bottom: 100px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius, 8px);
  z-index: 10;
  animation: fadeIn 0.3s ease;
}

.autoplay-text {
  color: white;
  font-size: 14px;
}

.autoplay-timer {
  color: var(--accent, #7c5cfc);
  font-weight: 700;
  font-size: 18px;
  min-width: 24px;
  text-align: center;
}

.autoplay-cancel {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.autoplay-cancel:hover { background: rgba(255,255,255,0.1); }

/* ===== SUBTITLE DISPLAY ===== */
.subtitle-display {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

.subtitle-text {
  display: inline;
  padding: 4px 10px;
  background: rgba(0,0,0,0.75);
  color: white;
  font-size: 18px;
  line-height: 1.5;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ===== SUBTITLE MENU ===== */
.subtitle-menu {
  position: absolute;
  bottom: 60px;
  right: 20px;
  background: rgba(20,20,40,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border, #2a2a50);
  border-radius: var(--radius, 8px);
  min-width: 220px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 20;
  animation: fadeIn 0.2s ease;
}

.subtitle-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-secondary, #9090b0);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.subtitle-menu-item:hover { background: rgba(255,255,255,0.05); }
.subtitle-menu-item.active { color: var(--accent, #7c5cfc); font-weight: 600; }

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 26, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  padding: 20px;
}

.slot-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
}

.slot-reel {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #e8e8f0);
  min-height: 30px;
  transition: transform 0.3s, opacity 0.3s;
}
.slot-reel:last-child {
  font-size: 16px;
  color: var(--accent, #7c5cfc);
  font-weight: 400;
}
.slot-reel.spinning {
  transform: translateY(-10px);
  opacity: 0;
}

.loading-status {
  font-size: 14px;
  color: var(--text-secondary, #9090b0);
  margin-bottom: 16px;
}

.loading-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--accent, #7c5cfc);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ===== LIVE TV INLINE PLAYER ===== */
.livetv-inline-player {
  display: none;
  width: 100%;
  background: #000;
  border-radius: var(--radius, 8px);
  overflow: hidden;
  margin-bottom: 16px;
}
.livetv-inline-player.active { display: block; }

.livetv-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 55vh;
  background: #000;
}

.livetv-player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.livetv-player-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(rgba(0,0,0,0.8), transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.livetv-player-wrapper:hover .livetv-player-top,
.livetv-player-wrapper.controls-visible .livetv-player-top {
  opacity: 1;
  pointer-events: auto;
}

.livetv-player-info { flex: 1; min-width: 0; }

.livetv-player-channel {
  font-size: 15px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.livetv-player-program {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.livetv-player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 40px 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.livetv-player-wrapper:hover .livetv-player-controls,
.livetv-player-wrapper.controls-visible .livetv-player-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Fullscreen overrides — fill screen when in fullscreen mode */
.livetv-inline-player:fullscreen,
.livetv-inline-player:-webkit-full-screen {
  border-radius: 0;
  margin: 0;
}
.livetv-inline-player:fullscreen .livetv-player-wrapper,
.livetv-inline-player:-webkit-full-screen .livetv-player-wrapper {
  max-height: 100vh;
  height: 100vh;
}

/* ===== PLAYER SETTINGS MENU ===== */
.player-settings-menu {
  position: absolute;
  bottom: 60px;
  right: 20px;
  background: rgba(20,20,40,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border, #2a2a50);
  border-radius: var(--radius, 8px);
  min-width: 260px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 20;
  animation: fadeIn 0.2s ease;
  padding: 8px 0;
}

.settings-menu-header {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-secondary, #9090b0);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-menu-item:hover { background: rgba(255,255,255,0.05); }
.settings-menu-item.active { color: var(--accent, #7c5cfc); font-weight: 600; }

.settings-menu-value {
  font-size: 12px;
  color: var(--accent, #7c5cfc);
}

.settings-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .subtitle-text { font-size: 14px; }
  .subtitle-display { bottom: 60px; max-width: 90%; }
  .skip-marker { bottom: 80px; right: 12px; font-size: 13px; padding: 8px 16px; }
  .autoplay-overlay { bottom: 80px; right: 12px; }
  .player-controls { padding: 40px 12px 12px; }
  .player-top-bar { padding: 12px; }
  .livetv-player-controls { padding: 30px 8px 8px; }
  .livetv-player-top { padding: 8px 12px; }
  .player-title-logo { max-height: 32px; max-width: 160px; }
  .volume-slider { display: none; }
}
