/* ═══════════════════════════════════════════════════
   player.css — Video player, annotation toolbar, queue
═══════════════════════════════════════════════════ */

/* ── Shell ── */
.player-shell {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.player-main    { flex: 1; min-width: 0; }
.player-sidebar { width: 260px; flex-shrink: 0; }

@media (max-width: 720px) {
  .player-shell   { flex-direction: column; }
  .player-sidebar { width: 100%; }
}

/* ── Video container + canvas overlay ── */
.video-container {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.video-container video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.annotation-canvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  pointer-events: none; /* tools toggle this to 'auto' — none by default so video is clickable */
}
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.no-video-state      { text-align: center; color: #444; }
.no-video-state .icon { font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.4; }

/* ── Controls bar ── */
.controls-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.6rem 0.75rem;
}

.controls-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.progress-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 0.1s;
  user-select: none;
}
.progress-track:hover { height: 8px; margin: -1.5px 0; }
.progress-played { height: 100%; background: var(--orange); border-radius: 3px; pointer-events: none; }

/* YouTube-style hover scrubber */
.progress-thumb {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  background: var(--orange);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.12s;
  pointer-events: none;
  z-index: 2;
}
.progress-track:hover .progress-thumb { transform: translate(-50%, -50%) scale(1); }

.progress-preview {
  position: absolute;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: .68rem;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 3;
}
.progress-track:hover .progress-preview { opacity: 1; }

.time-disp {
  font-size: 0.72rem;
  color: var(--text3);
  white-space: nowrap;
}

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

.ctrl-btn {
  padding: 5px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--text2);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ctrl-btn:hover  { border-color: var(--orange); color: var(--orange); }
.ctrl-btn.active { background: var(--orange-dim); border-color: var(--orange-border); color: var(--orange); }

.ctrl-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

.speed-badge {
  padding: 3px 7px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  font-size: 0.7rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.12s;
}
.speed-badge:hover  { border-color: var(--orange); color: var(--orange); }
.speed-badge.active { background: var(--orange-dim); border-color: var(--orange-border); color: var(--orange); }

.vol-slider { width: 65px; accent-color: var(--orange); }

/* ── Annotation toolbar ── */
.anno-toolbar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.anno-sep { width: 1px; height: 20px; background: var(--border); margin: 0 3px; }

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color 0.12s;
}
.color-dot.active { border-color: #fff; }

.size-slider { width: 70px; accent-color: var(--orange); }

/* ── Video queue (sidebar) ── */
.queue-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: var(--r2);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s;
  margin-bottom: 5px;
}
.queue-item:hover  { border-color: var(--border2); }
.queue-item.active { border-color: var(--orange); background: var(--orange-dim); }

.qi-thumb {
  width: 50px;
  height: 32px;
  background: #111;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qi-play {
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #555;
  margin-left: 2px;
}
.qi-info    { flex: 1; min-width: 0; }
.qi-title   { font-size: 0.78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-meta    { font-size: 0.68rem; color: var(--text3); }
