/* ============================================================================
   Spotify QR — Brutalist Design System
   Raw · Bold · Functional · Aesthetic
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #181818;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-2: #888888;
  --text-3: #555555;
  --accent: #1DB954;
  --accent-dim: rgba(29,185,84,0.1);
  --danger: #ff3b30;
  --danger-dim: rgba(255,59,48,0.1);
  --warning: #ff9f0a;
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'Space Mono', 'SF Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px 100px; }
.wrap--admin { max-width: 920px; }

/* === Brutalist Header === */
.hero {
  padding: 40px 0 32px;
  border-bottom: 3px solid var(--accent);
  margin-bottom: 24px;
}

.hero__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero__title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  text-transform: uppercase;
}

.hero__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.hero__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}

/* === Vinyl Record === */
.vinyl-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.vinyl {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #1a1a1a 0deg, #333 30deg, #1a1a1a 60deg, #2a2a2a 90deg, #1a1a1a 120deg, #333 150deg, #1a1a1a 180deg, #2a2a2a 210deg, #1a1a1a 240deg, #333 270deg, #1a1a1a 300deg, #2a2a2a 330deg, #1a1a1a 360deg);
  border: 2px solid #333;
  position: relative;
  animation: spin 3s linear infinite;
  animation-play-state: paused;
  overflow: hidden;
}

.vinyl.spinning { animation-play-state: running; }

/* Album art in vinyl center */
.vinyl__art {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  z-index: 2;
  opacity: 0;
  transition: opacity 300ms;
}

.vinyl__art.visible { opacity: 1; }

/* Green dot when no art */
.vinyl::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  z-index: 1;
}

/* Groove ring */
.vinyl::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Admin Header === */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 28px 0 20px;
  border-bottom: 3px solid var(--border);
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.admin-header__right { display: flex; gap: 10px; align-items: center; }

.subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  margin: 16px 0;
  transition: border-color 150ms;
}

.card:hover { border-color: #444; }
.card--accent { border-left: 3px solid var(--accent); }

h2 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-2);
}

.badge--accent { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.badge--warning { border-color: var(--warning); color: var(--warning); background: rgba(255,159,10,0.1); }
.badge--danger { border-color: var(--danger); color: var(--danger); background: var(--danger-dim); }
.badge--vote {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  font-family: var(--font);
}

/* === Buttons === */
button, .btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all 100ms;
}

button:hover, .btn:hover { border-color: var(--text-2); background: #222; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

button.primary, .btn--primary { background: var(--accent); border-color: var(--accent); color: #000; }
button.primary:hover, .btn--primary:hover { background: #22d05f; border-color: #22d05f; }

button.sm, .btn--sm { padding: 6px 10px; font-size: 10px; }
button.danger, .btn--danger { background: var(--danger-dim); border-color: rgba(255,59,48,0.3); color: #ff6b6b; }
button.ghost, .btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }

.btn--outline-accent {
  background: var(--accent-dim);
  border-color: rgba(29,185,84,0.3);
  color: #86efac;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* === Inputs === */
input, textarea, select {
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 150ms;
}

input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 72px; resize: vertical; }

.search-bar { display: flex; gap: 0; }
.search-bar input { flex: 1; border-right: none; }
.search-bar button { white-space: nowrap; }

/* === Track Rows === */
.list { display: flex; flex-direction: column; gap: 2px; }

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border-left: 2px solid transparent;
  transition: all 100ms;
}

.row:hover { background: #1e1e1e; border-left-color: var(--accent); }

.row__img { width: 44px; height: 44px; object-fit: cover; background: #222; flex-shrink: 0; }
.row__info { flex: 1; min-width: 0; }
.row__title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__sub { font-family: var(--mono); font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row__actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* === Now Playing === */
.now-playing {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
}

.now-playing__img { width: 56px; height: 56px; object-fit: cover; background: #222; flex-shrink: 0; }
.now-playing__info { flex: 1; min-width: 0; }
.now-playing__label { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.now-playing__title { font-size: 16px; font-weight: 700; letter-spacing: -0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing__artist { font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-top: 2px; }

.eq-bars { display: flex; gap: 2px; align-items: flex-end; height: 18px; flex-shrink: 0; margin-left: auto; }
.eq-bars span { width: 3px; background: var(--accent); animation: eq 0.8s ease-in-out infinite; }
.eq-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.eq-bars span:nth-child(3) { height: 6px; animation-delay: 0.2s; }
.eq-bars span:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.now-playing .eq-bars { margin-left: 0; }

@keyframes eq { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(0.3)} }

/* === Tabs === */
.tabs { display: flex; gap: 0; border: 1px solid var(--border); }
.tab { flex: 1; padding: 8px 12px; border: none; background: transparent; color: var(--text-3); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; text-align: center; transition: all 100ms; }
.tab:not(:last-child) { border-right: 1px solid var(--border); }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--accent); background: var(--accent-dim); }

/* === Duo === */
.duo-area { border: 1px solid var(--border); padding: 16px; background: var(--bg); margin-top: 12px; }
.duo-deck { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo-card { border: 1px solid var(--border); padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color 100ms; }
.duo-card:hover { border-color: var(--accent); }
.duo-card__thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #222; }
.duo-card__title { font-weight: 700; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.duo-card__artist { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.duo-card__pill { font-family: var(--mono); font-size: 10px; color: var(--text-3); border: 1px solid var(--border); padding: 2px 6px; width: max-content; }
.duo-actions { display: flex; gap: 8px; margin-top: 12px; }
.duo-actions button { flex: 1; }
.duo-hint { text-align: center; font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-bottom: 8px; letter-spacing: 1px; }
.duo-status { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--text-2); margin-top: 10px; }

/* === Grid (admin) === */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

.list.scrollable { max-height: 400px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* === Form === */
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 0; }
.form-group label { display: block; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.form-check { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.form-check input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); }

.empty { text-align: center; padding: 28px 16px; font-family: var(--mono); font-size: 12px; color: var(--text-3); letter-spacing: 1px; }
.nav-link { text-decoration: none; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-2); padding: 8px 12px; border: 1px solid var(--border); transition: all 100ms; }
.nav-link:hover { color: var(--text); border-color: var(--text-2); }

.text-muted { color: var(--text-2); font-size: 12px; }
.text-sm { font-size: 11px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 14px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 14px; }
.hidden { display: none !important; }
.pulse { animation: pulse 1.5s ease-in-out infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }
.fade-in { animation: fadeIn 200ms ease forwards; }

@media (max-width: 520px) {
  .hero__title { font-size: 32px; }
  .hero__row { flex-direction: column; align-items: flex-start; }
  .vinyl-wrap { align-self: flex-end; margin-top: -60px; }
  .card { padding: 16px; }
  .row { padding: 8px 10px; gap: 10px; }
  .row__img { width: 38px; height: 38px; }
  .form-row { flex-direction: column; }
  .admin-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
