@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark: #05050c;
  --bg-panel: rgba(13, 13, 27, 0.7);
  --bg-panel-hover: rgba(22, 22, 45, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --secondary: #a855f7;
  --secondary-glow: rgba(168, 85, 247, 0.5);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --sidebar-width: 260px;
  --player-height: 100px;
  --titlebar-height: 48px;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --glass-blur: blur(20px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

input, textarea, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
}

/* ============================================
   CUSTOM TITLEBAR
   ============================================ */
.titlebar {
  height: var(--titlebar-height);
  min-height: var(--titlebar-height);
  display: flex;
  align-items: center;
  padding: 0 8px 0 0;
  background: rgba(5, 5, 14, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-app-region: drag;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

/* ---- Brand section (logo + name) ---- */
.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 0 18px;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  -webkit-app-region: drag;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Logo: hidden when expanded, visible only when compact */
.titlebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
  flex-shrink: 0;
  opacity: 0;
  width: 0;
  pointer-events: none;
  transition: opacity 0.2s, width 0.25s;
}

.titlebar-appname {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  transition: opacity 0.2s, width 0.25s;
  flex-shrink: 0;
}

/* Sidebar toggle — always visible, sits just after the brand div */
.titlebar-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
  margin-right: 4px;
  -webkit-app-region: no-drag;
}

.titlebar-sidebar-toggle svg {
  width: 15px;
  height: 15px;
}

.titlebar-sidebar-toggle:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}


/* ---- Search wrapper (contains input + floating dropdown) ---- */
.titlebar-search-wrapper {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  -webkit-app-region: no-drag;
  z-index: 2000;
}

/* Search input row */
.titlebar-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 7px 14px;
  transition: all 0.25s;
  gap: 8px;
}

.titlebar-search-wrapper.is-open .titlebar-search {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.07);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}

.titlebar-search .titlebar-search-icon {
  width: 14px;
  height: 14px;
  stroke: var(--text-dark);
  flex-shrink: 0;
  transition: stroke 0.2s, opacity 0.2s;
}

.titlebar-search-wrapper.is-open .titlebar-search-icon {
  stroke: var(--primary);
}

/* Spinner replaces icon when loading */
.search-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
  display: none;
}

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

.titlebar-search-wrapper.is-loading .titlebar-search-icon { display: none; }
.titlebar-search-wrapper.is-loading .search-spinner { display: block; }

.titlebar-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.875rem;
  width: 100%;
}

.titlebar-search input::placeholder { color: var(--text-dark); }

/* Clear button inside search bar */
.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
}
.search-clear-btn svg { width: 11px; height: 11px; }
.search-clear-btn:hover { background: rgba(255,255,255,0.2); }
.titlebar-search-wrapper.has-value .search-clear-btn { display: flex; }

/* ---- Floating Dropdown Panel ---- */
.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 10, 22, 0.97);
  border: 1px solid var(--primary);
  border-top: none;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(99,102,241,0.1);
  backdrop-filter: blur(24px);
  z-index: 2000;
  overflow: hidden;
  animation: dropdownOpen 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.titlebar-search-wrapper.is-open .search-dropdown { display: block; }

/* Idle / empty state */
.search-dropdown-idle,
.search-dropdown-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  color: var(--text-dark);
  font-size: 0.875rem;
}
.search-dropdown-idle svg,
.search-dropdown-empty svg { width: 16px; height: 16px; stroke: var(--text-dark); flex-shrink: 0; }

/* Loading dots */
.search-dropdown-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.search-loading-dots {
  display: flex;
  gap: 4px;
}
.search-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.search-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.search-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Results list */
#search-dropdown-results {
  max-height: 440px;
  overflow-y: auto;
  padding: 6px 0;
}

/* Individual result row */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-app-region: no-drag;
}
.search-result-item:hover { background: rgba(255,255,255,0.04); }

.search-result-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.search-result-thumb img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.search-result-thumb svg { width: 18px; height: 18px; stroke: var(--text-dark); }

.thumb-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 6px;
  z-index: 2;
}

.search-result-item:hover .thumb-play-overlay {
  opacity: 1;
}

