:root {
  --bg: #0a0a12;
  --card: #12121f;
  --accent: #05d9e8;
  --accent-2: #ff2a6d;
  --text: #e0e0e0;
  --muted: #6a6a8a;
  --danger: #ff2a6d;
  --surface: #1a1a2e;
  --surface-2: #252540;
  --border: #2a2a4a;
  --transition-fast: 0.15s ease;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
  --glow: 0 0 20px rgba(5, 217, 232, 0.4);
  /* Cyberpunk neon colors */
  --neon-cyan: #05d9e8;
  --neon-pink: #ff2a6d;
  --neon-yellow: #f9f871;
  --neon-purple: #d16bff;
  --neon-glow: rgba(5, 217, 232, 0.4);
}

body[data-theme="light"] {
  --bg: #f5f7fb;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-2: #22c55e;
  --text: #0f172a;
  --muted: #475569;
  --surface: #f1f5f9;
  --surface-2: #e2e8f0;
  --border: #cbd5f5;
}

body[data-theme="y2k"] {
  --bg: #fff7e6;
  --card: #fffdf7;
  --accent: #ff9f1c;
  --accent-2: #2ec4b6;
  --text: #1b1b1b;
  --muted: #6b7280;
  --surface: #fff1dc;
  --surface-2: #ffe8c7;
  --border: #f1c27d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #111827, var(--bg) 50%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tooltips */
[title] {
  position: relative;
}

button[title]::before,
a[title]::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 100;
  pointer-events: none;
}

button[title]:hover::before,
a[title]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

/* Skeleton loading animation */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: rgba(29, 185, 84, 0.3);
  color: var(--text);
}

body[data-theme="light"],
body[data-theme="y2k"] {
  background: radial-gradient(circle at top, #ffffff, var(--bg) 55%);
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-direction: column;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* ========== TOPBAR USER ACTIONS ========== */
.topbar-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-dropdown {
  position: relative;
}

.topbar-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.topbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger, #ef4444);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-user-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.topbar-username {
  font-size: 14px;
  font-weight: 500;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-arrow {
  font-size: 10px;
  color: var(--muted);
}

.topbar-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
  overflow: hidden;
}

.topbar-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Notifications Menu */
.notifications-menu {
  width: 320px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.mark-all-read-btn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
}

.mark-all-read-btn:hover {
  text-decoration: underline;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.notification-item:hover {
  background: var(--surface);
}

.notification-item.unread {
  background: rgba(var(--accent-rgb, 0, 198, 255), 0.1);
}

.notification-item.unread:hover {
  background: rgba(var(--accent-rgb, 0, 198, 255), 0.15);
}

.notification-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 11px;
  color: var(--muted);
}

.notification-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.dropdown-footer-link {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border);
}

.dropdown-footer-link:hover {
  background: var(--surface);
}

/* User Menu */
.user-menu {
  padding: 8px 0;
}

.dropdown-section {
  padding: 4px 0;
}

.dropdown-section-title {
  display: block;
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--surface);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.logout-item {
  color: var(--danger, #ef4444);
}

body[data-theme="light"] .topbar,
body[data-theme="y2k"] .topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #e2e8f0;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.search {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  justify-content: center;
}

.search input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}

.search input[name="q"] {
  min-width: 520px;
}

.search button, .search .ghost {
  background: var(--accent);
  color: #0b0f14;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.search-btn {
  min-width: 44px;
}

.sort-select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 600;
}

.search .ghost {
  background: var(--surface-2);
  color: var(--text);
}

.date-compact {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar #themeSelect {
  margin-left: auto;
}

