/* =============================================
   LiveBD Stream — Player Styles
   ============================================= */

/* ===== VIDEO WRAPPER ===== */
.video-wrap {
  flex: 1;
  position: relative;
  background: #000;
  min-height: 0;
  overflow: hidden;
}

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

/* ===== IDLE SCREEN ===== */
.idle-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000;
  z-index: 5;
  transition: opacity 0.3s;
}
.idle-screen.hide { opacity: 0; pointer-events: none; }

.idle-logo {
  font-size: 48px;
  font-weight: 900;
  color: rgba(255,255,255,0.06);
  letter-spacing: -2px;
}

.idle-text {
  font-size: 16px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.6;
}

.idle-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(230,57,70,0.15);
  border: 1px solid rgba(230,57,70,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ===== LOADING OVERLAY ===== */
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.75);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.player-loading.show { opacity: 1; pointer-events: all; }

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

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

.loading-ch-name {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
}

/* ===== ERROR OVERLAY ===== */
.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0,0,0,0.85);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.player-error.show { opacity: 1; pointer-events: all; }

.error-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(230,57,70,0.15);
  border: 1px solid rgba(230,57,70,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 22px;
}

.error-title { font-size: 16px; font-weight: 600; }
.error-msg { font-size: 13px; color: rgba(255,255,255,0.5); text-align: center; max-width: 280px; }

.btn-retry {
  padding: 9px 20px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  transition: background var(--transition);
}
.btn-retry:hover { background: var(--accent-h); }

/* ===== PLAYER CONTROLS ===== */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 16px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 8;
  opacity: 0;
  transition: opacity 0.25s;
}
.video-wrap:hover .player-controls,
.player-controls:focus-within { opacity: 1; }

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.15s;
  flex-shrink: 0;
  font-size: 18px;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.15); }

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

.volume-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ctrl-spacer { flex: 1; }

.quality-select {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 4px 8px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.quality-select option { background: var(--surface); }

.ctrl-label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
}

/* ===== TOP OVERLAY (Channel name while loading) ===== */
.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(rgba(0,0,0,0.6), transparent);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 8;
  pointer-events: none;
}
.video-wrap:hover .player-top-bar { opacity: 1; }

.top-bar-logo {
  width: 36px;
  height: 26px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-bar-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }

.top-bar-name { font-size: 15px; font-weight: 600; color: white; }
.top-bar-live {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* ===== PLAYER INFO BAR (below video) ===== */
.player-info-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.now-badge {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.now-info { flex: 1; min-width: 0; }
.now-ch-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-ch-meta { font-size: 12px; color: var(--text2); margin-top: 1px; }

.player-action-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text2);
  transition: all var(--transition);
}
.action-btn:hover {
  background: var(--surface3);
  border-color: var(--border2);
  color: var(--text);
}
.action-btn svg { flex-shrink: 0; }

/* ===== EPG / GUIDE PANEL ===== */
.epg-panel {
  background: var(--surface);
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  flex-shrink: 0;
}
.epg-panel.open { max-height: 220px; }

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

.epg-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

.epg-grid {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.epg-grid::-webkit-scrollbar { display: none; }

.epg-slot {
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 140px;
}
.epg-slot.current { border-color: var(--accent); background: rgba(230,57,70,0.08); }

.epg-time { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.epg-show { font-size: 13px; font-weight: 500; }
.epg-genre { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* ===== SOURCE SWITCHER (multiple stream sources) ===== */
.source-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.source-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: all var(--transition);
  cursor: pointer;
}
.source-btn:hover { border-color: var(--border2); color: var(--text); }
.source-btn.active {
  background: rgba(230,57,70,0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== BOTTOM SPONSORED BAR ===== */
.promo-bar {
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
}

.promo-bar a {
  color: var(--accent2);
  font-weight: 600;
  transition: opacity var(--transition);
}
.promo-bar a:hover { opacity: 0.8; }