.thumb-play-overlay svg {
  width: 16px;
  height: 16px;
  fill: white !important;
  stroke: white !important;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.search-result-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-duration {
  font-size: 0.75rem;
  color: var(--text-dark);
  flex-shrink: 0;
}
.search-platform-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.search-platform-badge.yt  { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.12); }
.search-platform-badge.yt-music { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.search-platform-badge.spotify { background: rgba(30, 215, 96, 0.15); color: #1ed760; border: 1px solid rgba(30, 215, 96, 0.25); }

.search-result-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.search-result-item:hover .search-result-actions { opacity: 1; }

.search-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.search-action-btn svg { width: 12px; height: 12px; }
.search-action-btn:hover { color: white; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.search-action-btn.play-btn:hover { background: rgba(99,102,241,0.25); border-color: var(--primary); color: #a5b4fc; }
.search-action-btn.dl-btn:hover   { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); color: #86efac; }

/* Dropdown section header */
.search-dropdown-section {
  padding: 8px 14px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-dark);
}


/* Right actions group */
.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 16px;
  -webkit-app-region: no-drag;
  flex-shrink: 0;
}

.titlebar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Text action buttons (Add Files / Add Folder) */
.titlebar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-app-region: no-drag;
  white-space: nowrap;
}

.titlebar-btn svg {
  width: 14px;
  height: 14px;
}

.titlebar-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.titlebar-btn-primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.18));
  border-color: rgba(99, 102, 241, 0.35);
  color: #c4b5fd;
}

.titlebar-btn-primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.3));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Icon-only button (Account) */
.titlebar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-app-region: no-drag;
}

.titlebar-icon-btn svg {
  width: 17px;
  height: 17px;
}

.titlebar-icon-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.titlebar-icon-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
}

.titlebar-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Window control buttons (min / max / close) */
.titlebar-wc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  -webkit-app-region: no-drag;
  flex-shrink: 0;
}

.titlebar-wc-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.titlebar-wc-close:hover {
  background: rgba(239, 68, 68, 0.85) !important;
  color: white !important;
}


/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography & General Classes */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* App Container Layout */
.app-container {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  width: 100vw;
  flex: 1;
  min-height: 0;
  position: relative;

}


/* ============================================
   SIDEBAR — normal + collapsed states
   ============================================ */
.sidebar {
  background: rgba(8, 8, 18, 0.85);
  border-right: 1px solid var(--border-color);
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  background: rgba(8, 8, 16, 0.98);
  z-index: 10;
  width: var(--sidebar-width);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Collapsed sidebar — icons only */
.sidebar.sidebar-collapsed {
  width: 64px;
  padding: 20px 10px;
}

.sidebar.sidebar-collapsed .menu-title,
.sidebar.sidebar-collapsed .menu-item span,
.sidebar.sidebar-collapsed .add-playlist-btn span,
.sidebar.sidebar-collapsed .playlist-item .playlist-name {
  display: none;
}

.sidebar.sidebar-collapsed .menu-item {
  justify-content: center;
  padding: 12px 8px;
}

.sidebar.sidebar-collapsed .add-playlist-btn {
  padding: 10px 8px;
  justify-content: center;
}

/* When collapsed, shrink the titlebar brand and show logo */
body.sidebar-collapsed .titlebar-brand {
  width: 64px;
  min-width: 64px;
}
body.sidebar-collapsed .titlebar-appname {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}
/* Show logo ONLY when collapsed */
body.sidebar-collapsed .titlebar-logo {
  opacity: 1;
  width: 28px;
  pointer-events: auto;
}


.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding-left: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-icon svg {
  width: 18px;
  height: 18px;
  stroke: white;
  stroke-width: 2.5;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.menu-section {
  margin-bottom: 30px;
}

.menu-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-left: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

.menu-item svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s;
}

.menu-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.menu-item:hover svg {
  transform: translateX(2px);
}

.menu-item.active {
  color: var(--text-main);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-left: 3px solid var(--primary);
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.05);
}

.menu-item.active svg {
  stroke: var(--primary);
}

/* Playlist Add & List */
.playlists-container {
  flex-grow: 1;
  overflow-y: auto;
  margin-top: 10px;
}

