/* THOMZY.com — DJ Booth styles
 * Collaborative dual-deck turntable UI.
 * Lives inside the existing DJ booth floating window (.wm-win[data-win-id="dj"]).
 *
 * Layout: 3-column grid — [Deck A] [Center / crossfader + mixer] [Deck B]
 */

/* ── Root layout ─────────────────────────────────────────────────────────── */
.dj-layout {
  display: grid;
  grid-template-columns: 1fr 200px 1fr;
  gap: 10px;
  height: 100%;
  padding: 8px;
  background: #06030e;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

/* ── Deck panels ─────────────────────────────────────────────────────────── */
.dj-deck-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  background: #09050f;
  border: 1px solid #2e1855;
  border-radius: 8px;
  padding: 8px 6px;
  overflow: hidden;
  min-width: 0;
}

.dj-deck-panel.deck-a { border-color: #4a2080; }
.dj-deck-panel.deck-b { border-color: #205080; }

/* Status indicator */
.dj-deck-panel[data-status="loading"] { opacity: 0.75; }
.dj-deck-panel[data-status="error"]   { border-color: #802020; }
.dj-deck-panel.drag-over {
  border-color: #a060ff;
  box-shadow: 0 0 18px rgba(140, 60, 255, 0.35) inset;
}

/* ── Deck header ─────────────────────────────────────────────────────────── */
.dj-deck-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.dj-deck-label {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 1.05em;
  letter-spacing: 0.08em;
}
.deck-a .dj-deck-label { color: #b87cff; }
.deck-b .dj-deck-label { color: #56c8ff; }

.dj-bpm {
  font-family: 'Courier New', monospace;
  font-size: 0.78em;
  color: #70d0ff;
  margin-left: auto;
  min-width: 54px;
  text-align: right;
}

/* ── Platter wrap ────────────────────────────────────────────────────────── */
.dj-platter-wrap {
  position: relative;
  flex-shrink: 0;
}

.dj-platter {
  border-radius: 50%;
  cursor: grab;
  display: block;
  touch-action: none;
  user-select: none;
  border: 2px solid #3a1a6a;
  box-shadow:
    0 0 16px rgba(120, 60, 220, 0.35),
    inset 0 0 8px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.15s;
  max-width: 100%;
}
.dj-platter:hover {
  box-shadow:
    0 0 22px rgba(150, 80, 255, 0.5),
    inset 0 0 8px rgba(0, 0, 0, 0.5);
}
.dj-platter.scratching {
  cursor: grabbing;
  box-shadow:
    0 0 28px rgba(200, 120, 255, 0.7),
    inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.dj-deck-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 3, 14, 0.7);
  border-radius: 50%;
  color: #9060d0;
  font-family: monospace;
  font-size: 0.8em;
  pointer-events: none;
}
/* display:flex above would override the HTML hidden attribute — fix that */
.dj-deck-loading[hidden] { display: none; }

/* ── Waveform canvas ─────────────────────────────────────────────────────── */
.dj-waveform {
  width: 100%;
  height: 60px;
  border-radius: 4px;
  background: #06030e;
  border: 1px solid #1a0a2e;
  flex-shrink: 0;
  display: block;
  cursor: crosshair;
}
.dj-waveform:hover {
  border-color: #3a1a5e;
}

/* ── Deck metadata ───────────────────────────────────────────────────────── */
.dj-deck-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 38px;
}

.dj-deck-title {
  font-family: 'Courier New', monospace;
  font-size: 0.72em;
  color: #c0a0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dj-deck-artist {
  font-family: 'Courier New', monospace;
  font-size: 0.65em;
  color: #8060a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dj-deck-time {
  font-family: 'Courier New', monospace;
  font-size: 0.68em;
  color: #605080;
}

/* ── Deck controls ───────────────────────────────────────────────────────── */
.dj-deck-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dj-btn {
  background: #130820;
  border: 1px solid #3a1a5a;
  color: #c0a0ff;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 0.82em;
  transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
  white-space: nowrap;
}
.dj-btn:hover {
  background: #210d30;
  border-color: #7040c0;
  box-shadow: 0 0 6px rgba(130, 60, 220, 0.3);
}

.dj-btn-cue {
  border-color: #7a6010;
  color: #ffc840;
}
.dj-btn-cue:hover {
  background: #201505;
  border-color: #c09030;
  box-shadow: 0 0 6px rgba(200, 150, 0, 0.3);
}

.dj-btn-play.playing {
  background: #0d2018;
  border-color: #30b060;
  color: #60ff80;
  box-shadow: 0 0 8px rgba(50, 180, 90, 0.5);
}

.dj-btn-clear {
  border-color: #602020;
  color: #ff6060;
  padding: 4px 7px;
}
.dj-btn-clear:hover {
  background: #1a0505;
  border-color: #c04040;
  box-shadow: 0 0 6px rgba(220, 50, 50, 0.3);
}

/* ── Pitch row ───────────────────────────────────────────────────────────── */
.dj-pitch-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.dj-pitch-label {
  font-family: 'Courier New', monospace;
  font-size: 0.65em;
  color: #705090;
  flex-shrink: 0;
}

.dj-pitch {
  flex: 1;
  accent-color: #60d0ff;
  min-width: 0;
  height: 4px;
}

.dj-pitch-val {
  font-family: 'Courier New', monospace;
  font-size: 0.68em;
  color: #60d0ff;
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Drop zone ───────────────────────────────────────────────────────────── */
.dj-drop-zone {
  width: 100%;
  border: 2px dashed #2e1850;
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  color: #5a4080;
  font-family: 'Courier New', monospace;
  font-size: 0.68em;
  cursor: default;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  box-sizing: border-box;
  flex-shrink: 0;
}
.dj-drop-zone.drag-over {
  border-color: #a060ff;
  background: rgba(140, 60, 255, 0.12);
  color: #c890ff;
}

/* ── Center panel ────────────────────────────────────────────────────────── */
.dj-center-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

/* ── Crossfader ──────────────────────────────────────────────────────────── */
.dj-xfader-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dj-xfader-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.dj-xfader-label-a,
.dj-xfader-label-b {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.85em;
}
.dj-xfader-label-a { color: #b87cff; }
.dj-xfader-label-b { color: #56c8ff; }

.dj-crossfader {
  width: 100%;
  accent-color: #a060ff;
  height: 6px;
  cursor: pointer;
  --cf-pct: 50%;
}

/* ── SYNC BPM button ─────────────────────────────────────────────────────── */
.dj-sync-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.dj-btn-sync {
  background: #0e1820;
  border: 1px solid #205070;
  color: #60d0ff;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 0.75em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s;
}
.dj-btn-sync:hover {
  background: #142028;
  border-color: #40a0d0;
  box-shadow: 0 0 6px rgba(60, 160, 220, 0.4);
}

.dj-master-bpm {
  font-family: 'Courier New', monospace;
  font-size: 0.72em;
  color: #405060;
}

/* Divider */
.dj-divider {
  width: 100%;
  height: 1px;
  background: #1a0a2e;
}

/* ── Mixer embed in center ───────────────────────────────────────────────── */
.dj-mixer-wrap {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Narrow the mixer panel to fit the center column */
.dj-mixer-wrap .mixer-panel {
  width: 100%;
  max-width: 100%;
}

/* ── Touch presence dots ─────────────────────────────────────────────────── */
.dj-touch-indicators {
  position: absolute;
  top: 4px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 5;
  pointer-events: none;
}

.dj-touch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-block;
  flex-shrink: 0;
}

/* ── Responsive: collapse center column on narrow windows ────────────────── */
@media (max-width: 700px) {
  .dj-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .dj-center-panel {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
}