.artist-filters {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.artist-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.artist-search-row input {
  flex: 1;
  min-width: 280px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}

.letter-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.letter-pill {
  text-decoration: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.letter-pill.active {
  background: var(--accent);
  color: #0b0f14;
  border-color: transparent;
}

.year-filter {
  display: grid;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.year-range {
  display: grid;
  gap: 6px;
}

.year-range label {
  color: var(--muted);
  font-size: 12px;
}

.year-actions {
  display: flex;
  justify-content: flex-end;
}

.artist-list {
  display: grid;
  gap: 10px;
}

.artist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.artist-row:hover {
  border-color: var(--accent);
}

.artist-row .artist-count {
  color: var(--muted);
  font-size: 12px;
}

.artist-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.artist-meta {
  color: var(--muted);
  margin-bottom: 16px;
}

.pill {
  background: var(--surface-2);
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.pill.icon-only {
  padding: 8px;
  min-width: 36px;
  text-align: center;
}

.profile-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill.active {
  background: var(--accent);
  color: #0b0f14;
}

.content {
  padding: 24px;
  padding-bottom: 160px;
}

.hero {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.1), #1f2937, #0b0f14);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 28px;
  border: 1px solid rgba(29, 185, 84, 0.2);
  position: relative;
  overflow: hidden;
}

/* Safety net: force content visible after 1.5s in case anime.js sets opacity:0 */
@keyframes forceVisible {
  to { opacity: 1 !important; }
}
.hero,
.album-card,
.sidebar-link {
  animation: forceVisible 0s 1.5s both;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.15), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
}

body[data-theme="light"] .hero,
body[data-theme="y2k"] .hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), #ffffff, var(--surface));
  border-color: rgba(37, 99, 235, 0.2);
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

body[data-view="compact"] .albums-grid {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

body[data-view="minimal"] .albums-grid {
  grid-template-columns: 1fr;
}

body[data-view="covers"] .albums-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

 .album-card.cover-only {
  display: none;
}

body[data-view="covers"] .album-card:not(.cover-only) {
  display: none;
}

body[data-view="covers"] .album-card.cover-only {
  display: flex;
}

body[data-view="covers"] .album-card.cover-only .album-body {
  padding-top: 6px;
}

body[data-view="list"] .albums-grid {
  grid-template-columns: 1fr;
}

body[data-view="list"] .album-cover-wrap {
  display: none;
}

body[data-view="list"] .album-body h2 {
  display: block;
  font-size: 16px;
  margin: 0;
}

body[data-view="list"] .sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

body[data-view="list"] .album-actions,
body[data-view="list"] .download-album,
body[data-view="list"] .progress,
body[data-view="list"] .track-file,
body[data-view="list"] .track-count,
body[data-view="list"] .track-likes,
body[data-view="list"] .track-wave,
body[data-view="list"] .track-progress,
body[data-view="list"] .track-like,
body[data-view="list"] .track-add,
body[data-view="list"] .track-download,
body[data-view="list"] .track-status {
  display: none !important;
}

body[data-view="list"] .album-card {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--border);
}

body[data-view="list"] .album-body {
  gap: 6px;
}

body[data-view="list"] .track-details {
  border: none;
  background: transparent;
  padding: 0;
}

body[data-view="list"] .track-details {
  display: none;
}

body[data-view="list"] .album-card.list-tracks-open .track-details {
  display: block;
}

body[data-view="list"] .album-card.list-tracks-open .tracklist {
  padding-top: 6px;
}

body[data-view="list"] .album-card.list-tracks-open .track-row {
  grid-template-columns: 24px 1fr;
  padding: 4px 6px;
}

body[data-view="list"] .track-details summary {
  display: none;
}

body[data-view="list"] .tracklist {
  gap: 0;
}

body[data-view="list"] .track-row {
  grid-template-columns: 28px 1fr;
  padding: 6px 8px;
  border-left: none;
  border-right: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

body[data-view="list"] .track-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.track-info {
  cursor: pointer;
}

.track-info:hover .track-title {
  color: var(--accent);
}

body[data-view="grid"] .albums-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

body[data-view="grid"] .album-card {
  padding: 12px;
  gap: 8px;
}

body[data-view="grid"] .sub {
  display: none;
}

body[data-view="grid"] .album-actions,
body[data-view="grid"] .download-album,
body[data-view="grid"] .progress,
body[data-view="grid"] .track-details {
  display: none;
}

body[data-view="madsonic"] .albums-grid {
  grid-template-columns: 1fr;
}

body[data-view="madsonic"] .album-card {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

body[data-view="madsonic"] .album-cover {
  width: 200px;
  aspect-ratio: 1 / 1;
}

body[data-view="madsonic"] .track-row {
  grid-template-columns: 36px 1fr;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 10px 12px;
}

body[data-view="madsonic"] .tracklist {
  gap: 0;
}

body[data-view="madsonic"] .track-details {
  background: transparent;
  border: none;
  padding: 0;
}

.album-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(29, 185, 84, 0.3);
}

body[data-view="minimal"] .album-card {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

body[data-view="minimal"] .album-cover-wrap {
  width: 88px;
  min-width: 88px;
}

body[data-view="minimal"] .album-cover {
  border-radius: 8px;
  box-shadow: none;
}

body[data-view="minimal"] .play-album {
  padding: 6px 10px;
  font-size: 12px;
  bottom: 8px;
}

body[data-view="minimal"] .sub,
body[data-view="minimal"] .album-actions,
body[data-view="minimal"] .album-stats,
body[data-view="minimal"] .album-download-row,
body[data-view="minimal"] .download-album,
body[data-view="minimal"] .progress {
  display: none;
}

body[data-view="minimal"] .album-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

body[data-view="minimal"] .album-title {
  margin-bottom: 8px;
}

body[data-view="minimal"] .track-details {
  background: transparent;
  border: none;
  padding: 0;
}

body[data-view="minimal"] .track-details summary {
  display: none;
}

body[data-view="minimal"] .tracklist {
  gap: 0;
}

body[data-view="minimal"] .track-row {
  grid-template-columns: 30px 1fr;
  padding: 6px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  align-items: center;
}

body[data-view="minimal"] .track-play {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  border-radius: 50%;
}

body[data-view="minimal"] .track-info {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 10px;
  gap: 0;
  min-width: 0;
}

body[data-view="minimal"] .track-title {
  font-size: 13px;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

body[data-view="compact"] .album-card {
  padding: 12px;
  gap: 8px;
}

body[data-view="compact"] .album-body {
  gap: 8px;
}

body[data-view="compact"] .sub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-size: 12px;
  margin-bottom: 10px;
}

body[data-view="compact"] .sub span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-view="compact"] .btn {
  width: 100%;
}

.album-cover-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: block;
  text-decoration: none;
  color: inherit;
}

a.album-cover-wrap:hover {
  text-decoration: none;
}

.album-cover-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.album-cover-wrap:hover::after {
  opacity: 1;
}

.album-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), filter var(--transition);
}