.add-playlist-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.add-playlist-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 2px;
  transition: all 0.2s;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.playlist-item .delete-playlist-btn {
  opacity: 0;
  transition: opacity 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.playlist-item:hover .delete-playlist-btn {
  opacity: 1;
}

.playlist-item svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-dark);
}

.playlist-item svg:hover {
  stroke: #ef4444;
}

/* Sidebar playlist art styles */
.playlist-sidebar-art {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  transition: all 0.2s;
}

.playlist-sidebar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-sidebar-default {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.playlist-sidebar-default.liked {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}
.playlist-sidebar-default.liked svg {
  stroke: white !important;
  fill: white;
  width: 14px;
  height: 14px;
}

.playlist-sidebar-default.regular {
  background: linear-gradient(135deg, #1e1b4b, #311042);
}
.playlist-sidebar-default.regular svg {
  stroke: rgba(255, 255, 255, 0.4) !important;
  width: 14px;
  height: 14px;
}

/* Sidebar collapsed styles for playlists */
.sidebar.sidebar-collapsed .playlist-item {
  justify-content: center;
  padding: 8px;
}

.sidebar.sidebar-collapsed .playlist-item .playlist-name,
.sidebar.sidebar-collapsed .playlist-item .delete-playlist-btn {
  display: none !important;
}

/* Ensure we don't hide the playlists container when collapsed, but let it flow */
.sidebar.sidebar-collapsed .playlists-container {
  display: block !important;
}

/* Content Area */
.content-area {
  padding: 40px;
  overflow-y: auto;
  position: relative;
  z-index: 5;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Action Controls */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  width: 320px;
  transition: all 0.3s;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  background: var(--bg-panel-hover);
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  margin-left: 10px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  width: 100%;
}

.search-bar svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow), 0 0 10px var(--secondary-glow);
}

.btn-secondary {
  background: var(--bg-panel);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-panel-hover);
  border-color: var(--primary);
}

/* Songs List View & Cards */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.song-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  user-select: none;
  /* Transition handled by explicit properties to avoid layout thrash */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.song-card:hover {
  transform: translateY(-5px);
  background: var(--bg-panel-hover);
  border-color: var(--border-color-glow);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card-art-container {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #111122;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 14px;
}

.card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.song-card:hover .card-art {
  transform: scale(1.08);
}

.card-play-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  border: none;
  cursor: pointer;
}

.card-play-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
  stroke: white;
}

.song-card:hover .card-play-btn {
  opacity: 1;
  transform: translateY(0);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

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

/* Hover Action Dot Menu */
.card-options-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}

.song-card:hover .card-options-btn {
  opacity: 1;
}

.card-options-btn svg {
  width: 14px;
  height: 14px;
  stroke: white;
}

/* Shared Track Overlay (Check & X) */
.shared-track-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  border-radius: 4px;
  transition: opacity 0.2s;
  pointer-events: none;
}
.playlist-track-row:hover .shared-track-overlay,
.song-card:hover .shared-track-overlay {
  opacity: 1;
  pointer-events: auto;
}
.shared-track-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.shared-track-btn.btn-download:hover {
  background: #22c55e;
  transform: scale(1.1);
}
.shared-track-btn.btn-remove:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* Dropdown styling */
.dropdown-menu {
  position: fixed;
  background: #0d0d1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  z-index: 4000;
  min-width: 170px;
  animation: dropdownFade 0.15s ease-out;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}
.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.has-submenu {
  position: relative;
}
.submenu-icon {
  margin-left: auto;
  width: 14px;
  height: 14px;
  opacity: 0.5;
}
.dropdown-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: #0d0d1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  min-width: 160px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 4001;
}
.has-submenu:hover .dropdown-submenu {
  display: block;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.dropdown-item {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-main);
}

