/* Music page styles — Skylina dark aesthetic */
:root {
  --lime: #B8FF47;
  --lime-dim: rgba(184, 255, 71, 0.15);
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #16161f;
  --border: rgba(255,255,255,0.07);
  --text: #e8e8f0;
  --text-muted: #8888a0;
}

body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; }

/* ── Hero ─────────────────────────────────────── */
.music-hero {
  background: linear-gradient(135deg, #0f0f1a 0%, #0a0a0f 60%);
  border-bottom: 1px solid rgba(184,255,71,0.1);
  padding: 120px 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}
.music-hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 400px;
  background: radial-gradient(ellipse at center, rgba(184,255,71,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.music-hero-inner { flex: 1; max-width: 600px; }
.music-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(184,255,71,0.08);
  border: 1px solid rgba(184,255,71,0.2);
  color: var(--lime);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.music-hero h1 {
  font-family: 'Bricolage Grotesque', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.1;
}
.music-hero p { color: rgba(232,232,240,0.6); font-size: 1rem; margin: 0 0 28px; max-width: 460px; }
.music-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.btn-create-playlist {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--lime); color: #000; border: none;
  padding: 10px 20px; border-radius: 10px; font-size: 0.875rem;
  font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-create-playlist:hover { background: #c8ff5a; transform: translateY(-1px); }

/* Hero visual */
.music-hero-visual { flex-shrink: 0; }
.sound-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 80px;
  padding: 20px;
}
.wave-bar {
  width: 6px;
  background: linear-gradient(to top, var(--lime), rgba(184,255,71,0.3));
  border-radius: 3px;
  animation: waveAnim 1.2s ease-in-out infinite;
}
.wave-bar:nth-child(1)  { height: 40px; animation-delay: 0s; }
.wave-bar:nth-child(2)  { height: 65px; animation-delay: 0.1s; }
.wave-bar:nth-child(3)  { height: 50px; animation-delay: 0.2s; }
.wave-bar:nth-child(4)  { height: 80px; animation-delay: 0.15s; }
.wave-bar:nth-child(5)  { height: 55px; animation-delay: 0.3s; }
.wave-bar:nth-child(6)  { height: 70px; animation-delay: 0.05s; }
.wave-bar:nth-child(7)  { height: 45px; animation-delay: 0.25s; }
.wave-bar:nth-child(8)  { height: 60px; animation-delay: 0.12s; }
.wave-bar:nth-child(9)  { height: 75px; animation-delay: 0.2s; }
.wave-bar:nth-child(10) { height: 50px; animation-delay: 0.35s; }
.wave-bar:nth-child(11) { height: 38px; animation-delay: 0.08s; }
.wave-bar:nth-child(12) { height: 55px; animation-delay: 0.22s; }
@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.5); opacity: 0.6; }
  50% { transform: scaleY(1.2); opacity: 1; }
}

/* ── Sections ──────────────────────────────────── */
.music-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
}
.music-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.music-section h2 {
  font-family: 'Bricolage Grotesque', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* ── Playlists Grid ─────────────────────────────── */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.playlist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.playlist-card:hover {
  border-color: rgba(184,255,71,0.3);
  background: rgba(184,255,71,0.04);
  transform: translateY(-1px);
}
.playlist-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--lime-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--lime);
  flex-shrink: 0;
}
.playlist-card-info { flex: 1; min-width: 0; }
.playlist-card-name {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
  word-wrap: break-word; overflow-wrap: break-word; white-space: normal;
}
.playlist-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.system-playlist .playlist-card-icon { background: rgba(99,102,241,0.15); color: #818cf8; }
.system-playlist { border-color: rgba(99,102,241,0.2); }

/* ── Filter Tabs ─────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
}
.filter-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.1); }
.filter-tab.active {
  background: var(--lime-dim);
  color: var(--lime);
  border-color: rgba(184,255,71,0.3);
}

/* ── Tracks Grid ─────────────────────────────────── */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.track-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.track-card.active-track { border-color: rgba(184,255,71,0.4); box-shadow: 0 0 0 1px rgba(184,255,71,0.2); }
.track-card-art {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.track-audio-art { color: var(--lime); opacity: 0.5; }
.track-card:hover .track-audio-art { opacity: 0.8; }
.track-play-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--lime);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s;
  padding: 0;
}
.track-card:hover .track-play-btn { opacity: 1; transform: scale(1); }
.track-card.active-track .track-play-btn { opacity: 1; transform: scale(1); }
.track-play-btn svg { pointer-events: none; }

