/* ============================================
   MUSIV — style.css (Professional Refined)
   ============================================ */

/* ---------- Variables ---------- */
:root {
  --primary: #1587c9;
  --primary-light: #40a9e8;
  --primary-glow: rgba(21, 135, 201, 0.35);
  --bg: #0c1118;
  --bg-card: #141c27;
  --bg-sidebar: #0f1722;
  --bg-player: rgba(10, 14, 22, 0.96);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-1: #f0f4f8;
  --text-2: #8fa3b1;
  --text-3: #4e6070;
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
  --sidebar-w: 240px;
  --player-h: 82px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --trans: 0.2s var(--ease);
  --dyn: #1587c9;
  --dyn-soft: rgba(21, 135, 201, 0.2);
}

/* Light theme */
body.light-theme {
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-sidebar: #f0f2f5;
  --bg-player: rgba(240, 242, 245, 0.97);
  --surface: rgba(0, 0, 0, 0.05);
  --surface-hover: rgba(0, 0, 0, 0.09);
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.15);
  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select {
  font-family: inherit;
}

img {
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJmIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjc0IiBudW1PY3RhdmVzPSIzIiAvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNmKSIgb3BhY2l0eT0iMC4wMjUiIC8+PC9zdmc+');
  pointer-events: none;
  opacity: 0.25;
  z-index: 1;
}

/* ---------- Background Cover ---------- */
#background-cover {
  position: fixed;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(50px) brightness(0.2) saturate(1.8);
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease), background-image 1.2s var(--ease);
  pointer-events: none;
}
#background-cover.active {
  opacity: 1;
}

/* ---------- Loading Screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.5s var(--ease);
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.ls-inner {
  text-align: center;
}

.ls-logo {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow-pulse 2s ease-in-out infinite alternate;
}
.ls-logo-m {
  /* Special styling for the first letter if needed */
}

@keyframes glow-pulse {
  from {
    filter: drop-shadow(0 0 8px rgba(21, 135, 201, 0.3));
  }
  to {
    filter: drop-shadow(0 0 24px rgba(21, 135, 201, 0.7));
  }
}

.ls-bar-track {
  width: 220px;
  height: 3px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  margin: 1.5rem auto 0.5rem;
}
.ls-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 99px;
  animation: load-fill 2.2s ease-in-out forwards;
}
@keyframes load-fill {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
.ls-sub {
  font-size: 0.85rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* ---------- Notifications ---------- */
#notification-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.notification {
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s var(--ease);
  pointer-events: auto;
  max-width: 320px;
}
.notification.show {
  opacity: 1;
  transform: translateX(0);
}
.notification.success {
  border-left: 3px solid var(--success);
}
.notification.error {
  border-left: 3px solid var(--error);
}
.notification.info {
  border-left: 3px solid var(--primary);
}

/* ---------- Layout ---------- */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ---------- Sidebar ---------- */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform var(--trans);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: calc(var(--player-h) + 1rem);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-brand-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.sidebar-brand-txt {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-section-label {
  padding: 1rem 1.25rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0.75rem;
  flex: 1;
}
.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--trans);
  cursor: pointer;
}
.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: var(--trans);
}
.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}
.sidebar-link:hover svg {
  opacity: 1;
}
.sidebar-link.active {
  background: var(--dyn-soft);
  color: var(--dyn);
}
.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-bottom {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.sidebar-footer {
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: center;
  padding: 0.75rem 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.kbd-hint-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
}
.kbd-hint-btn:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}

/* Sidebar overlay (mobile) */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 190;
}
#sidebar-overlay.active {
  display: block;
}

/* ---------- Main Content ---------- */
#main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(var(--player-h) + 1.5rem);
  transition: margin-left var(--trans);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  background: rgba(12, 17, 24, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  background: var(--surface);
  transition: var(--trans);
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}
.icon-btn.sm {
  width: 28px;
  height: 28px;
}

.search-bar {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.search-icon-el {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 0.92rem;
  transition: var(--trans);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(21, 135, 201, 0.08);
}
.search-bar input::placeholder {
  color: var(--text-3);
}
.search-shortcut {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: var(--text-3);
  pointer-events: none;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Section Area ---------- */
#section-area {
  padding: 2rem;
  flex: 1;
}

.section-header {
  margin-bottom: 1.75rem;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-1);
}
.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-top: 0.25rem;
}