.dropdown-item svg {
  width: 14px;
  height: 14px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.empty-state-icon svg {
  width: 36px;
  height: 36px;
}

.empty-state h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 360px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Drag and Drop Overlay */
.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 12, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px dashed var(--primary);
  margin: 10px;
  width: calc(100vw - 20px);
  height: calc(100vh - 20px);
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drag-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drag-overlay-content {
  text-align: center;
  animation: floatOverlay 3s ease-in-out infinite;
}

@keyframes floatOverlay {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.drag-overlay svg {
  width: 80px;
  height: 80px;
  stroke: var(--primary);
  margin-bottom: 20px;
}

/* Loading Overlay for Imports */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 12, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* Now Playing View Styling (Vinyl) */
.now-playing-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  gap: 80px;
  padding: 20px;
}

.vinyl-wrapper {
  position: relative;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-disc {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, #222 20%, #111 21%, #000 24%, #111 25%, #222 30%, #000 35%, #111 40%, #222 45%, #000 50%, #111 60%, #050505 70%);
  box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotateDisc 20s linear infinite;
  animation-play-state: paused;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vinyl-disc.playing {
  animation-play-state: running;
}

.vinyl-cover {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #111;
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.vinyl-center-hole {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--bg-dark);
  border-radius: 50%;
  border: 2px solid #222;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
  z-index: 5;
}

.vinyl-arm {
  position: absolute;
  top: -20px;
  right: 20px;
  width: 120px;
  height: 180px;
  transform-origin: 100px 20px;
  transform: rotate(-30deg);
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  z-index: 6;
}

.vinyl-arm.playing {
  transform: rotate(-5deg);
}

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

.now-playing-details {
  display: flex;
  flex-direction: column;
  max-width: 400px;
}

.np-tag-track {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.1;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.np-tag-artist {
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.np-tag-album {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Playlist Info Section */
.playlist-header-card {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  margin-bottom: 40px;
}

.playlist-art {
  width: 150px;
  height: 150px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

.playlist-art svg {
  width: 60px;
  height: 60px;
  stroke: white;
}

.playlist-info-meta h2 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.playlist-info-meta p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Tracks List Table */
.tracks-table-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 10px;
  backdrop-filter: var(--glass-blur);
}

.tracks-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tracks-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dark);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.tracks-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  vertical-align: middle;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.table-row {
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 8px;
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-row.playing {
  background: rgba(99, 102, 241, 0.08);
}

.table-row.playing td {
  color: var(--primary);
}

.table-track-index {
  width: 50px;
  text-align: center;
}

.table-track-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-weight: 500;
}

.table-row.playing .table-track-title {
  color: var(--primary);
}

.table-track-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.table-track-options {
  width: 60px;
  text-align: center;
}

.table-track-options button {
  background: transparent;
  border: none;
  cursor: pointer;
}

.table-track-options svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-dark);
  transition: stroke 0.2s;
}

.table-track-options button:hover svg {
  stroke: var(--text-main);
}


/* Download Toast Banner */
.download-toast {
  position: fixed;
  bottom: calc(var(--player-height) + 12px);
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(10, 10, 25, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(99, 102, 241, 0.25);
  backdrop-filter: blur(12px);
  animation: toastSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  max-width: 380px;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.download-toast-dots {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.download-toast-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.download-toast-dots span:nth-child(2) { animation-delay: 0.2s; }
.download-toast-dots span:nth-child(3) { animation-delay: 0.4s; }
.download-toast-label {
  font-weight: 600;
  color: #c4b5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.download-toast-status {
  font-size: 0.7rem;
  color: var(--text-dark);
  flex-shrink: 0;
}

/* Floating Glass Player Controls Bar */
.player-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 1200px;
  height: 86px;
  background: rgba(15, 15, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 43px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px 0 14px;
  background: rgba(12, 12, 22, 0.98);
  box-shadow: none;
  z-index: 3000;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Left Mini-Player Info */
.player-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  cursor: pointer;
  flex-basis: 30%;
  width: 30%;
}

.player-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #111122;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.player-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  width: calc(100% - 68px); /* 56px art + 12px gap */
}

@keyframes scrollTitle {
  0%, 10% { transform: translateX(0); }
  90%, 100% { transform: translateX(calc(-100% + 150px)); }
}

.player-title-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.player-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.3s ease;
}

.player-track-info:hover .player-title {
  overflow: visible;
  animation: scrollTitle 8s linear infinite alternate;
}

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

/* Middle Control Center */
.player-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  max-width: 500px;
  margin: 0 20px;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.control-btn:hover {
  color: var(--text-main);
}

.control-btn svg {
  width: 18px;
  height: 18px;
}

.control-btn.toggle.active {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.control-btn-play {
  width: 40px;
  height: 40px;
  background: var(--text-main);
  border-radius: 50%;
  color: var(--bg-dark);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.control-btn-play:hover {
  transform: scale(1.05);
  background: white;
  color: var(--bg-dark);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
}

.control-btn-play svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Seek Bar & Slider */
.seek-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 500;
  opacity: 0.8;
}

.progress-slider-container {
  flex-grow: 1;
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  cursor: pointer;
}

.progress-slider-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  width: 0%;
}

.progress-slider-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.1s;
}

.progress-slider-container:hover .progress-slider-handle {
  opacity: 1;
}

.progress-slider-container:hover {
  height: 6px;
}

/* Right Sound Controls */
.player-extra-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-basis: 30%;
  width: 30%;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 130px;
}

.volume-container svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  cursor: pointer;
}

.volume-container svg:hover {
  color: var(--text-main);
}

.volume-slider-container {
  flex-grow: 1;
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  cursor: pointer;
}

.volume-slider-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 70%;
}

