/* ══════════════════════════════════════════
   PURCHTV — VIDEO PLAYER STYLES
══════════════════════════════════════════ */

#player-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.96);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
#player-overlay.active { display: flex; }

#player-wrap {
  position: relative;
  width: 92%;
  max-width: 1200px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.8);
}

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

/* — Buffering — */
#player-buf {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
  z-index: 20;
}
#player-buf.show { display: flex; }
.p-spinner {
  width: 48px; height: 48px;
  border: 3px solid #222;
  border-top: 3px solid var(--accent, #f0a500);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.buf-label {
  color: #fff; margin-top: 14px;
  font-size: 12px;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 3px; opacity: .8;
}

/* — Error state — */
#player-error {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 20; text-align: center;
}
#player-error.show { display: flex; }
.error-icon { font-size: 44px; margin-bottom: 12px; }
.error-title {
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 20px;
  margin-bottom: 8px;
}
.error-sub { color: #888; font-size: 13px; line-height: 1.6; max-width: 300px; }
.error-retry {
  margin-top: 20px;
  background: var(--accent, #f0a500);
  border: none; color: #000;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 15px;
  letter-spacing: 1px;
}

/* — Top bar — */
#player-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.88) 0%, transparent 100%);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 15;
  transition: opacity .3s;
}
.p-info { display: flex; align-items: center; gap: 12px; }
.p-logo { font-size: 28px; }
.p-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 19px;
  letter-spacing: .5px; color: #fff;
}
.p-epg { font-size: 12px; color: rgba(255,255,255,.6); font-style: italic; margin-top: 2px; }
.p-top-right { display: flex; align-items: center; gap: 10px; }
.p-live-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--red, #c0392b);
  padding: 4px 10px;
  border-radius: 5px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; font-size: 12px;
  letter-spacing: 2px; color: #fff;
}
.p-clock { color: rgba(255,255,255,.6); font-family: 'Barlow Condensed', sans-serif; font-size: 14px; }
.p-pip-btn, .p-close-btn {
  background: rgba(255,255,255,.1);
  border: none; color: #fff;
  width: 32px; height: 32px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background .2s;
}
.p-pip-btn:hover, .p-close-btn:hover { background: rgba(255,255,255,.22); }

/* — Center play — */
#center-play-btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px; height: 80px;
  background: rgba(240,165,0,.9);
  border: none; border-radius: 50%;
  color: #000; font-size: 30px;
  display: none;
  align-items: center; justify-content: center;
  z-index: 15;
  transition: transform .2s, background .2s;
}
#center-play-btn:hover { background: #f0a500; transform: translate(-50%,-50%) scale(1.08); }

/* — Controls — */
#player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.92) 0%, transparent 100%);
  z-index: 15;
  transition: opacity .3s;
}

/* Progress bar */
#p-progress-wrap {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.p-prog-time {
  color: rgba(255,255,255,.7);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; letter-spacing: .5px;
  white-space: nowrap; min-width: 36px;
}
.p-progress-bar {
  flex: 1; height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height .2s;
}
.p-progress-bar:hover { height: 6px; }
.p-progress-buffered {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,.2);
  border-radius: 3px;
  pointer-events: none;
  width: 0%;
}
.p-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent, #f0a500);
  border-radius: 3px;
  pointer-events: none;
  width: 0%;
}
.p-progress-thumb {
  position: absolute; right: -5px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  background: var(--accent, #f0a500);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(240,165,0,.6);
  opacity: 0;
  transition: opacity .2s;
}
.p-progress-bar:hover .p-progress-thumb { opacity: 1; }

/* Live bar */
.p-live-bar {
  height: 3px;
  background: rgba(192,57,43,.2);
  border-radius: 3px;
  margin-bottom: 8px;
  display: none;
  overflow: hidden;
  position: relative;
}
.p-live-bar.show { display: block; }
.p-live-fill {
  height: 100%;
  background: var(--red, #c0392b);
  border-radius: 3px;
  width: 40%;
  animation: liveScroll 3s linear infinite;
  position: absolute;
}
.p-live-text {
  display: none;
}

/* Controls row */
.p-ctrl-row {
  display: flex; align-items: center;
  justify-content: space-between;
}
.p-ctrl-left, .p-ctrl-right {
  display: flex; align-items: center; gap: 4px;
}

.ctrl-btn {
  background: none; border: none;
  color: rgba(255,255,255,.75);
  padding: 6px 8px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 4px;
  transition: color .2s, background .2s;
  font-size: 13px;
  position: relative;
}
.ctrl-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.ctrl-label-btn { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; gap: 4px; }
.skip-btn { position: relative; }
.p-time-disp { color: rgba(255,255,255,.6); font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: .5px; padding: 0 4px; }

/* Volume */
.vol-group { display: flex; align-items: center; gap: 4px; }
.vol-slider {
  -webkit-appearance: none;
  width: 80px; height: 3px;
  background: rgba(255,255,255,.25);
  border-radius: 2px; outline: none; cursor: pointer;
  transition: width .2s;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
}

/* Popup menus */
.ctrl-popup-wrap { position: relative; }
.ctrl-popup {
  position: absolute; bottom: calc(100% + 10px); right: 0;
  background: #1a1a22;
  border: 1px solid #2a2a35;
  border-radius: 10px;
  padding: 6px;
  min-width: 130px;
  z-index: 30;
  display: none;
  animation: fadeIn .15s ease;
}
.ctrl-popup.open { display: block; }
.popup-title {
  color: #666; font-size: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 10px 8px;
  border-bottom: 1px solid #222;
  margin-bottom: 4px;
}
.popup-item {
  display: block; width: 100%;
  background: none; border: none;
  color: rgba(255,255,255,.75);
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  border-radius: 6px;
  transition: background .15s;
}
.popup-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.popup-item.active { color: var(--accent, #f0a500); font-weight: 600; }

/* EPG panel inside player */
#player-epg-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 280px;
  background: rgba(10,10,14,.95);
  border-left: 1px solid #1a1a20;
  z-index: 25;
  display: none;
  flex-direction: column;
  animation: slideIn .2s ease;
  backdrop-filter: blur(10px);
}
#player-epg-panel.open { display: flex; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 14px;
  border-bottom: 1px solid #1a1a20;
}
.panel-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 14px;
  letter-spacing: 1px; color: #fff; text-transform: uppercase;
}
.panel-close {
  background: none; border: none; color: #555;
  font-size: 16px; padding: 4px;
}
#player-epg-body {
  flex: 1; overflow-y: auto;
  padding: 8px 0;
}
.pepg-item {
  display: flex; gap: 12px;
  padding: 10px 14px;
  border-left: 3px solid transparent;
  transition: background .15s;
  cursor: pointer;
}
.pepg-item:hover { background: rgba(255,255,255,.04); }
.pepg-item.now { border-left-color: var(--accent, #f0a500); }
.pepg-time { color: var(--accent, #f0a500); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 1px; min-width: 44px; margin-top: 1px; }
.pepg-title { font-size: 13px; color: #ddd; margin-bottom: 2px; }
.pepg-dur { font-size: 11px; color: #555; }

/* Fullscreen adjustments */
#player-wrap:-webkit-full-screen { width: 100%; height: 100%; max-width: none; border-radius: 0; }
#player-wrap:fullscreen { width: 100%; height: 100%; max-width: none; border-radius: 0; aspect-ratio: unset; }

@media (max-width: 600px) {
  #player-wrap { width: 100%; border-radius: 0; }
  #player-overlay { background: #000; }
  .vol-slider { width: 60px; }
  .skip-btn span { display: none; }
  #player-epg-panel { width: 100%; }
}