.album-cover-wrap:hover .album-cover {
  transform: scale(1.02);
}

.play-album {
  position: absolute;
  bottom: 16px;
  right: 16px;
  left: auto;
  transform: translateY(10px);
  opacity: 0;
  border: none;
  background: var(--accent);
  color: #0b0f14;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(29, 185, 84, 0.4);
  transition: all var(--transition);
  z-index: 2;
}

.album-cover-wrap:hover .play-album {
  opacity: 1;
  transform: translateY(0);
}

.play-album:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 12px 32px rgba(29, 185, 84, 0.5);
}

.album-body h2 {
  margin: 0 0 6px;
}

.album-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.album-title-toggle {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-fast);
}

.album-title-toggle:hover {
  color: var(--accent);
}

.sub {
  display: flex;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 12px;
}

.scan-progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.scan-progress.is-paused {
  background: #3b2f0b;
}

.scan-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #1ed760);
}

.scan-progress.is-paused .scan-progress-bar {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.scan-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-small:hover {
  transform: scale(1.05);
}

.btn-warn {
  background: #f59e0b;
  color: #000;
}

.btn-warn:hover {
  background: #fbbf24;
}

.btn-success {
  background: #22c55e;
  color: #fff;
}

.btn-success:hover {
  background: #4ade80;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #f87171;
}

.btn-muted {
  background: var(--surface-3);
  color: var(--muted);
}

.btn-muted:hover {
  background: var(--surface-2);
  color: var(--text);
}

.admin-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.album-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.like-album {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.like-album:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.05);
}