/* ---------- Music Cards Grid ---------- */
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.music-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  position: relative;
}
.music-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.music-card.playing {
  border-color: var(--dyn);
  box-shadow: 0 0 0 1px var(--dyn), 0 12px 32px var(--dyn-soft);
}

.music-card-cover {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}
.music-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.music-card:hover .music-card-cover img {
  transform: scale(1.05);
}

/* Play overlay on hover */
.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.music-card:hover .card-play-overlay {
  opacity: 1;
}
.card-play-overlay svg {
  width: 40px;
  height: 40px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Playing indicator */
.now-playing-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dyn);
  animation: dot-pulse 1.5s ease-in-out infinite;
  display: none;
}
.music-card.playing .now-playing-dot {
  display: block;
}
@keyframes dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.7;
  }
}

/* Video badge */
.video-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 3px;
}
.video-badge svg {
  width: 10px;
  height: 10px;
}

.music-card-body {
  padding: 0.85rem 0.85rem 0.65rem;
}
.music-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-card-artist {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.music-card-album {
  font-size: 0.73rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Card actions */
.music-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0.5rem 0.6rem;
}
.card-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid transparent;
  transition: var(--trans);
  white-space: nowrap;
}
.card-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text-1);
  border-color: var(--border);
}
.card-action-btn.active {
  color: var(--error);
}
.card-action-btn svg {
  width: 13px;
  height: 13px;
}

/* ---------- Skeleton ---------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.skeleton-cover {
  aspect-ratio: 1;
  background: var(--surface);
}
.skeleton-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skeleton-line {
  height: 10px;
  background: var(--surface);
  border-radius: 99px;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.w-full {
  width: 100%;
}
.skeleton-line.w-3q {
  width: 75%;
}
.skeleton-line.w-half {
  width: 50%;
}
@keyframes shimmer {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

/* ---------- Genre Chips ---------- */
.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.genre-chip {
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
  background: var(--surface);
}
.genre-chip:hover,
.genre-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Playlist Cards ---------- */
.playlist-card-cover {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--surface);
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-3);
  gap: 0.75rem;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 0.92rem;
}

/* ---------- Audio Player ---------- */
#audio-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-h);
  background: var(--bg-player);
  backdrop-filter: blur(30px);
  border-top: 1px solid var(--border);
  z-index: 300;
  display: grid;
  grid-template-columns: 280px 1fr 240px;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

/* Track section */
.player-track {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.player-art-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}
.player-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-art-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: var(--surface);
}
.player-art[src] ~ .player-art-ph {
  display: none;
}
.player-art-ring {
  display: none; /* optional animation */
}

.player-meta {
  min-width: 0;
  flex: 1;
}
.player-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist-link {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin-top: 1px;
}
.player-artist-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.player-fav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
  border-radius: 50%;
  transition: var(--trans);
}
.player-fav-btn svg {
  width: 16px;
  height: 16px;
}
.player-fav-btn:hover {
  color: var(--error);
  background: rgba(248, 113, 113, 0.1);
}
.player-fav-btn.active {
  color: var(--error);
}

/* Center controls */
.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: var(--text-2);
  transition: var(--trans);
}
.ctrl-btn svg {
  width: 18px;
  height: 18px;
}
.ctrl-btn:hover {
  color: var(--text-1);
  background: var(--surface-hover);
}
.ctrl-btn.active {
  color: var(--dyn);
}
.ctrl-btn.sm {
  width: 28px;
  height: 28px;
}
.ctrl-btn.sm svg {
  width: 15px;
  height: 15px;
}

.play-btn {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.play-btn:hover {
  background: var(--primary-light);
  transform: scale(1.08);
}
.play-btn svg {
  width: 20px;
  height: 20px;
}

/* Progress */
.progress-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}
.time-mono {
  font-size: 0.72rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: 'DM Mono', monospace;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--surface);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: height 0.15s var(--ease);
}
.progress-track:hover {
  height: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--dyn);
  border-radius: 99px;
  width: 0%;
  transition: width 0.1s linear;
}
.progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
  left: 0%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}
.progress-track:hover .progress-thumb {
  opacity: 1;
}
.progress-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.progress-track:hover .progress-tooltip {
  opacity: 1;
}