.track-card-body { padding: 12px; }
.track-card-title {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.track-card-creator { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.track-card-stats { display: flex; gap: 12px; align-items: center; }
.stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.7rem; color: var(--text-muted);
}
.stat svg { flex-shrink: 0; }

/* Track card actions (hover) */
.track-card-actions {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.track-card:hover .track-card-actions { opacity: 1; }
.track-action-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.track-action-btn:hover { background: var(--lime-dim); color: var(--lime); border-color: rgba(184,255,71,0.3); }

/* ── Empty State ─────────────────────────────────── */
.music-empty {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted);
}
.music-empty svg { color: var(--lime); opacity: 0.4; margin-bottom: 16px; }
.music-empty h3 { font-family: 'Bricolage Grotesque', serif; font-size: 1.25rem; color: var(--text); margin: 0 0 8px; }
.music-empty p { margin: 0 0 24px; font-size: 0.9rem; }
.music-empty .btn-primary {
  display: inline-flex; align-items: center;
  background: var(--lime); color: #000; border: none;
  padding: 10px 20px; border-radius: 10px; font-size: 0.875rem;
  font-weight: 600; text-decoration: none; font-family: 'DM Sans', sans-serif;
}

/* ── Pagination ─────────────────────────────────── */
.music-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 40px; padding-bottom: 20px;
}
.pagination-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.15s;
}
.pagination-btn:hover { border-color: var(--lime); color: var(--lime); }
.pagination-info { font-size: 0.85rem; color: var(--text-muted); }

/* ── Sticky Audio Player ─────────────────────────── */
.audio-player-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 9998;
  background: #0e0e15;
  border-top: 1px solid rgba(184,255,71,0.15);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
}
.player-progress {
  height: 20px; cursor: pointer;
  background: rgba(255,255,255,0.1);
  position: relative;
  display: flex;
  align-items: center;
}
.player-progress-fill {
  height: 100%;
  background: var(--lime);
  transition: width 0.3s;
  pointer-events: none;
}
.player-progress:hover { height: 5px; }
.player-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
}
.player-track-info {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
}
.player-wave {
  display: flex; align-items: center; gap: 3px;
  height: 36px; flex-shrink: 0;
}
.pw-bar {
  width: 4px;
  background: var(--lime);
  border-radius: 2px;
  animation: waveAnim 1.2s ease-in-out infinite;
  opacity: 0.7;
}
.pw-bar:nth-child(1) { height: 18px; animation-delay: 0s; }
.pw-bar:nth-child(2) { height: 28px; animation-delay: 0.1s; }
.pw-bar:nth-child(3) { height: 36px; animation-delay: 0.2s; }
.pw-bar:nth-child(4) { height: 22px; animation-delay: 0.15s; }
.pw-bar:nth-child(5) { height: 30px; animation-delay: 0.3s; }
.player-text { min-width: 0; }
.player-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
.player-creator { font-size: 0.72rem; color: var(--text-muted); }

.player-controls { display: flex; align-items: center; gap: 8px; }
.player-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; padding: 0;
}
.player-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.player-playpause {
  width: 44px; height: 44px;
  background: var(--lime) !important;
  color: #000 !important;
}
.player-playpause:hover { background: #c8ff5a !important; transform: scale(1.05); }

.player-right {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.player-time { font-size: 0.72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.volume-slider {
  -webkit-appearance: none;
  width: 80px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--lime);
  cursor: pointer;
}
.player-close { opacity: 0.6; }
.player-close:hover { opacity: 1; }

/* ── Modals ──────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 100%; max-width: 400px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: 'Bricolage Grotesque', serif;
  font-size: 1.1rem; font-weight: 700; color: #fff; margin: 0;
}
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.modal-hint { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.modal-hint a { color: var(--lime); }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group input[type="text"] {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input[type="text"]:focus { border-color: var(--lime); }

/* Buttons — scoped to music sections so auth modal btn-full is not overridden */
.music-section .btn-primary,
.music-hero .btn-primary,
.music-empty .btn-primary,
.modal-footer .btn-primary {
  display: inline-flex; align-items: center;
  background: var(--lime); color: #000; border: none;
  padding: 9px 18px; border-radius: 8px; font-size: 0.875rem;
  font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.music-section .btn-primary:hover,
.music-hero .btn-primary:hover,
.music-empty .btn-primary:hover,
.modal-footer .btn-primary:hover { background: #c8ff5a; }
.modal-footer .btn-ghost,
.music-section .btn-ghost {
  display: inline-flex; align-items: center;
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  padding: 9px 18px; border-radius: 8px; font-size: 0.875rem;
  font-weight: 500; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.modal-footer .btn-ghost:hover,
.music-section .btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
/* Ensure auth modal sign-up button stays full-width and centered */
.auth-form .btn-primary.btn-full { width: 100%; justify-content: center; text-align: center; }

/* Add to playlist list */
.playlist-add-list { display: flex; flex-direction: column; gap: 4px; }
.playlist-add-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.playlist-add-item:hover { background: var(--lime-dim); color: var(--lime); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .music-hero { flex-direction: column; padding: 110px 20px 32px; text-align: center; }
  .music-hero-visual { display: none; }
  .tracks-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .playlists-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .player-wave { display: none; }
  .volume-slider { width: 60px; }
  .player-time { display: none; }
  .player-inner { padding: 8px 12px; }
}