.like-album[aria-pressed="true"] {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.like-album[aria-pressed="true"]:hover {
  transform: scale(1.05);
}

.album-body {
  display: grid;
  gap: 12px;
}

.btn {
  background: linear-gradient(135deg, var(--accent), #1ed760);
  border: none;
  color: #0b0f14;
  border-radius: 12px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(29, 185, 84, 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.download-album {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-album::before {
  content: '⬇';
  font-size: 16px;
}

.tracklist {
  display: grid;
  gap: 6px;
}

.track-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color var(--transition-fast);
}

.track-details:hover {
  border-color: rgba(29, 185, 84, 0.3);
}

.track-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-details summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--muted);
  transition: transform var(--transition-fast);
}

.track-details[open] summary::before {
  transform: rotate(90deg);
}

.track-details summary::-webkit-details-marker {
  display: none;
}

.track-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

body[data-view="compact"] .track-row {
  padding: 10px 14px;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  border-radius: 12px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

body[data-view="compact"] .track-row:hover {
  background: var(--surface-2);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

body[data-view="compact"] .track-info {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  min-width: 0;
}

body[data-view="compact"] .track-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  margin-top: 0;
  gap: 10px;
}

body[data-view="compact"] .track-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body[data-view="compact"] .track-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

body[data-view="compact"] .track-file {
  display: none;
}

body[data-view="minimal"] .track-file,
body[data-view="minimal"] .track-count,
body[data-view="minimal"] .track-likes {
  display: none;
}

body[data-view="minimal"] .track-wave,
body[data-view="minimal"] .track-progress {
  display: none;
}

body[data-view="compact"] .track-play,
body[data-view="compact"] .track-like,
body[data-view="compact"] .track-add,
body[data-view="compact"] .track-download button,
body[data-view="compact"] .track-download-btn {
  padding: 8px 10px;
  font-size: 14px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all var(--transition-fast);
}

body[data-view="compact"] .track-play:hover,
body[data-view="compact"] .track-like:hover,
body[data-view="compact"] .track-add:hover,
body[data-view="compact"] .track-download-btn:hover {
  background: var(--accent);
  color: #0b0f14;
  transform: scale(1.08);
}

.track-row.simple {
  grid-template-columns: 1fr;
}

.track-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

body[data-view="minimal"] .track-actions {
  justify-content: flex-end;
  margin-top: 0;
  gap: 6px;
  height: 22px;
  flex-wrap: nowrap;
}

body[data-view="minimal"] .track-play,
body[data-view="minimal"] .track-like,
body[data-view="minimal"] .track-add,
body[data-view="minimal"] .track-download-btn {
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 6px;
  line-height: 14px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body[data-view="compact"] .track-actions,
body[data-view="minimal"] .track-actions {
  gap: 8px;
}

.track-file {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-count {
  color: var(--muted);
  font-size: 11px;
}

.track-status {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.track-status.is-downloading {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--download-pct, 0%), var(--surface-2) 0);
  color: #0b0f14;
  font-weight: 600;
  margin-top: 6px;
}

body[data-view="minimal"] .track-status {
  margin-top: 4px;
}

.track-likes {
  color: var(--muted);
  font-size: 11px;
}

.track-wave {
  display: grid;
  grid-auto-flow: column;
  gap: 2px;
  height: 30px;
  align-items: end;
  cursor: pointer;
}

body[data-view="compact"] .track-wave {
  height: 48px;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}

body[data-view="compact"] .track-row:hover .track-wave {
  opacity: 1;
}

body[data-view="minimal"] .track-wave {
  height: 40px;
}

body[data-view="compact"] .track-progress {
  height: 6px;
  border-radius: 3px;
}

body[data-view="minimal"] .track-progress {
  height: 8px;
}

.track-wave span {
  width: 3px;
  background: linear-gradient(180deg, var(--muted), var(--surface-2));
  border-radius: 2px 2px 0 0;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.track-wave:hover span {
  background: linear-gradient(180deg, var(--accent), var(--surface-2));
}

.track-row.active .track-wave span {
  background: linear-gradient(180deg, var(--accent), #0ea5e9);
  animation: wave-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes wave-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.track-progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.track-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transition: width 0.1s linear;
}

.track-play {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.track-play:hover {
  background: var(--accent);
  color: #0b0f14;
  transform: scale(1.1);
  box-shadow: var(--glow);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(29, 185, 84, 0.4); }
  50% { box-shadow: 0 0 20px rgba(29, 185, 84, 0.7); }
}

body[data-view="minimal"] .track-play,
body[data-view="minimal"] .track-like,
body[data-view="minimal"] .track-add,
body[data-view="minimal"] .track-download-btn {
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 6px;
}

.track-row.active .track-play {
  background: var(--accent);
  color: #0b0f14;
  animation: pulse-glow 2s ease-in-out infinite;
}

.track-row.active {
  background: rgba(29, 185, 84, 0.08);
  border-color: rgba(29, 185, 84, 0.3);
}

.track-like {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.track-like:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.1);
}

.track-add {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.track-add:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f14;
  border-style: solid;
  transform: scale(1.1);
}

.track-like[aria-pressed="true"] {
  background: var(--accent);
  color: #0b0f14;
}

.track-download button {
  background: var(--surface-2);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.track-download-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.track-download-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f14;
  transform: scale(1.1);
}

body[data-view="list"] .track-actions,
body[data-view="list"] .track-wave,
body[data-view="list"] .track-progress {
  display: none !important;
}

.progress {
  position: relative;
  height: 16px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 0.3s ease;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.progress-label .pct {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.admin {
  margin-top: 30px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.admin-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  display: grid;
  gap: 8px;
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-toggle input {
  accent-color: var(--accent);
}

.admin-card input, .admin-card button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.admin-card button {
  background: var(--accent);
  color: #0b0f14;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.admin-result {
  color: var(--muted);
  font-size: 13px;
}

.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(15, 21, 32, 0.95), var(--surface));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) auto auto minmax(120px, 0.5fr) minmax(200px, 2fr);
  gap: 20px;
  align-items: center;
  z-index: 100;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.now-playing img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.now-playing:hover img {
  transform: scale(1.05);
}

.now-playing > div {
  min-width: 0;
  overflow: hidden;
}

#playerTitle {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.controls button {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.controls button:hover {
  background: var(--accent);
  color: #0b0f14;
  transform: scale(1.08);
}

#playPauseBtn {
  width: 48px;
  height: 48px;
  font-size: 18px;
  background: var(--accent);
  color: #0b0f14;
}

#playPauseBtn:hover {
  transform: scale(1.1);
  box-shadow: var(--glow);
}

/* Pulse animation when autoplay is blocked */
@keyframes pulse-attention {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent); }
  50% { transform: scale(1.15); box-shadow: 0 0 20px 5px var(--accent); }
}

#playPauseBtn.pulse-attention {
  animation: pulse-attention 0.6s ease-in-out 3;
}

/* SPA loading indicator */
body.spa-loading .content {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
body.spa-loading::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: spa-progress 0.8s ease-in-out infinite;
  z-index: 9999;
}
@keyframes spa-progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.volume-control button {
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.volume-control button:hover {
  background: var(--surface-2);
  transform: scale(1.1);
}

.volume-control input[type="range"] {
  width: 100px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface-2);
  border-radius: 3px;
  cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.progress-wrap {
  background: var(--surface-2);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  flex: 1;
  transition: height var(--transition-fast);
}

.progress-wrap:hover {
  height: 8px;
}

.progress-wrap .progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transition: width 0.1s linear;
}

.player-progress {
  display: flex;
  gap: 12px;
  align-items: center;
}

.progress-time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

.progress-time.current {
  text-align: right;
}

.progress-time.duration {
  text-align: left;
}

.progress-percent {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  min-width: 38px;
  text-align: right;
}