/* Right controls */
.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.vol-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.vol-slider {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 99px;
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text-1);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}
.vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--text-1);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.viz-canvas {
  opacity: 0.6;
}

/* ---------- Mobile Bottom Navigation ---------- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-player);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 250;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}
.mob-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 0.7rem;
  transition: var(--trans);
  padding: 0.5rem;
  border-radius: var(--r-sm);
  background: none;
  border: none;
}
.mob-link svg {
  width: 20px;
  height: 20px;
}
.mob-link.active,
.mob-link:hover {
  color: var(--primary);
}
.mob-link span {
  font-size: 0.65rem;
}

/* ---------- Queue Panel ---------- */
.side-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-strong);
  z-index: 350;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
}
.side-panel[hidden] {
  display: none;
}
.side-panel.active {
  transform: translateX(0);
}
.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.side-panel-head h3 {
  font-size: 1rem;
  font-weight: 600;
}
.queue-now {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.side-panel-label {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}
.queue-list {
  list-style: none;
  padding: 0.5rem 1.25rem;
  flex: 1;
  overflow-y: auto;
}
.queue-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.queue-list li:last-child {
  border-bottom: none;
}

/* ---------- YouTube Panel ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  padding: 1rem;
}
.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}
.yt-card {
  max-width: 720px;
}

.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-card-head h2,
.modal-card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-card-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.yt-embed {
  aspect-ratio: 16/9;
  background: #000;
  width: 100%;
}
.yt-info-row {
  padding: 1rem 1.25rem;
}
.yt-song {
  font-weight: 600;
  font-size: 0.95rem;
}
.yt-artist {
  color: var(--text-2);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* Settings specific */
.settings-section {
  margin-bottom: 1.25rem;
}
.settings-section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.setting-row label {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 500;
}
.setting-row input,
.setting-row select {
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-size: 0.9rem;
  transition: var(--trans);
}
.setting-row input:focus,
.setting-row select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(21, 135, 201, 0.06);
}
.setting-row select option {
  background: var(--bg-card);
}
.setting-row-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface);
  transition: 0.2s;
  border-radius: 99px;
  border: 1px solid var(--border);
}
.toggle-track .toggle-knob {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 1px;
  background-color: var(--text-2);
  transition: 0.2s;
  border-radius: 50%;
}
.toggle input:checked + .toggle-track {
  background-color: var(--primary);
}
.toggle input:checked + .toggle-track .toggle-knob {
  transform: translateX(22px);
  background-color: #fff;
}

.btn-ghost {
  padding: 0.55rem 1.25rem;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--trans);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}
.btn-primary {
  padding: 0.55rem 1.25rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--trans);
}
.btn-primary:hover {
  background: var(--primary-light);
}

/* Contact social grid */
.modal-intro {
  font-size: 0.88rem;
  color: var(--text-2);
}
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.25rem;
}
.social-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.8rem;
  color: var(--text-2);
  transition: var(--trans);
}
.social-tile i {
  font-size: 1.2rem;
}
.social-tile:hover {
  background: var(--surface-hover);
  color: var(--text-1);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* ---------- Keyboard Shortcuts Modal ---------- */
.kbd-card {
  max-width: 520px;
}
.kbd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.kbd-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.kbd-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}
.kbd-row kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-2);
}

/* ---------- Playlist Dropdown ---------- */
.playlist-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0.4rem 0;
  min-width: 150px;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.playlist-option {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--trans);
}
.playlist-option:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  #audio-player-bar {
    grid-template-columns: 220px 1fr 200px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 0px;
  }
  #sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  #sidebar.active {
    transform: translateX(0);
  }
  .sidebar-toggle-btn {
    display: flex;
  }
  #main-content {
    margin-left: 0;
  }
  #audio-player-bar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.6rem;
  }
  .player-track {
    order: 1;
  }
  .player-center {
    order: 2;
    width: 100%;
  }
  .player-right {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  #main-content {
    padding-bottom: calc(64px + 1rem);
  }
}

@media (max-width: 600px) {
  #section-area {
    padding: 1.25rem;
  }
  .topbar {
    padding: 0.75rem 1rem;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .music-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.9rem;
  }
  .player-controls {
    gap: 0.3rem;
  }
  .modal-card {
    max-width: 95%;
  }
  .kbd-grid {
    grid-template-columns: 1fr;
  }
}