.volume-slider-handle {
  position: absolute;
  top: 50%;
  left: 70%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: opacity 0.1s;
}

.volume-slider-container:hover .volume-slider-handle {
  opacity: 1;
}

.volume-slider-container:hover {
  height: 6px;
}

/* Modal styling for creating playlist */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(5px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #0d0d1e;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 30px;
  width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(99, 102, 241, 0.1);
  transform: scale(0.9);
  transition: transform 0.2s;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-title {
  font-size: 1.35rem;
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  color: white;
  font-family: var(--font-family);
  font-size: 0.95rem;
  margin-bottom: 24px;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: none;
}

.modal-btn-cancel:hover {
  color: white;
}

.modal-btn-confirm {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.modal-btn-confirm:hover {
  background: #4f46e5;
  box-shadow: 0 6px 15px var(--primary-glow);
}

/* Queue Panel Styling */
.queue-panel {
  position: fixed;
  top: var(--titlebar-height, 48px);
  right: -340px; /* Hidden by default */
  width: 340px;
  height: calc(100vh - var(--player-height) - var(--titlebar-height, 48px));
  background: rgba(8, 8, 18, 0.85);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 90;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 30px 24px;
}

.queue-panel.active {
  right: 0;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.queue-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.queue-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.queue-close-btn:hover {
  color: white;
}

.queue-close-btn svg {
  width: 20px;
  height: 20px;
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.queue-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.queue-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.queue-item.active .queue-item-title {
  color: var(--primary);
}

.queue-item-art {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #111122;
}

.queue-item-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.queue-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

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

.queue-item-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  padding: 4px;
}

.queue-item:hover .queue-item-remove {
  opacity: 1;
}

.queue-item-remove:hover {
  color: #ef4444;
}

.queue-item-remove svg {
  width: 14px;
  height: 14px;
}

/* Online Search Results Styling */
#search-results-container {
  margin-top: 12px;
  padding-right: 4px;
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.search-result-row:last-child {
  margin-bottom: 0;
}

.search-result-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.search-result-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #111122;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.search-result-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* Ensures text-overflow: ellipsis works */
}

.search-result-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.search-result-platform {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
}

.platform-badge.youtube {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.platform-badge.youtube svg,
.platform-badge.youtube i {
  width: 12px;
  height: 12px;
}

.platform-badge.soundcloud {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.platform-badge.soundcloud svg,
.platform-badge.soundcloud i {
  width: 12px;
  height: 12px;
}

.search-result-duration {
  font-size: 0.8rem;
  color: var(--text-dark);
  font-weight: 500;
  min-width: 45px;
  text-align: right;
  flex-shrink: 0;
}

.btn-download-result {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-download-result:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.btn-download-result:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-download-result svg,
.btn-download-result i {
  width: 14px;
  height: 14px;
}



/* Edit Song Cover Preview */
#edit-cover-preview:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

#edit-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hide scrollbar UI on lyrics container while keeping it mouse-scrollable */
#lyrics-container::-webkit-scrollbar {
  display: none !important;
}
#lyrics-container {
  position: relative !important;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important;  /* IE and Edge */
}

/* Jam Sync & Play Online button styling */
.btn-play-result {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-play-result:hover {
  background: #22c55e;
  color: white;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.4);
}

.btn-play-result svg,
.btn-play-result i {
  width: 14px;
  height: 14px;
}

/* ============================================
   LYRICS OVERLAY
   ============================================ */
.lyrics-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--titlebar-height));
  background: var(--bg-dark);
  background-image: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 80%);
  backdrop-filter: blur(40px);
  z-index: 900;
  transform: translateY(150%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 100%;
}