.player-album-btn {
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
}

.player-album-btn #playerAlbum {
  color: var(--text);
  font-weight: 600;
}

.player-queue {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: min(420px, 92vw);
  max-height: 60vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  display: none;
  grid-template-rows: auto 1fr auto;
  z-index: 30;
}

.player-queue.active {
  display: grid;
}

.player-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.player-queue-header button {
  background: var(--surface-2);
  border: none;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.player-queue-body {
  overflow: auto;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.queue-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
}

.queue-row:hover {
  background: var(--surface-2);
}

.queue-row.active {
  border-color: var(--accent);
  background: rgba(29, 185, 84, 0.15);
}

.queue-row .queue-index {
  color: var(--muted);
  font-size: 12px;
}

.queue-row .queue-title {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-queue-actions {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.player-queue-actions button {
  background: var(--accent);
  border: none;
  color: #0b0f14;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}

/* Player Actions (like, playlist) */
.player-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.player-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-action-btn:hover {
  background: var(--surface-2);
  transform: scale(1.1);
}

.player-action-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f14;
}

.album-card.highlight {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(29, 185, 84, 0.2);
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.pagination {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin: 20px 0 40px;
}

.pagination a {
  color: #0b0f14;
  background: var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.pagination span {
  color: var(--muted);
}

.artist-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  display: grid;
  gap: 0;
}

.artist-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: none;
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.artist-header .artist-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.artist-body {
  display: none;
  gap: 16px;
  padding: 16px;
}

.albums-grid[data-grouped="true"] {
  grid-template-columns: 1fr;
}

.artist-body {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

body[data-view="compact"] .artist-body {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

body[data-view="minimal"] .artist-body,
body[data-view="list"] .artist-body,
body[data-view="madsonic"] .artist-body {
  grid-template-columns: 1fr;
}

body[data-view="covers"] .artist-body,
body[data-view="grid"] .artist-body {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.artist-group.is-open .artist-body {
  display: grid;
}

/* ========== PROFILE PAGE ========== */
.profile-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  overflow-x: hidden;
}

.profile-banner {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  margin-bottom: -60px;
  position: relative;
  overflow: hidden;
}

.banner-upload-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.profile-banner:hover .banner-upload-overlay,
.banner-upload-overlay:hover {
  opacity: 1;
}

.banner-upload-icon {
  font-size: 16px;
}

.profile-header {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 20px 20px;
  position: relative;
  z-index: 1;
}

.profile-avatar-container {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.profile-avatar-container:hover .avatar-upload-overlay {
  opacity: 1;
}

.avatar-upload-icon {
  font-size: 24px;
}

.avatar-upload-text {
  font-size: 11px;
  color: #fff;
}

.profile-info {
  flex: 1;
  padding-bottom: 8px;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-badge {
  background: var(--accent);
  color: #0b0f14;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.profile-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.admin-link {
  color: var(--accent);
  font-size: 14px;
  margin-top: 8px;
  display: inline-block;
}

.profile-content {
  display: grid;
  gap: 24px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  font-size: 20px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.profile-form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.profile-form button {
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0b0f14;
  font-weight: 700;
  cursor: pointer;
}

.profile-status {
  font-size: 12px;
  color: var(--muted);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.profile-row strong {
  color: var(--text);
}

.profile-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.profile-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.profile-item .mini-btn {
  margin-left: auto;
}

.profile-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}

.profile-title {
  font-weight: 700;
}

.profile-meta {
  color: var(--muted);
  font-size: 12px;
}

.profile-table {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.profile-track {
  align-items: center;
}

.profile-section .profile-track {
  grid-template-columns: 28px 1fr;
}

.profile-track .track-play {
  justify-self: start;
  margin-right: 8px;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.see-all {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.see-all:hover {
  color: var(--accent);
}

/* Albums Preview Grid (Profile Page) */
.albums-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  overflow: hidden;
}

.album-preview-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.album-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.album-preview-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
}

.album-preview-title {
  padding: 8px 8px 2px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-preview-artist {
  padding: 0 8px 8px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Playlists Preview */
.playlists-preview {
  display: grid;
  gap: 8px;
}

.playlist-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.playlist-icon {
  font-size: 20px;
}

.playlist-preview-name {
  font-size: 13px;
  font-weight: 600;
}

.playlist-preview-count {
  font-size: 11px;
  color: var(--muted);
}

/* History Preview */
.history-preview {
  display: grid;
  gap: 8px;
}

.history-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.history-preview-row img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.history-preview-title {
  font-size: 13px;
  font-weight: 500;
}

.history-preview-artist {
  font-size: 11px;
  color: var(--muted);
}

/* Empty State Hint */
.empty-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
  text-align: center;
}

/* Profile Sections Container */
.profile-sections {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.playlist-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.playlist-tracks {
  margin: 6px 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: none;
  gap: 6px;
}

.playlist-tracks.active {
  display: grid;
}

.mini-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.mini-btn.primary {
  background: var(--accent);
  color: #0b0f14;
  border: none;
}

/* Playlist track rows — compact layout with select-and-move + drag */
.playlist-track-row .track-play {
  padding: 2px 4px;
  font-size: 11px;
}

.playlist-track-row.dragging {
  opacity: 0.4;
}

.playlist-track-row.drag-over {
  border-left-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.playlist-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 150;
}

.playlist-modal.active {
  display: flex;
}

.playlist-modal-content {
  width: min(420px, 90vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.playlist-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.playlist-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.playlist-modal-close {
  background: var(--surface-2);
  border: none;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.playlist-modal-close:hover {
  background: var(--surface-alt);
}

.playlist-modal-body {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-modal-body .loading,
.playlist-modal-body .empty,
.playlist-modal-body .error {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

.playlist-modal-body .error {
  color: var(--error, #ff6b6b);
}

.playlist-modal-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.playlist-modal-footer input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.playlist-modal-footer button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0b0f14;
  cursor: pointer;
  font-weight: 500;
}

.playlist-dialog {
  width: min(420px, 90vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.playlist-body {
  display: grid;
  gap: 10px;
}

.playlist-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.playlist-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.playlist-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.playlist-create input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.playlist-create button,
.playlist-close {
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0b0f14;
  cursor: pointer;
}

.playlist-close {
  background: var(--surface-2);
  color: var(--text);
}

.playlist-status {
  color: var(--muted);
  font-size: 12px;
}

.login-content {
  display: grid;
  gap: 20px;
}

.login-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.login-actions {
  display: flex;
  gap: 10px;
}

.login-actions button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0b0f14;
  font-weight: 700;
  cursor: pointer;
}

.login-actions .ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.login-error {
  background: rgba(255, 77, 77, 0.15);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 77, 77, 0.3);
  margin-bottom: 10px;
  font-size: 13px;
}

@media (max-width: 960px) {
  .album-card {
    grid-template-columns: 1fr;
  }
  .player {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: sticky;
    left: 0;
    right: 0;
    top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  
  /* Topbar User Actions Mobile */
  .topbar-user-actions {
    gap: 6px;
  }
  
  .topbar-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .topbar-user-btn {
    padding: 4px 8px 4px 4px;
  }
  
  .topbar-username {
    display: none;
  }
  
  .dropdown-arrow {
    display: none;
  }
  
  .topbar-avatar {
    width: 28px;
    height: 28px;
  }
  
  .topbar-dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    transform: translateY(100%);
  }
  
  .topbar-dropdown-menu.active {
    transform: translateY(0);
  }
  
  .notifications-menu {
    width: 100%;
  }

  .content {
    padding: 12px;
    padding-top: 10px;
    padding-bottom: 180px;
  }

  .search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .search input[name="q"] {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-size: 15px;
  }

  .search-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide date pickers and sort on mobile */
  .date-input,
  .date-compact,
  .sort-select,
  .search .ghost {
    display: none !important;
  }

  .toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .artist-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .year-actions {
    justify-content: stretch;
  }

  .player-queue {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 160px;
    max-height: 50vh;
  }

  .view-switch {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .view-switch::-webkit-scrollbar {
    display: none;
  }

  .albums-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pill {
    padding: 8px 12px;
    font-size: 13px;
  }

  #themeSelect {
    padding: 8px 12px;
    font-size: 13px;
  }

  body[data-view="compact"] .sub {
    grid-template-columns: 1fr 1fr;
  }

  /* Mobile track buttons - larger touch targets */
  .track-play,
  .track-like,
  .track-add,
  .track-download-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 18px;
  }

  .like-album {
    padding: 10px 14px;
    font-size: 15px;
  }

  /* Mobile player improvements */
  .player {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 14px 16px 20px;
  }

  .now-playing {
    justify-content: flex-start;
  }

  .now-playing img {
    width: 48px;
    height: 48px;
  }

  #playerTitle {
    font-size: 13px;
  }

  .controls {
    order: -1;
    justify-content: center;
    gap: 12px;
  }

  .controls button {
    width: 44px;
    height: 44px;
  }

  #playPauseBtn {
    width: 52px;
    height: 52px;
  }

  .volume-control {
    display: none;
  }

  .player-actions {
    display: none;
  }

  .player-progress {
    gap: 10px;
  }

  .progress-time {
    font-size: 11px;
    min-width: 36px;
  }

  body[data-view="compact"] .track-row,
  body[data-view="minimal"] .track-row,
  body[data-view="madsonic"] .track-row {
    grid-template-columns: 48px 1fr;
    padding: 12px;
    gap: 14px;
  }

  body[data-view="compact"] .track-title {
    font-size: 15px;
  }

  body[data-view="madsonic"] .album-card {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-view="madsonic"] .album-cover {
    width: 100%;
    max-width: 240px;
    align-self: center;
  }

  /* Hide progress percent on mobile, show times */
  .progress-percent {
    display: none;
  }

  /* Sidebar mobile */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.is-open {
    display: block;
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  /* Download panel mobile */
  .download-panel {
    left: 8px;
    right: 8px;
    bottom: 170px;
    width: auto;
  }

  /* Profile Page Mobile */
  .profile-page {
    padding: 0 12px 40px;
  }

  .profile-banner {
    height: 140px;
    margin-bottom: -50px;
    border-radius: 12px;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 12px 16px;
    gap: 12px;
  }

  .profile-avatar-img {
    width: 90px;
    height: 90px;
  }

  .profile-name {
    font-size: 20px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
    text-align: center;
  }

  .stat-value {
    font-size: 18px;
    font-weight: 700;
    display: block;
  }

  .stat-label {
    font-size: 11px;
  }

  /* Albums Preview Mobile - 2 columns with smaller cards */
  .albums-preview {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .album-preview-card img {
    aspect-ratio: 1;
  }

  .album-preview-title {
    font-size: 11px;
    padding: 6px 6px 2px;
  }

  .album-preview-artist {
    font-size: 10px;
    padding: 0 6px 6px;
  }

  .profile-section {
    padding: 12px;
    border-radius: 12px;
  }

  .section-header h2 {
    font-size: 14px;
  }

  .see-all {
    font-size: 12px;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .topbar {
    padding: 8px 10px;
  }

  .content {
    padding: 10px;
    padding-bottom: 190px;
  }

  .album-card {
    padding: 12px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .track-details {
    padding: 10px;
  }

  /* Profile Extra Small */
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .albums-preview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .album-preview-card {
    border-radius: 8px;
  }

  .album-preview-title {
    font-size: 10px;
    padding: 5px 5px 2px;
  }

  .album-preview-artist {
    font-size: 9px;
    padding: 0 5px 5px;
  }

  .profile-section {
    padding: 10px;
  }

  .section-header h2 {
    font-size: 13px;
  }

  .history-preview-row img {
    width: 32px;
    height: 32px;
  }

  .history-preview-title {
    font-size: 12px;
  }

  .history-preview-artist {
    font-size: 10px;
  }
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section {
  padding: 8px 12px;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--surface);
}

.sidebar-link.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-shadow: 0 0 1px var(--bg);
}

/* Dark theme override for active sidebar link */
[data-theme="dark"] .sidebar-link.active {
  color: #0a0e12;
  text-shadow: none;
}

.sidebar-link .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 55;
  display: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
}

.main-wrap {
  margin-left: 220px;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ========== DOWNLOAD PANEL ========== */
.download-panel {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 360px;
  max-height: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.download-panel.is-open {
  display: flex;
}

.download-panel.is-minimized {
  max-height: 48px;
  overflow: hidden;
}

.download-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.download-panel-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-panel-title .count {
  background: var(--accent);
  color: #0b0f14;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
}

.download-panel-actions {
  display: flex;
  gap: 6px;
}

.download-panel-actions button {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.download-panel-actions button:hover {
  color: var(--text);
}

.download-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.download-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 6px;
}

.download-item-info {
  min-width: 0;
}

.download-item-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-item-status {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.download-item-progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.download-item-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.download-item-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
}

/* ========== SHARE & SOCIAL ========== */
.share-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}

.copy-link-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.copy-link-btn:hover {
  background: var(--accent);
  color: #0b0f14;
  border-color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: all var(--transition);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== PLAYLIST MODAL FIX ========== */
.playlist-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.playlist-item-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.playlist-item-btn span:first-child {
  font-weight: 500;
}

.playlist-item-btn span:last-child {
  color: var(--muted);
  font-size: 12px;
}

/* ========== COUNTERS SOCIAL ========== */
.album-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.stat-badge .icon {
  font-size: 14px;
}

.play-count {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Add album to playlist */
.add-album-playlist {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.add-album-playlist:hover {
  background: var(--accent);
  color: #0b0f14;
  border-style: solid;
  border-color: var(--accent);
}

/* ========== MOBILE FIXES ========== */
@media (max-width: 720px) {
  /* Ensure sidebar is hidden properly */
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    z-index: 150;
  }
  
  .sidebar.is-open {
    transform: translateX(0);
  }
  
  /* Main content takes full width */
  .main-wrap {
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* Topbar improvements */
  .topbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .menu-toggle {
    display: flex !important;
    order: -1;
  }
  
  /* Search form mobile */
  .search {
    flex: 1;
    min-width: 0;
  }
  
  .search input[name="q"] {
    width: 100%;
  }
  
  /* Album cards on mobile */
  .album-card {
    padding: 14px;
  }
  
  .album-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .album-cover {
    width: 100%;
    max-width: 200px;
    align-self: center;
  }
  
  .album-info {
    width: 100%;
  }
  
  .album-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .album-download-row {
    flex-wrap: wrap;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  /* Player mobile layout */
  .player {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 16px;
  }
  
  .now-playing {
    width: 100%;
    justify-content: flex-start;
  }
  
  .player-controls {
    width: 100%;
    justify-content: center;
    gap: 16px;
  }
  
  .player-controls button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  #playPauseBtn {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }
  
  .player-volume,
  .player-actions {
    display: none !important;
  }
  
  .player-progress {
    width: 100%;
    order: 3;
  }
  
  /* Track rows mobile */
  .track-row {
    padding: 10px 12px !important;
  }
  
  .track-controls {
    gap: 8px;
  }
  
  .track-controls button {
    min-width: 38px;
    min-height: 38px;
  }
  
  /* Queue panel mobile */
  .player-queue {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    bottom: 150px !important;
  }
  
  .queue-row {
    padding: 8px 10px;
  }
  
  /* Download panel mobile */
  .download-panel {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    bottom: 155px !important;
  }
  
  /* Modal mobile */
  .playlist-modal-content {
    width: 90%;
    max-width: 320px;
    padding: 20px;
  }
  
  /* ========== MINIMAL VIEW MOBILE FIX ========== */
  body[data-view="minimal"] .track-row {
    grid-template-columns: 1fr;
    padding: 8px 0;
  }
  
  body[data-view="minimal"] .track-num {
    display: none;
  }
  
  body[data-view="minimal"] .track-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  body[data-view="minimal"] .track-title {
    font-size: 14px;
    line-height: 1.3;
    max-width: 100%;
  }
  
  body[data-view="minimal"] .track-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-start;
    margin-top: 0;
  }
  
  body[data-view="minimal"] .track-play,
  body[data-view="minimal"] .track-like,
  body[data-view="minimal"] .track-add,
  body[data-view="minimal"] .track-download-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
    min-width: unset !important;
    min-height: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
  }
  
  body[data-view="minimal"] .track-play i,
  body[data-view="minimal"] .track-like i,
  body[data-view="minimal"] .track-add i,
  body[data-view="minimal"] .track-download-btn i {
    font-size: 12px;
  }
}

/* Tablet adjustments */
@media (min-width: 721px) and (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }
  
  .main-wrap {
    margin-left: 200px;
  }
  
  .player {
    grid-template-columns: minmax(140px, 1fr) auto auto minmax(100px, 0.5fr) minmax(180px, 1.5fr);
    gap: 16px;
    padding: 12px 20px;
  }
}

/* ========================== */
/* CYBERPUNK ANIMATIONS       */
/* ========================== */

/* Cyber scanline effect */
.cyber-scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* Neon glow effects */
.neon-glow {
  box-shadow: 0 0 10px var(--neon-cyan),
              0 0 20px var(--neon-cyan),
              0 0 40px rgba(5, 217, 232, 0.3);
}

.neon-glow-pink {
  box-shadow: 0 0 10px var(--neon-pink),
              0 0 20px var(--neon-pink),
              0 0 40px rgba(255, 42, 109, 0.3);
}

/* Glitch text effect */
.glitching {
  animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); filter: hue-rotate(0deg); }
  20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -2px); filter: hue-rotate(180deg); }
  60% { transform: translate(-1px, -1px); filter: hue-rotate(270deg); }
  80% { transform: translate(1px, 1px); filter: hue-rotate(360deg); }
}

/* Heart burst particles */
.heart-particle {
  position: absolute;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  text-shadow: 0 0 10px var(--neon-pink);
}

/* Cyber button hover effects */
.btn:hover,
button:hover,
.album-card:hover,
.track-row:hover {
  box-shadow: 0 0 15px var(--neon-glow);
}

/* CRT flicker animation */
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
  51% { opacity: 1; }
  52% { opacity: 0.97; }
}

.crt-flicker {
  animation: crt-flicker 0.1s infinite;
}

/* Neon text glow */
.neon-text {
  text-shadow: 0 0 5px var(--neon-cyan),
               0 0 10px var(--neon-cyan),
               0 0 20px var(--neon-cyan);
}

.neon-text-pink {
  text-shadow: 0 0 5px var(--neon-pink),
               0 0 10px var(--neon-pink),
               0 0 20px var(--neon-pink);
}

/* Pulse animation for playing indicator */
@keyframes neon-pulse {
  0%, 100% { 
    box-shadow: 0 0 5px var(--neon-cyan);
    opacity: 1;
  }
  50% { 
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
    opacity: 0.8;
  }
}

.playing-glow {
  animation: neon-pulse 1.5s ease-in-out infinite;
}

/* Grid line overlay (optional) */
.cyber-grid::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(rgba(5, 217, 232, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 217, 232, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

/* Accent color updates for cyberpunk theme */
.accent-glow {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-glow);
}

/* Toast notification cyber style */
.toast {
  border-left: 3px solid var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-glow), var(--shadow-md);
}

/* Input focus cyber glow */
input:focus,
textarea:focus,
select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-glow);
}

/* Sidebar nav hover */
.nav-link:hover,
.nav-link.active {
  background: linear-gradient(90deg, rgba(5, 217, 232, 0.1), transparent);
  border-left: 3px solid var(--neon-cyan);
}

/* Player cyberpunk style */
.player {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
  border-top: 1px solid var(--neon-cyan);
  box-shadow: 0 -5px 30px rgba(5, 217, 232, 0.1);
}
