.library-search-row { margin-top: 16px; }
.library-header.is-compact .library-search-row { margin-top: 16px; }
/* Music Visualizer Styles - Fullscreen Mobile-Friendly */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: black;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  /* Support for iPhone X and other devices with notch */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

#imgCanvas, #bcCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

#imgCanvas {
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  z-index: 5; /* Ensure imgCanvas is above bcCanvas for clicks */
}

#bcCanvas {
  z-index: 1; /* Lower z-index so it doesn't block clicks */
  pointer-events: none; /* Explicitly disable pointer events on bcCanvas */
}

/* Global pause overlay shown when audio is paused */
.pause-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50; /* above canvases, below UI panels */
  pointer-events: none;
  color: #ffffff;
  opacity: 0.3; /* 30% transparent */
  font-size: clamp(60px, 22vw, 320px);
  line-height: 1;
  text-shadow: 0 6px 24px rgba(0,0,0,0.45);
}

#imgCanvas.stopped {
  opacity: 0.8;
}


.info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 780px);
  max-height: min(80vh, 680px);
  overflow-y: auto;
  background: rgba(8, 10, 18, 0.94);
  backdrop-filter: blur(20px) saturate(150%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 60px -20px rgba(0, 0, 0, 0.75);
  padding: 22px 26px 28px;
  color: #e8e8f0;
  z-index: 130;
  display: none;
  scrollbar-width: thin;
}

.info-panel.visible {
  display: block;
}

.info-panel::-webkit-scrollbar {
  width: 6px;
}

.info-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
}

.info-panel .info-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.info-panel .info-content {
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-panel .info-content p {
  margin: 0 0 12px;
}

.info-panel .info-content p:last-child {
  margin-bottom: 0;
}

.info-panel .info-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
}

.info-panel .info-close:hover,
.info-panel .info-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
}

.info-panel .info-close:focus-visible {
  outline: 2px solid rgba(138, 182, 255, 0.9);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .info-panel {
    width: min(92vw, 520px);
    max-height: calc(100vh - 120px);
    padding: 18px 20px 24px;
  }
}



/* Floating top controls */
.top-controls { display:none !important; }

.topbar-inline-text {
  font-size: 15px;
  color: #fff;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.artist-info, .song-info {
  display: none;
}

.topbar-text {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: min(88vw, 720px);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  pointer-events: none;
  z-index: 105;
}

@media (max-width: 768px) {
  .top-controls {
    top: 14px;
    gap: 6px;
    max-width: min(94vw, 540px);
  }

  .topbar-text {
    top: 56px;
    font-size: 13px;
    width: min(92vw, 520px);
  }
}
.artist-info {
  text-align: right;
  padding-right: 10px;
}

.song-info {
  text-align: left;
  padding-left: 10px;
}
.link-like { background:none; border:none; color:#fff; font:inherit; padding:0; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.link-like:hover, .link-like:focus-visible { color:#a5b4ff; }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .controls {
    gap: 6px;
  }

  .topbar-inline-text {
    font-size: 13px;
  }
  
  .artist-info, .song-info {
    font-size: 12px;
  }
  
  .artist-info {
    padding-right: 5px;
  }
  
  .song-info {
    padding-left: 5px;
  }
}

.controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  width: auto;
}

/* Neo Button Base */
.neo-btn {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 14px;
  min-width: 46px;
  min-height: 46px;
  /* display: none; */
}
.neo-btn:hover { transform:none; box-shadow:0 8px 22px -6px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.12) inset; background:linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)); }
.neo-btn:active { transform:none; transition:none; }
.neo-btn:hover::before { opacity:1; }
.neo-btn:focus-visible { outline:2px solid #8ab6ff; outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ .neo-btn { transition:none; } }

/* Unified top/bottom controls */
.controls button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 38px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 20, 32, 0.6);
  backdrop-filter: blur(18px);
  color: #f6f8ff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.15px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.controls button span {
  pointer-events: none;
}

.controls button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.6);
}

.controls button:active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 4px 14px -8px rgba(0, 0, 0, 0.55);
}

.controls button:focus-visible {
  outline: 2px solid #8ab6ff;
  outline-offset: 2px;
}

.controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Play state pulse */
body.is-playing #playPauseBtn { animation: none; }
.controls button:focus-visible, .lyrics-btn:focus-visible, .action-btn:focus-visible, #librarySearch:focus-visible {
  outline: 2px solid #6366F1;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce){
  * { animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition:none !important; }
}

@media (max-width: 768px) {
  .controls {
    gap: 5px;
  }
  
  .controls button {
    font-size: 13px;
    padding: 5px 10px;
    min-width: 32px;
    min-height: 32px;
  }
}

.info {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.separator {
  margin: 0 6px;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .info {
    font-size: 11px;
  }
  .separator {
    margin: 0 4px;
  }
}

/* Lyrics Panel - Right Side Positioning */
.lyrics-panel {
  position: fixed;
  top: 60px;
  right: 10px;
  max-height: calc(100vh - 140px);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  padding: 20px;
  color: white;
  font-size: 14px;
  line-height: 1.6;
  z-index: 90;
  display: none;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers */
.lyrics-panel::-webkit-scrollbar {
  display: none;
}

/* Context Menu */
.context-menu { position:fixed; z-index:999; background:rgba(0,0,0,0.85); backdrop-filter:blur(10px); border:1px solid rgba(255,255,255,0.15); border-radius:8px; min-width:160px; font-size:13px; color:#fff; box-shadow:0 6px 24px rgba(0,0,0,0.4); }
.context-menu.hidden { display:none; }
.context-menu ul { list-style:none; margin:0; padding:6px 0; }
.context-menu li { padding:8px 14px; cursor:pointer; display:flex; align-items:center; gap:8px; }
.context-menu li:hover { background:rgba(255,255,255,0.12); }
.context-menu li+li { border-top:1px solid rgba(255,255,255,0.08); }
.context-menu li.hidden { display:none; }

@media (max-width:600px){
  .context-menu { min-width:180px; }
  .context-menu li { padding:12px 16px; }
}

/* Mobile phones (≤480px): Full width overlay */
@media (max-width: 480px) {
  .lyrics-panel {
    top: 50px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 120px);
    padding: 15px;
    font-size: 13px;
  }
}

/* Small tablets (481px - 768px): Right half minus margin */
@media (min-width: 481px) and (max-width: 768px) {
  .lyrics-panel {
    right: 10px;
    width: calc(50vw - 20px);
    min-width: 280px;
    padding: 18px;
    font-size: 13px;
  }
}

/* Medium screens (769px - 1199px): Right 45% of screen */
@media (min-width: 769px) and (max-width: 1199px) {
  .lyrics-panel {
    right: 10px;
    width: 45vw;
    min-width: 350px;
    max-width: 500px;
  }
}

/* Large screens (≥1200px): Right side with fixed optimal width */
@media (min-width: 1200px) {
  .lyrics-panel {
    right: 10px;
    width: 450px;
  }
}

.lyrics-panel.visible {
  display: block;
}

.lyrics-content p {
  margin: 0 0 10px 0;
}

.lyrics-content p:last-child {
  margin-bottom: 0;
}

.bottom-controls {
  display: none !important;
}

.bottom-controls button {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  padding: 16px 32px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4), 0 0 0 0 rgba(79, 70, 229, 0.8);
  backdrop-filter: blur(10px);
  animation: pulse-glow 3s ease-in-out infinite;
}

.bottom-controls button:hover {
  background: linear-gradient(135deg, #5B52F0 0%, #8B5CF6 100%);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.6), 0 0 20px rgba(79, 70, 229, 1);
}

.bottom-controls button:active {
  transform: translateY(-2px) scale(1.02);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4), 0 0 0 0 rgba(79, 70, 229, 0.8);
  }
  50% {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.6), 0 0 15px 3px rgba(79, 70, 229, 0.6);
  }
}

@media (max-width: 768px) {
  .bottom-controls {
    bottom: 24px;
  }

  .bottom-controls button {
    border-radius: 20px;
    padding: 14px 24px;
    font-size: 14px;
    letter-spacing: 0.5px;
  }
}

/* Seekable Track Progress at Bottom - Mobile Optimized */
.track-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
  z-index: 80;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.track-progress:hover,