.lyrics-overlay.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.lyrics-overlay.fullscreen-mode {
  left: 0;
  width: 100%;
  bottom: 0;
  height: 100vh;
  z-index: 2000;
  background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.2) 0%, #000000 80%);
}

.lyrics-overlay-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  gap: 12px;
  flex-shrink: 0;
}

.lyrics-overlay-content {
  display: flex;
  flex-grow: 1;
  padding: 0 60px 60px 60px;
  gap: 60px;
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
}

.lyrics-overlay-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 45%;
  min-width: 0;
}

.lyrics-overlay-left img {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.6);
  margin-bottom: 30px;
  transition: transform 0.3s ease;
}

.lyrics-overlay-left h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 8px;
}

.lyrics-overlay-left h3 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.lyrics-overlay-right {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  /* fade edges for smooth scroll look */
  mask-image: linear-gradient(transparent, black 10%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(transparent, black 10%, black 80%, transparent);
}

.lyrics-overlay-container {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 40px;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lyrics-overlay-container::-webkit-scrollbar {
  display: none;
}

.lyrics-empty-state {
  color: var(--text-dark);
  font-size: 1.2rem;
  font-style: italic;
  text-align: center;
  margin: auto;
}

.lyric-line {
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  line-height: 1.3;
  word-wrap: break-word;
  transform-origin: center left;
  opacity: 0.3;
  transform: scale(0.95);
  margin: 0;
  padding: 4px 0;
}

.lyric-line:hover {
  color: rgba(255,255,255,0.7);
  opacity: 0.7;
}

.lyric-line.active {
  color: var(--album-color, var(--text-main));
  transform: scale(1.05);
  opacity: 1;
  text-shadow: 0 0 40px var(--album-color, rgba(255,255,255,0.4));
}

/* Dual sided alignment */
.lyric-line.align-left {
  text-align: left;
  transform-origin: center left;
}

.lyric-line.align-right {
  text-align: right;
  transform-origin: center right;
  color: rgba(168, 85, 247, 0.35); 
}

.lyric-line.align-right:hover {
  color: rgba(168, 85, 247, 0.7);
}

.lyric-line.align-right.active {
  color: var(--album-color, #fff);
  text-shadow: 0 0 40px var(--album-color, rgba(168, 85, 247, 0.6));
}
.playlist-art-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 12px;
  z-index: 10;
}
#playlist-art-container:hover .playlist-art-overlay {
  opacity: 1;
}

.settings-profile-pic-container:hover .pic-edit-overlay {
  opacity: 1 !important;
}

/* Discover Home View Styling */
.home-layout {
  padding-bottom: 40px;
}

.home-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  position: relative;
}

/* Most Played Songs List */
.song-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.song-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.song-list-item span {
  transition: color 0.2s;
}

.song-list-item:hover span {
  color: var(--text-main);
}

/* Most Played Artists Grid */
.artist-card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.artist-thumb-container {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.artist-card:hover .artist-thumb-container {
  transform: scale(1.08) translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
}

.artist-card:hover div {
  color: var(--text-main) !important;
}

.artist-placeholder {
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
}

/* Recommended Cards */
.recommended-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rec-dl-btn {
  transition: all 0.2s ease-in-out;
}

.rec-dl-btn:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
}

/* Artist Detail Page header & general tweaks */
.artist-header-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(99, 102, 241, 0.03) 100%) !important;
}

.artist-header-art-container {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.05);
}

/* Button back home */
#btn-back-to-home {
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s;
}

#btn-back-to-home:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(-2px);
}
