/* ─── Pass the Aux — Host Panel ─────────────────────────────────────────────── */
@import './variables.css';

.host-layout {
  display: grid;
  grid-template-rows: 56px 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* ─── Host two-panel layout ──────────────────────────────────────────────────── */
.host-panels {
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
}

/* ─── Left sidebar ───────────────────────────────────────────────────────────── */
.host-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-5);
  gap: var(--space-5);
}

.session-info-block {}
.session-info-block .session-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-muted);
}
.stat-row:last-child { border-bottom: none; }
.stat-row strong { color: var(--text); font-weight: 600; }

.sidebar-section {}
.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}

/* Settings toggles */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}
.setting-row label {
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Devices selector */
.devices-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.8125rem;
  font-family: var(--font);
  cursor: pointer;
}
.devices-select:focus { outline: none; border-color: var(--accent); }

/* ─── Main content area ──────────────────────────────────────────────────────── */
.host-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Now playing bar ────────────────────────────────────────────────────────── */
.now-playing-bar {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.now-playing-content {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: var(--space-4);
  align-items: center;
}

.now-playing-art {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-card);
}

.now-playing-info {}
.now-playing-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.now-playing-artist { font-size: 0.8125rem; color: var(--text-muted); }
.now-playing-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  margin-bottom: 2px;
}

/* Progress bar */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-full);
  transition: width 1s linear;
}
.progress-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  flex-shrink: 0;
  min-width: 32px;
}

/* Playback controls */
.playback-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--green);
  border: none;
  color: var(--bg);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.play-btn:hover { box-shadow: var(--glow-green); transform: scale(1.05); }
.play-btn.paused { background: var(--accent); }
.play-btn.paused:hover { box-shadow: var(--glow-accent); }

/* ─── Queue panel ────────────────────────────────────────────────────────────── */
.host-queue {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.host-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  flex-shrink: 0;
}
.host-queue-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Drag handle for reordering */
.drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 1rem;
  padding: 0 var(--space-2);
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

.queue-item.dragging {
  opacity: 0.4;
  background: var(--bg-elevated);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.queue-item.drag-over {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.06);
}

/* Host queue action buttons — larger tap targets than generic .btn.btn-icon */
.host-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.9375rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  color: var(--text-muted);
}
.host-action-btn:hover { color: var(--text); border-color: var(--text-muted); background: var(--bg-elevated); }
.play-queue-btn:hover  { border-color: var(--green); color: var(--green); background: rgba(0,232,122,0.08); }
.host-remove-btn:hover { border-color: var(--red, #ff4d4d); color: var(--red, #ff4d4d); background: rgba(255,77,77,0.08); }

/* ─── Host search bar ────────────────────────────────────────────────────────── */
.host-search-bar {
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.host-search-inner {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ─── Responsive — tablet/mobile collapse ────────────────────────────────────── */
@media (max-width: 768px) {
  .host-panels {
    grid-template-columns: 1fr;
  }
  .host-sidebar {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    width: 280px;
    z-index: 200;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
  }
  .host-sidebar.open { display: flex; }
}

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-5);
  flex-shrink: 0;
}
.tab-btn {
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.tab-panel.hidden { display: none; }

/* Make queue panel fill and scroll */
#tab-queue { overflow: hidden; }
#tab-queue .host-queue { flex: 1; overflow-y: auto; }

#tab-history .host-queue  { overflow-y: auto; flex: 1; }
#tab-participants .host-queue { overflow-y: auto; flex: 1; }


/* ─── Participants table ─────────────────────────────────────────────────────── */
.participants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.participants-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.participants-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
  vertical-align: middle;
}
.participants-table tr:last-child td { border-bottom: none; }

/* ─── Participant activity indicators ───────────────────────────────────────── */
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-dot--active { background: var(--green); }
.activity-dot--idle   { background: var(--amber); }
.activity-dot--stale  { background: var(--red, #ff4d4d); opacity: 0.7; }

/* ─── Participant remove button ──────────────────────────────────────────────── */
.participant-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.participant-remove-btn:hover {
  color: var(--red, #ff4d4d);
  border-color: var(--red, #ff4d4d);
  background: var(--red-dim);
}
.participant-remove-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Skipped tracks in history — accessible, no strikethrough ───────────────── */
.queue-item.is-skipped .queue-item__meta { color: var(--text-dim); }

/* ─── Sidebar prompt / announce sections ────────────────────────────────────── */
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border-muted); }

/* ─── Rounds tab ─────────────────────────────────────────────────────────────── */
.round-active-block {
  background: rgba(0, 232, 122, 0.06);
  border: 1px solid var(--green-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.round-question-display {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: var(--space-2);
}

.round-meta-display {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.round-form-section {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: var(--space-5);
}

.round-history-section {}

.round-history-item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-muted);
}
.round-history-item:last-child { border-bottom: none; }

.round-history-num {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-1);
}

.round-history-q {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.round-winner {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ─── Leaderboard tab ────────────────────────────────────────────────────────── */
.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 900px) {
  .leaderboard-grid { grid-template-columns: 1fr; }
}

.leaderboard-section {}

.leaderboard-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}

.lb-row {
  display: grid;
  grid-template-columns: 18px 32px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-muted);
}
.lb-row:last-child { border-bottom: none; }
.lb-row--person { grid-template-columns: 18px 1fr auto; }

.lb-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
}
.lb-rank-1 { color: #ffd700; }
.lb-rank-2 { color: #c0c0c0; }
.lb-rank-3 { color: #cd7f32; }

.lb-art {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
}
.lb-art--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.lb-info { overflow: hidden; min-width: 0; }
.lb-primary {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-secondary {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}
.lb-score.text-green { color: var(--green); }

.lb-credits {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── Credit adjustment buttons ─────────────────────────────────────────────── */
.credit-adj-row {
  display: flex;
  gap: 4px;
}
.credit-adj-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  color: var(--text-muted);
  white-space: nowrap;
}
.credit-adj-btn.minus:hover { color: var(--red);   border-color: var(--red);   background: var(--red-dim); }
.credit-adj-btn.plus:hover  { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.credit-adj-btn:disabled    { opacity: 0.4; cursor: not-allowed; }
