/* ══════════════════════════════════════════════════════════════════════════
   SECTION 12: WAVEFORM + HOT CUES
   Canvas waveform overlay, progress, hover preview, A/B/C/D cue buttons,
   right-click context menu.
   ══════════════════════════════════════════════════════════════════════════ */

/* Container chứa 2 lớp canvas (peaks + cues), hover line, skeleton text */
.wf-host {
  position: relative;
  width: 100%;
  height: 64px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
}

.wf-host.wf-mini {
  height: 36px;
  border-radius: 6px;
}

.wf-peaks,
.wf-cues {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.wf-peaks { z-index: 1; }
.wf-cues  { z-index: 2; pointer-events: auto; }

.wf-host:hover .wf-peaks {
  filter: brightness(1.08);
}

.wf-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Fira Code', monospace;
  letter-spacing: 0.5px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(0, 242, 254, 0.04) 0%,
    rgba(0, 242, 254, 0.10) 50%,
    rgba(0, 242, 254, 0.04) 100%);
  background-size: 200% 100%;
  animation: wfShimmer 1.5s linear infinite;
}

@keyframes wfShimmer {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}

/* Hover indicator (vạch dọc + tooltip thời gian) */
.wf-hover {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  z-index: 4;
  pointer-events: none;
}

.wf-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 4px rgba(0, 242, 254, 0.6);
}

.wf-hover-time {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.85);
  color: var(--neon-cyan);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ── Hot cue buttons row ─────────────────────────────────────────────── */
.hotcue-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.hotcue-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0.35rem 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Fira Code', monospace;
  cursor: pointer;
  transition: var(--transition);
  min-width: 0;
}

.hotcue-btn:hover {
  background: rgba(0, 242, 254, 0.06);
  color: var(--text-main);
  border-color: rgba(0, 242, 254, 0.25);
}

.hotcue-btn .hotcue-letter {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.hotcue-btn .hotcue-time {
  font-size: 0.62rem;
  opacity: 0.65;
}

.hotcue-btn.hotcue-set {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18) 0%, rgba(244, 63, 94, 0.05) 100%);
  border-color: rgba(244, 63, 94, 0.5);
  color: #f43f5e;
}

.hotcue-btn.hotcue-set:hover {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.28) 0%, rgba(244, 63, 94, 0.10) 100%);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.25);
}

.hotcue-btn.hotcue-set .hotcue-time {
  opacity: 1;
}

/* Mini variant cho event cards */
.hotcue-row.hotcue-mini {
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.hotcue-row.hotcue-mini .hotcue-btn {
  padding: 0.2rem 0.3rem;
}

.hotcue-row.hotcue-mini .hotcue-letter { font-size: 0.7rem; }
.hotcue-row.hotcue-mini .hotcue-time   { font-size: 0.55rem; }

/* ── Right-click context menu ────────────────────────────────────────── */
.hotcue-ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  background: var(--bg-panel, #0b0f1a);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  padding: 0.4rem 0;
  overflow: hidden;
}

.hotcue-ctx-head {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  padding: 0.4rem 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'Fira Code', monospace;
}

.hotcue-ctx-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.hotcue-ctx-item:hover {
  background: rgba(0, 242, 254, 0.10);
  color: var(--neon-cyan);
}

.hotcue-ctx-item b {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  color: var(--neon-cyan);
}

.hotcue-ctx-item.has b {
  color: #f43f5e;
}

.hotcue-ctx-cur {
  flex: 1;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Fira Code', monospace;
  text-align: right;
}

.hotcue-ctx-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 0.25rem 0;
}

.hotcue-ctx-danger {
  color: #f43f5e;
}

.hotcue-ctx-danger:hover {
  background: rgba(244, 63, 94, 0.10);
  color: #fb7185;
}

/* ── Layout integration: waveform thay cho range progress trong player ── */
.progress-row.with-wf {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.progress-row.with-wf .wf-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-row.with-wf .wf-row .wf-host {
  flex: 1;
}

/* Mobile compact */
@media (max-width: 720px) {
  .wf-host { height: 50px; }
  .hotcue-btn { padding: 0.3rem 0.25rem; }
  .hotcue-btn .hotcue-letter { font-size: 0.7rem; }
  .hotcue-btn .hotcue-time   { font-size: 0.55rem; }
}
