/* ── Root & Theme ─────────────────────────────────────────────────────────── */
:root {
  --accent: #c084fc;       /* purple */
  --accent-dark: #9333ea;
  --accent-glow: rgba(192, 132, 252, 0.25);
  --gold: #f59e0b;
  --bg: #0f0f13;
  --bg2: #18181f;
  --bg3: #22222d;
  --border: rgba(255,255,255,0.08);
  --text: #e4e4f0;
  --muted: #6b6b80;
  --vinyl-groove: #1e1e28;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.music-nav {
  background: linear-gradient(90deg, #0a0a10 0%, #14102a 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.music-nav .nav-link {
  color: rgba(255,255,255,0.65) !important;
  transition: color 0.2s, background 0.2s;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.music-nav .nav-link:hover,
.music-nav .nav-link.active {
  color: var(--accent) !important;
  background: rgba(192, 132, 252, 0.1) !important;
}

/* ── Stat Cards ───────────────────────────────────────────────────────────── */
.stat-card {
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  color: white;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.stat-icon {
  font-size: 1.6rem;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-lbl {
  font-size: 0.78rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Album Grid ───────────────────────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.album-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-dark);
  border-color: var(--accent-dark);
}

.album-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg3);
}

.album-art-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 50%, #2a2a3a 0%, var(--bg3) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.album-art-placeholder::after {
  content: '';
  position: absolute;
  width: 60%; height: 60%;
  border: 2px solid rgba(255,255,255,0.05);
  border-radius: 50%;
}

.album-body {
  padding: 0.85rem;
}

.album-title {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.album-artist {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  gap: 0.4rem;
}

/* ── Format Badges ────────────────────────────────────────────────────────── */
.fmt-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fmt-Vinyl      { background: #1a1a2e; color: #c084fc; border: 1px solid #6d28d9; }
.fmt-CD         { background: #0d1f2d; color: #38bdf8; border: 1px solid #0284c7; }
.fmt-Cassette   { background: #1c1a0d; color: #fcd34d; border: 1px solid #d97706; }
.fmt-8-Track    { background: #1a0d0d; color: #f87171; border: 1px solid #dc2626; }
.fmt-MiniDisc   { background: #0d1a17; color: #34d399; border: 1px solid #059669; }
.fmt-Reel-to-Reel { background: #1a1510; color: #fb923c; border: 1px solid #ea580c; }
.fmt-DAT        { background: #0d0d1a; color: #818cf8; border: 1px solid #4f46e5; }
.fmt-Laserdisc  { background: #1a0d1a; color: #e879f9; border: 1px solid #a21caf; }
.fmt-Other      { background: #1a1a1a; color: #94a3b8; border: 1px solid #475569; }

/* ── Condition Badges ─────────────────────────────────────────────────────── */
.cond-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.cond-M   { background: #064e3b; color: #6ee7b7; }
.cond-NM  { background: #065f46; color: #34d399; }
.cond-VGP { background: #1e3a5f; color: #7dd3fc; }
.cond-VG  { background: #1e3a8a; color: #93c5fd; }
.cond-GP  { background: #713f12; color: #fcd34d; }
.cond-G   { background: #7c2d12; color: #fdba74; }
.cond-F   { background: #7f1d1d; color: #fca5a5; }
.cond-P   { background: #3f1515; color: #f87171; }

/* ── Star Rating ──────────────────────────────────────────────────────────── */
.star-rating { color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.star-rating .star { transition: color 0.15s; }
.star-rating .star.filled { color: var(--gold); }
.star-rating .star:hover,
.star-rating .star:hover ~ .star { color: var(--gold); }

/* ── Cards / Panels ───────────────────────────────────────────────────────── */
.music-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.music-card .card-body { padding: 1.25rem; }

/* ── Form Controls ────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--bg3) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 10px !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent-dark) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  background: var(--bg3) !important;
  color: var(--text) !important;
}

.form-control::placeholder { color: var(--muted) !important; }
.form-select option { background: var(--bg3); }

.input-group-text {
  background: var(--bg3) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-accent {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-accent:hover { opacity: 0.9; color: white; transform: translateY(-1px); }
.btn-accent:active { transform: translateY(0); }

.btn-outline-accent {
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  background: transparent;
  border-radius: 10px;
  font-weight: 600;
}

.btn-outline-accent:hover { background: var(--accent-glow); color: var(--accent); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-content {
  background: var(--bg2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  color: var(--text) !important;
}

.modal-header { border-bottom: 1px solid var(--border) !important; }
.modal-footer { border-top: 1px solid var(--border) !important; }

.music-modal-header {
  background: linear-gradient(135deg, #1a0a2e 0%, #0f0f20 100%);
  border-bottom: 1px solid var(--border) !important;
}

/* ── Table ────────────────────────────────────────────────────────────────── */
.table {
  color: var(--text) !important;
}

.table thead th {
  background: var(--bg3) !important;
  color: var(--muted) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-color: var(--border) !important;
  font-weight: 600;
}

.table tbody td { border-color: var(--border) !important; }
.table-hover tbody tr:hover { background: rgba(192,132,252,0.05) !important; }

/* ── Vinyl Record Spinner ─────────────────────────────────────────────────── */
.vinyl-spin {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #3a3a3a 0%, #111 30%, #1a1a1a 31%, #222 60%, #111 61%, #1a1a1a 100%);
  animation: spin 1.2s linear infinite;
  display: inline-block;
}

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

/* ── Price display ────────────────────────────────────────────────────────── */
.price-positive { color: #34d399; font-weight: 600; }
.price-negative { color: #f87171; font-weight: 600; }
.price-neutral  { color: var(--muted); }

/* ── Search result rows ───────────────────────────────────────────────────── */
.search-result-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.search-result-row:hover {
  border-color: var(--accent-dark);
  background: rgba(192,132,252,0.05);
}

.search-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg3);
}

/* ── Wishlist cards ───────────────────────────────────────────────────────── */
.wish-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.wish-card:hover { border-color: var(--gold); }

/* ── Charts ───────────────────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 220px;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-accent { color: var(--accent) !important; }
.text-gold   { color: var(--gold) !important; }
.bg-music    { background: var(--bg2) !important; }
.border-music { border-color: var(--border) !important; }
.rounded-music { border-radius: 14px !important; }
.col-span-all { grid-column: 1 / -1; }

.label-muted {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}

hr { border-color: var(--border) !important; }

.badge.bg-secondary { background: var(--bg3) !important; color: var(--muted) !important; }