.track-progress:active {
  height: 25px;
  background: rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
  .track-progress {
    height: 25px;
  }
  
  .track-progress:hover,
  .track-progress:active {
    height: 30px;
  }
}

.track-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
  width: 0%;
  transition: width 0.1s ease;
  border-radius: 0;
}

.track-progress-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  margin-left: -10px;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.track-progress:hover .track-progress-handle {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* Unified Library Panel - Centered layout */
.library-panel {
  position: fixed;
  top: 0; /* dock to window top */
  left: 50%;
  transform: translateX(-50%);
  width: min(80vw, 960px);
  max-height: calc(100vh - 60px);
  background: transparent; /* remove wrapper background */
  backdrop-filter: none;
  border-radius: 16px; /* keep hit area rounded */
  padding: 8px 16px 16px;
  color: white;
  font-size: 14px;
  z-index: 90;
  display: none;
  overflow-y: auto;
  box-shadow: none !important;
  border: none !important;
  border-color: transparent !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.library-panel::-webkit-scrollbar {
  display: none;
}

@media (max-width: 600px) {
  .library-panel {
    width: 80vw;
    padding: 14px 16px;
    font-size: 13px;
    max-height: calc(100vh - 140px);
  }
}

.library-panel.visible {
  display: block;
}

/* Prevent initial focus outline glow on first open */
.library-panel:focus,
.library-panel:focus-visible {
  outline: none !important;
}

.library-header {
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  /* keep header readable while content scrolls underneath */
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-color: rgba(255,255,255,0.2);
  border-radius: 14px; /* rounded corners for header */
  padding-top: 6px;
  padding-bottom: 8px;
  position: sticky;
}

/* Library details accordion toggle (top-right) */
.library-header { position: sticky; }
.library-toggle {
  position: absolute;
  top: 6px;
  right: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
}
.library-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.library-toggle:focus-visible { outline: 2px solid #8ab6ff; outline-offset: 2px; }
.library-fullscreen {
  position: absolute;
  top: 6px;
  right: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
}
.library-fullscreen:hover { background: rgba(255, 255, 255, 0.16); }
.library-fullscreen:focus-visible { outline: 2px solid #8ab6ff; outline-offset: 2px; }
.library-labelinfo {
  position: absolute;
  top: 6px;
  right: 78px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
}
.library-labelinfo:hover { background: rgba(255, 255, 255, 0.16); }
.library-labelinfo:focus-visible { outline: 2px solid #8ab6ff; outline-offset: 2px; }
}

/* Now playing meta row in library header */
.library-now-playing { display:flex; gap:8px; align-items:center; margin-bottom:6px; flex-wrap:wrap; min-height: 30px; }
.library-now-playing .lnp-brand { padding:6px 10px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); border-radius:8px; font-size:12px; cursor:pointer; }
.library-now-playing .lnp-brand:hover { background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.28); box-shadow:0 2px 8px rgba(0,0,0,0.25); }
.library-now-playing .lnp-artist,
.library-now-playing .lnp-song,
.library-now-playing .lnp-album { padding:6px 10px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); border-radius:8px; font-size:12px; cursor:pointer; color:#fff; height:28px; display:inline-flex; align-items:center; }
.library-now-playing .lnp-brand { height:28px; display:inline-flex; align-items:center; }
.library-now-playing .lnp-artist:hover,
.library-now-playing .lnp-song:hover,
.library-now-playing .lnp-album:hover { background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.28); box-shadow:0 2px 8px rgba(0,0,0,0.25); }
.library-now-playing .lnp-sep,
.library-now-playing .lnp-present,
.library-now-playing .lnp-present-verb,
.library-now-playing .lnp-present-album {
  opacity:.8;
  font-size:12px;
  display:inline-flex;
  align-items:center;
  line-height:1;
  margin:0 4px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.breadcrumb-item {
  cursor: pointer;
  transition: color 0.2s;
  padding: 3px 6px;
  border-radius: 4px;
}

.breadcrumb-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.breadcrumb-item.active {
  color: white;
  font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
  content: " › ";
  margin: 0 4px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.library-info {
  display: none !important;
}

.library-section {
  display: block;
}

.library-section.hidden {
  display: none;
}

.library-items {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
}

.library-items::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.nav-item.active {
  background: rgba(79, 70, 229, 0.28);
  border-color: rgba(79, 70, 229, 0.45);
}

.nav-item-image {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-info {
  flex: 1;
  min-width: 0;
}

.nav-item-meta {
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
}

.artist-item .nav-item-meta,
.album-item .nav-item-meta {
  font-size: 20px;
}

.track-item .nav-item-meta {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.65);
  min-width: 44px;
  justify-content: flex-end;
}

.nav-item-name {
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-details {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-actions {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.action-btn:active {
  transform: scale(0.95);
}

.play-btn {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
}

.play-btn:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.6);
}

.navigate-btn {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

.navigate-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.playlist-info {
  font-size: 12px;
  opacity: 0.7;
}

.playlist-content {
  max-height: 400px;
  overflow-y: auto;
}

.playlist-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  border: 1px solid transparent;
  margin-bottom: 5px;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.playlist-item.active {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
}

.playlist-item-artwork {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
}

.playlist-item-details {
  flex: 1;
  min-width: 0;
}

.playlist-item-title {
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-artist {
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-duration {
  font-size: 11px;
  opacity: 0.6;
  flex-shrink: 0;
  margin-left: 10px;
}

.nav-btn:hover, .playlist-btn:hover, .lyrics-btn:hover,
.nav-btn:active, .playlist-btn:active, .lyrics-btn:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
}

/* Navigation Panel - Left Side Positioning */
.navigation-panel {
  position: fixed;
  top: 60px;
  left: 10px;
  max-height: calc(100vh - 140px);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  padding: 20px;
  color: white;
  font-size: 14px;
  z-index: 100;
  display: none;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers */
.navigation-panel::-webkit-scrollbar {
  display: none;
}

/* Language indicator animation */
@keyframes fadeInOut {
  0% { 
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  20% { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  80% { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% { 
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
}

/* Mobile phones (≤480px): Full width overlay */
@media (max-width: 480px) {
  .navigation-panel {
    top: 50px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 120px);
    padding: 15px;
    font-size: 13px;
  }
}

/* Small tablets (481px - 768px): Left side positioning */
@media (min-width: 481px) and (max-width: 768px) {
  .navigation-panel {
    left: 10px;
    width: calc(40vw - 10px);
    min-width: 280px;
    padding: 18px;
    font-size: 13px;
  }
}

/* Medium screens (769px - 1199px): Left 35% of screen */
@media (min-width: 769px) and (max-width: 1199px) {
  .navigation-panel {
    left: 10px;
    width: 35vw;
    min-width: 320px;
    max-width: 400px;
  }
}

/* Large screens (≥1200px): Left side with fixed optimal width */
@media (min-width: 1200px) {
  .navigation-panel {
    left: 10px;
    width: 380px;
  }
}

.navigation-panel.visible {
  display: block;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.nav-controls {
  display: flex;
  gap: 5px;
}

.nav-mode-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-mode-btn.active {
  background: rgba(79, 70, 229, 0.8);
  border-color: rgba(79, 70, 229, 1);
}

.nav-mode-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-section {
  display: block;
}

.nav-section.hidden {
  display: none;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-item-image {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  margin-right: 12px;
  background: rgba(79, 70, 229, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.nav-item-info {
  flex: 1;
  min-width: 0;
}

.nav-item-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-details {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-albums {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-left: 62px;
}

.album-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.album-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.album-item-image {
  width: 35px;
  height: 35px;
  border-radius: 4px;
  margin-right: 10px;
  background: rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.album-item-info {
  flex: 1;
  min-width: 0;
}

.album-item-name {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-item-year {
  font-size: 11px;
  opacity: 0.6;
}
.library-search-row { display:flex; gap:6px; align-items:center; margin-top:6px; }
#librarySearch { flex:1; padding:5px 9px; border-radius:6px; border:1px solid rgba(255,255,255,0.22); background:rgba(0,0,0,0.45); color:#fff; font-size:13px; }
#librarySearch:focus { outline:2px solid #6366F1; }