/* ==========================================================================
   WINK TV REPLAY — PLAYER STYLES & CONTROLS
   Studio Grade Video Player / Catchup Timeline / Commercial Skip
   ========================================================================== */

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

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

/* Player Overlays */
.player-overlay {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.player-overlay.interactive {
  pointer-events: auto;
}

/* Top Bar Overlay */
.player-top-bar {
  top: 0;
  padding: 18px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-channel-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-channel-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  object-fit: contain;
}

.player-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-channel-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-channel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.player-program-title {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Stream Mode Badge (Live vs Catch-up) */
.stream-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.stream-status-badge.live {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.stream-status-badge.live .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live-color);
  box-shadow: 0 0 8px var(--live-color);
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.stream-status-badge.catchup {
  background: rgba(139, 92, 246, 0.25);
  color: #ddd6fe;
  border: 1px solid rgba(139, 92, 246, 0.5);
}

/* Feed Switcher Dropdown (Timezone selector inside player) */
.feed-switcher-wrap {
  position: relative;
  pointer-events: auto;
}

.feed-switcher-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.feed-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-primary);
}

.feed-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  display: none;
  z-index: 200;
}

.feed-dropdown.active {
  display: block;
}

.feed-option {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.feed-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.feed-option.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Center Big Play/Pause Button on Hover / Loading Spinner */
.player-center-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

.loading-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* Bottom Controls Overlay */
.player-bottom-bar {
  bottom: 0;
  padding: 24px 24px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Timeline & Scrubber */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.timeline-track-wrap {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.timeline-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
  transition: height 0.15s ease;
}

.timeline-track-wrap:hover .timeline-track {
  height: 8px;
}

.timeline-buffer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  width: 0%;
}

.timeline-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  width: 0%;
}

.timeline-progress.catchup {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
  pointer-events: none;
}

.timeline-track-wrap:hover .timeline-thumb {
  opacity: 1;
}

.timeline-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Control Buttons Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

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

.ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  opacity: 0.85;
}

.ctrl-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  color: var(--accent-primary);
}

.ctrl-btn.btn-play {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  font-size: 1.25rem;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ctrl-btn.btn-play:hover {
  transform: scale(1.1);
  background: var(--accent-primary);
  color: #fff;
}



/* Return to Live Button */
.jump-live-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.jump-live-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
}

/* Кнопка «Смотреть с начала» в прямом эфире */
.restart-prog-btn {
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(139, 92, 246, 0.55);
  color: #c4b5fd;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
  white-space: nowrap;
}

.restart-prog-btn:hover {
  background: rgba(139, 92, 246, 0.45);
  border-color: #a78bfa;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45);
}

/* Volume Slider */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}



/* Autohide controls when cursor idle */
.video-wrapper.idle .player-overlay {
  opacity: 0;
  transform: translateY(0);
}

.video-wrapper.idle {
  cursor: none;
}

/* ==================== СТИЛИ ПЕРЕМОТКИ ПЕРЕДАЧИ И ТАЙМЛАЙНА ==================== */

/* Кнопки быстрой перемотки ⏪ -10с и ⏩ +30с */
.seek-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  height: 36px;
  padding: 0 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.seek-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.seek-btn:active {
  transform: scale(0.96);
}

.seek-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.seek-text {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* В режиме прямого эфира кнопки слегка приглушены или переходят в режим Timeshift */
.video-wrapper.is-live .seek-btn {
  opacity: 0.65;
}
.video-wrapper.is-catchup .seek-btn {
  opacity: 1;
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.4);
}

/* Тултип таймлайна при наведении курсора */
.timeline-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 50;
  font-variant-numeric: tabular-nums;
}

.timeline-track-wrap:hover .timeline-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

/* Центральный всплывающий OSD бейдж перемотки (ripple feedback) */
.seek-osd-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(99, 102, 241, 0.4);
  backdrop-filter: blur(16px);
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
}

.seek-osd-badge.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.seek-osd-icon {
  font-size: 2rem;
  line-height: 1;
}

.seek-osd-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #a5b4fc;
}

.seek-osd-time {
  font-size: 0.84rem;
  color: #cbd5e1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Индикатор загрузки / буферизации */
.player-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 25;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.spinner-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Плашка включения звука для смартфонов */
.player-unmute-prompt {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 8px 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 30;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  animation: pulseUnmute 2s infinite ease-in-out;
}

.player-unmute-prompt:hover {
  background: rgba(30, 58, 138, 0.9);
  transform: translateX(-50%) scale(1.04);
}

@keyframes pulseUnmute {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.6); }
}

/* Большая центральная кнопка Play */
.player-big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
}

.player-big-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(59, 130, 246, 0.85);
  border-color: #60a5fa;
}

.player-big-play-btn .big-play-icon {
  font-size: 2rem;
  margin-left: 4px;
}

