/* ═══════════════════════════════════════════════
   ŻeloTV — Video Player
   Player layout · overlay · controls · info bar
   ═══════════════════════════════════════════════ */

/* ── Stream player layout ────────────────────── */
.stream-layout { display: flex; height: 100%; position: relative; overflow: hidden; }
.stream-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  transition: flex .3s cubic-bezier(.4,0,.2,1);
}

/* ── Player overlay (click to play / unmute) ──── */
.player-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  cursor: pointer;
  color: white;
  animation: fadeIn 0.3s ease;
}

.play-btn-large {
  width: 100px;
  height: 100px;
  background: none;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(.175,.885,.32,1.275);
}

.player-overlay:hover .play-btn-large {
  transform: scale(1.1);
}

.play-btn-large svg {
  width: 56px;
  height: 56px;
  margin-left: 6px;
  fill: rgba(255, 255, 255, 0.85);
}

/* ── Player wrap ─────────────────────────────── */
.player-wrap {
  position: relative; flex: 1;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.player-wrap video {
  width: 100%; height: 100%; object-fit: contain;
}
.player-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--text-dim);
  font-size: 14px;
}
.sp {
  width: 28px; height: 28px; border: 2px solid var(--text-muted);
  border-top-color: var(--text); border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── Player controls ─────────────────────────── */
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  opacity: 0; transition: opacity .25s;
}
.player-wrap:hover .player-controls { opacity: 1; }
.pc-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; min-width: 34px; min-height: 34px; flex-shrink: 0;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: #fff; cursor: pointer;
  transition: background var(--transition);
}
.pc-btn:hover { background: rgba(255,255,255,0.15); }
.pc-btn svg { width: 18px; height: 18px; transition: opacity .15s ease; }
.pc-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 80px; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px; cursor: pointer;
  touch-action: none;
  outline: none;
  transition: background 0.15s ease;
}
.pc-vol:hover { background: rgba(255,255,255,0.3); }
.pc-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%; background: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}
.pc-vol:hover::-webkit-slider-thumb { transform: scale(1.2); }
.pc-vol::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%; background: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.pc-vol::-moz-range-track {
  background: rgba(255,255,255,0.2); height: 4px;
  border-radius: 2px; border: none;
}
.pc-spacer { flex: 1; }
.pc-menu {
  position: absolute; bottom: 52px; right: 12px;
  background: rgba(20,20,20,0.95); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 12px 14px;
  min-width: 180px;
}
.pc-menu-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0; font-size: 12px; color: var(--text-dim);
}
.pc-menu-label { font-weight: 500; }
.pc-select {
  font-size: 12px; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 2px 6px;
}
.pc-toggle { position: relative; width: 32px; height: 18px; display: inline-block; }
.pc-toggle input { opacity: 0; width: 0; height: 0; }
.pc-toggle span {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--text-muted); border-radius: 9px; transition: background var(--transition);
}
.pc-toggle span::before {
  content: ''; position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: #fff;
  left: 2px; top: 2px; transition: transform var(--transition);
}
.pc-toggle input:checked + span { background: var(--accent); }
.pc-toggle input:checked + span::before { transform: translateX(14px); }

/* ── Stream info bar — FIXED HEIGHT ─────────── */
.stream-info-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--info-bar-h); min-height: var(--info-bar-h); max-height: var(--info-bar-h);
  padding: 0 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  /* Removed overflow: hidden so tooltip can escape */
}
.streamer-info { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.streamer-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.streamer-details { min-width: 0; overflow: hidden; }
.streamer-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-title-text { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.stream-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.viewer-count { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-dim); position: relative; cursor: pointer; }

/* ── Viewer Hover Dropup ── */
.viewer-count:hover .viewer-hover-list {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.viewer-hover-list {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: rgba(15, 15, 15, 0.95); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 8px;
  min-width: 160px;
  opacity: 0; visibility: hidden; transition: all var(--transition);
  z-index: 100; box-shadow: 0 -4px 12px rgba(0,0,0,0.5);
}
.viewer-hover-list::after {
  content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px; background: rgba(15, 15, 15, 0.95);
  border-right: 1px solid var(--border-accent); border-bottom: 1px solid var(--border-accent);
}
.vh-item {
  display: flex; align-items: center; gap: 8px; padding: 6px;
  border-radius: var(--radius-sm); transition: background var(--transition);
}
.vh-item:hover { background: var(--bg-card-hover); }
.vh-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.vh-name { font-size: 13px; color: var(--text); font-weight: 500; white-space: nowrap; }
.vh-empty { font-size: 12px; color: var(--text-dim); text-align: center; padding: 4px; }
.live-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  background: var(--live-red); color: #fff;
  padding: 3px 8px; border-radius: var(--radius-sm);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,68,68,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,68,68,0); }
}
