/* --- Mobile Responsiveness Improvements --- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    z-index: 2000;
    background: #181818;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 16px rgba(0,0,0,0.2);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: block;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 2100;
    background: #222;
    color: #fff;
    border: none;
    font-size: 2rem;
    border-radius: 8px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  }
  .nav-btn {
    font-size: 1.1rem !important;
    padding: 18px 18px !important;
    margin-bottom: 8px;
    border-radius: 10px;
    width: 100%;
    min-height: 48px;
  }
  .modal-content {
    padding: 18px 8px !important;
    max-width: 98vw !important;
  }
  .btn, .btn-secondary, .btn-danger {
    font-size: 1.1rem !important;
    padding: 14px 18px !important;
    min-width: 120px;
    min-height: 44px;
    border-radius: 10px;
  }
  input, select {
    font-size: 1.1rem !important;
    padding: 12px 10px !important;
    border-radius: 8px;
  }
  .songs-grid, .playlists-grid, .artists-grid, .albums-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
}

@media (max-width: 600px) {
  .sidebar {
    width: 96vw;
    max-width: 100vw;
  }
  .songs-grid, .playlists-grid, .artists-grid, .albums-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 500px) {
  .modal-content {
    padding: 8px 2px !important;
  }
  .btn, .btn-secondary, .btn-danger {
    font-size: 1rem !important;
    padding: 10px 8px !important;
    min-width: 90px;
    min-height: 38px;
  }
  input, select {
    font-size: 1rem !important;
    padding: 8px 6px !important;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
    transition: background 0.4s, color 0.4s;
  }

  body, .sidebar, .main, .modal-content, .player, .settings-group, .songs-grid, .playlists-grid, .artists-grid, .albums-grid {
    transition: background 0.4s, color 0.4s, box-shadow 0.4s;
  }

  .theme-transition {
    transition: background 0.4s, color 0.4s, box-shadow 0.4s !important;
  }

  /* Extra theme color options */
  /* Utility classes for layout */
  .d-flex {
    display: flex !important;
  }
  .flex-column {
    flex-direction: column !important;
  }
  .d-block-sm {
    display: flex !important;
  }
  @media (max-width: 770px) {
    .d-block-sm {
      display: block !important;
    }
  }
  /* Utility classes for responsive flex layout */
  .d-flex {
    display: flex;
  }
  .flex-column {
    flex-direction: column;
  }
  .d-block-sm {
    display: block;
  }
  @media (max-width: 770px) {
    .d-flex {
      display: block;
    }
  }
  @media (max-width: 770px) {
    .statistics-summary, .statistics-totals, .statistics-songs-played {
      flex-direction: column;
      flex-wrap: nowrap;
    }
    .statistics-summary > *, .statistics-totals > *, .statistics-songs-played > * {
      flex: 0 0 100%;
      max-width: 100%;
      margin-bottom: 12px;
    }
  }
  /* Responsive fix for statistics tab overflow */
  @media (max-width: 900px) {
    .statistics-summary, .statistics-totals, .statistics-songs-played {
      display: flex;
      flex-wrap: wrap;
      overflow-x: auto;
      word-break: break-word;
      max-width: 100vw;
      font-size: 1rem;
    }
    .statistics-summary > *, .statistics-totals > *, .statistics-songs-played > * {
      flex: 0 0 50%;
      max-width: 50%;
      box-sizing: border-box;
      margin-bottom: 12px;
    }
  }
  #clearFavorites, #clearLikes, #clearPlaylists, #clearStatistics, #clearAllData {
    max-width: 300px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    display: block;
    background: #e74c3c;
    color: #fff;
    border-radius: var(--border-radius);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
    transition: background 0.2s;
  }

  #clearFavorites:hover, #clearLikes:hover, #clearPlaylists:hover, #clearStatistics:hover, #clearAllData:hover {
    background: #c0392b;
  }
  /* Data management buttons max-width */

  #viewStorageUsage {
    max-width: 300px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    display: block;
    background: #fff;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid var(--primary-color);
    transition: background 0.2s, color 0.2s;
  }

  #viewStorageUsage:hover {
    background: var(--primary-hover);
    color: #333;
  }

  #exportData {
    max-width: 300px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    display: block;
    background: var(--primary-color);
    color: #333;
    border-radius: var(--border-radius);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
    transition: background 0.2s;
  }

  #exportData:hover {
    background: var(--primary-hover);
  }

  #clearAllData {
    max-width: 300px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    display: block;
    background: #e74c3c;
    color: #fff;
    border-radius: var(--border-radius);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
    transition: background 0.2s;
  }

  #clearAllData:hover {
    background: #c0392b;
  }

  #viewStorageUsage:hover, #exportData:hover, #clearAllData:hover {
    background: var(--primary-hover);
  }
  body.dark-mode h1,
  body.dark-mode h2,
  body.dark-mode h3,
  body.dark-mode h4,
  body.dark-mode h5,
  body.dark-mode h6,
  body.dark-mode .btn,
  body.dark-mode .btn-primary,
  body.dark-mode button {
    color: #fff !important;
  }
  body.dark-mode, body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6, body.dark-mode p, body.dark-mode span, body.dark-mode label, body.dark-mode div, body.dark-mode li, body.dark-mode a, body.dark-mode th, body.dark-mode td {
    color: #fff !important;
  }
  /* Purple theme header and button text contrast */
  .btn[style*="background: purple"],
  .btn[style*="background: #800080"],
  .btn[style*="background: rgb(128, 0, 128)"],
  .btn-primary.purple,
  .btn-purple,
  h1.purple, h2.purple, h3.purple, h4.purple, h5.purple, h6.purple,
  h2.purple {
    color: #fff !important;
  }

  /* If you have a specific yellow button class, add it here */
  --primary-color: rgb(245, 244, 107);
  --primary-hover: rgb(255, 255, 160);
  --bg-dark: #121212;
  --bg-sidebar: #000;
  --bg-card: #181818;
  --text-primary: #fff;
  --text-secondary: #b3b3b3;
  --border-color: #282828;
  --base-font-size: 14px;
  --base-font-weight: 400;
  --border-radius: var(--border-radius);
  --border-radius-small: 4px;
  --border-radius-large: 24px;
  --vh: 1vh;
}

body {
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: var(--base-font-size);
  font-weight: var(--base-font-weight);
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  min-height: 100vh;
  min-height: 100dvh;
  position: fixed;
}

body * {
  font-family: inherit;
  font-weight: inherit;
}

/* Custom background with blur and overlay */
body.has-custom-bg::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: blur(var(--bg-overlay-blur, 10px));
  z-index: -2;
  pointer-events: none;
}

body.has-custom-bg::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, var(--bg-overlay-opacity, 0.3));
  z-index: -1;
  pointer-events: none;
}

body.has-custom-bg .app {
  position: relative;
  z-index: 1;
  background: transparent;
}

body.has-custom-bg .sidebar {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.has-custom-bg .main {
  background: transparent;
}

.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 1fr 90px;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  position: relative;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-sidebar);
  padding: 24px;
  grid-row: 1 / 3;
}

.logo {
  font-size: calc(var(--base-font-size) * 1.3);
  margin-bottom: 32px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  background: none;
  border: none;
  color: #b3b3b3;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--border-radius-small);
  font-size: var(--base-font-size);
  transition: all 0.2s;
}

.nav-btn:hover {
  color: #fff;
}

.nav-btn.active {
  color: var(--text-primary);
  background: var(--border-color);
}

.main {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--bg-dark) 600px);
  max-width: 100%;
}

.view {
  display: none;
  max-width: 100%;
  overflow-x: hidden;
}

.view.active {
  display: block;
}

h2 {
  margin-bottom: 24px;
  font-size: calc(var(--base-font-size) * 2.3);
  font-weight: calc(var(--base-font-weight) + 300);
}

.controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.search-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

input[type="text"],
select {
  padding: 12px 16px;
  background: var(--border-color);
  border: none;
  border-radius: var(--border-radius-small);
  color: var(--text-primary);
  font-size: 14px;
}

.search-container input[type="text"] {
  flex: 1;
  padding-right: 50px;
}

.voice-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-small);
  transition: background 0.2s;
  z-index: 10;
  color: var(--text-primary);
}

.voice-search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.voice-search-btn.listening {
  animation: pulse 1.5s infinite;
  color: var(--primary-color);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Loading spinner for Browse view */
.loading-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

input[type="text"] {
  flex: 1;
}

select {
  min-width: 150px;
}

input[type="file"] {
  padding: 8px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  margin-right: 8px;
  font-size: 13px;
}

input[type="file"]::file-selector-button:hover {
  background: var(--primary-hover);
}

.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.songs-grid .section-header {
  grid-column: 1 / -1;
}

.artists-grid,
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.artists-grid .section-header,
.albums-grid .section-header {
  grid-column: 1 / -1;
}

.song-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.song-card:hover {
  background: var(--border-color);
}

.song-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--border-radius-small);
  margin-bottom: 12px;
}

.song-title {
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  color: #b3b3b3;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: underline;
}

.song-artist:hover {
  color: var(--primary-color);
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.song-card:hover .card-actions,
.artist-card:hover .card-actions,
.album-card:hover .card-actions {
  opacity: 1;
}

.action-btn {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  transition: all 0.2s;
  flex: 0 0 auto;
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--primary-color);
  transform: scale(1.05);
}

.action-btn.active {
  color: var(--primary-color);
  background: rgba(29, 185, 84, 0.2);
}

.play-count-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--primary-color);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.fav-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.song-card:hover .fav-btn {
  opacity: 1;
}

.fav-btn.active {
  color: var(--primary-color);
  opacity: 1;
}

.player {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 12px 24px;
  display: grid;
  grid-template-columns: 250px 1fr 1fr;
  grid-template-rows: auto;
  gap: 16px;
  align-items: center;
  height: auto;
  min-height: 90px;
}

.player-info {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 250px;
  flex-shrink: 0;
}

.player-info img {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-small);
  object-fit: cover;
}

#playerTitle {
  font-weight: 600;
  font-size: calc(var(--base-font-size) * 1.1);
}

#playerArtist {
  color: #b3b3b3;
  font-size: calc(var(--base-font-size) * 0.9);
}

.player-controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.player-controls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  transition: transform 0.2s;
}

.player-controls button:hover {
  transform: scale(1.1);
}

.player-right {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
}

#play {
  background: #fff;
  color: #000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.player-progress {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: calc(var(--base-font-size) * 0.86);
  color: #b3b3b3;
  flex: 1;
  min-width: 200px;
}

input[type="range"] {
  flex: 1;
  height: 4px;
  background: #404040;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

#volume {
  width: 120px;
  flex-shrink: 0;
}

.player-expand-btn {
  display: none;
}

.btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-large);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.btn-success-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-success-outline:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.btn-small {
  padding: 10px 20px;
  font-size: 13px;
  width: auto;
  display: inline-block;
  margin-bottom: 8px;
}

.btn-danger {
  background: #e22134;
  color: #fff;
}

.btn-danger:hover {
  background: #ff2e43;
  box-shadow: 0 4px 12px rgba(226, 33, 52, 0.3);
}

.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.playlist-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.2s;
}

.playlist-card:hover {
  background: var(--border-color);
}

.suggested-playlist {
  position: relative;
}

.suggested-playlist::after {
  content: '🎵 Suggested';
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--border-radius-small);
  font-size: 11px;
  font-weight: 600;
}

.itunes-playlist {
  position: relative;
}

.itunes-playlist::after {
  content: '🍎 iTunes';
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--border-radius-small);
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.deezer-playlist {
  position: relative;
}

.deezer-playlist::after {
  content: '🎧 Deezer';
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
  color: #fff;
  padding: 4px 8px;
  border-radius: var(--border-radius-small);
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 65, 108, 0.3);
}

.suggested-playlist img,
.itunes-playlist img,
.deezer-playlist img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: 12px;
}

.suggested-playlist .playlist-info {
  text-align: left;
}

.itunes-playlist .playlist-info {
  text-align: left;
}

.deezer-playlist .playlist-info {
  text-align: left;
}

.playlist-artwork {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 12px;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-empty {
  font-size: 48px;
  color: #404040;
}

.playlist-artwork .single-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-grid-art {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  height: 100%;
  gap: 2px;
}

.playlist-grid-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.playlist-count {
  color: #b3b3b3;
  font-size: 14px;
}

.playlist-actions {
  padding: 0 0 16px 0;
  border-bottom: 1px solid #404040;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.playlist-actions .btn:first-child {
  flex: 1;
  min-width: 100%;
}

.playlist-actions .btn-secondary {
  flex: 1;
  min-width: calc(50% - 6px);
}

.artists-grid,
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.artist-card,
.album-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.artist-card:hover,
.album-card:hover {
  background: var(--border-color);
}

.artist-card img,
.album-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 12px;
}

.album-card img {
  border-radius: var(--border-radius-small);
}

.artist-name,
.album-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.artist-count,
.album-artist {
  color: #b3b3b3;
  font-size: 14px;
}

.stats-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 770px) {
  .stats-summary {
    grid-template-columns: 1fr;
  }
  .stat-box {
    width: 100%;
    margin-bottom: 16px;
  }
}

.stat-box {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--border-radius);
  text-align: center;
}

.stat-value {
  font-size: calc(var(--base-font-size) * 3.4);
  font-weight: calc(var(--base-font-weight) + 300);
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  color: #b3b3b3;
  font-size: 14px;
}

h3 {
  margin: 32px 0 16px;
  font-size: 24px;
}

.settings-group {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
}

.settings-group h3 {
  margin: 0 0 16px;
}

.settings-group .btn {
  margin-bottom: 12px;
}

.settings-danger-zone {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 12px;
}

.settings-danger-zone .btn {
  margin-bottom: 0;
}

.settings-section {
  margin-top: 20px;
}

.settings-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.settings-select {
  width: 100%;
  max-width: 300px;
  padding: 10px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  cursor: pointer;
}

.theme-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.theme-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.theme-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.theme-btn.active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

#customColor {
  width: 60px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  background: var(--bg-card);
}

#shuffle.active,
#repeat.active {
  color: var(--primary-color);
}

#castBtn {
    font-size: 14px;
  /* Inherit nav-btn styles from sidebar */
  font-size: 20px;
  background: inherit;
  border: none;
  border-radius: var(--border-radius);
  width: 100%;
  height: auto;
  display: block;
  align-items: unset;
  justify-content: unset;
  cursor: pointer;
  transition: background 0.2s;
  z-index: unset;
  box-shadow: none;
}

#castBtn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.95);
  box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

#castBtn.active {
  background: var(--primary-color);
  animation: pulse-cast 2s infinite;
}

@keyframes pulse-cast {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.like-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.song-card:hover .like-btn {
  opacity: 1;
}

.like-btn.active {
  color: var(--primary-color);
  opacity: 1;
}

body.light-mode {
  --bg-dark: #f2f2f2;
  --bg-sidebar: #e8e8e8;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --border-color: #d0d0d0;
  background: var(--bg-dark);
  color: var(--text-primary);
}

body.light-mode .sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
}

body.light-mode .main {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--bg-dark) 300px);
}

body.light-mode .song-card,
body.light-mode .artist-card,
body.light-mode .album-card,
body.light-mode .playlist-card,
body.light-mode .stat-box,
body.light-mode .settings-group,
body.light-mode .player {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body.light-mode input,
body.light-mode select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #333;
}

body.light-mode .nav-btn {
  color: #4a4a4a;
}

body.light-mode .nav-btn.active {
  color: #1a1a1a;
  background: #e0e0e0;
}

body.light-mode .song-artist,
body.light-mode .artist-count,
body.light-mode .album-artist,
body.light-mode .playlist-count,
body.light-mode .stat-label,
body.light-mode #playerArtist {
  color: #4a4a4a;
}

body.light-mode .modal-content {
  background: #ffffff;
  color: #1a1a1a;
}

body.light-mode .modal-header {
  border-bottom-color: #d0d0d0;
}

body.light-mode .queue-section h3 {
  color: #4a4a4a;
}

body.light-mode .queue-number {
  color: #4a4a4a;
}

body.light-mode .queue-item-artist {
  color: #4a4a4a !important;
}

body.light-mode .action-btn,
body.light-mode .player-controls button,
body.light-mode .nav-btn,
body.light-mode .close-btn,
body.light-mode .mobile-menu-btn,
body.light-mode .player-expand-btn,
body.light-mode #castBtn,
body.light-mode button svg {
  color: #333;
}

body.light-mode .btn,
body.light-mode .btn-secondary,
body.light-mode button {
  color: #333;
}

body.light-mode .btn-success-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

body.light-mode .btn-success-outline:hover {
  background: var(--primary-color);
  color: #fff;
}

.empty-state {
  color: #b3b3b3;
  padding: 40px;
  text-align: center;
}

body.light-mode .empty-state {
  color: #333;
}

.detail-view {
  animation: slideIn 0.3s ease;
  max-width: 100%;
  overflow-x: hidden;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.back-btn {
  background: #282828;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-large);
  cursor: pointer;
  font-size: 14px !important;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--primary-color);
  transform: scale(1.05);
}

.detail-header {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  align-items: flex-end;
  padding: 40px;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

.detail-header img {
  width: 200px;
  height: 200px;
  border-radius: var(--border-radius);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1;
  position: relative;
}

.detail-info h2 {
  font-size: 48px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.detail-info .meta {
  color: #b3b3b3;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.detail-info {
  position: relative;
  z-index: 1;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.track-list {
  margin-top: 32px;
}

.track-item {
  display: grid;
  grid-template-columns: 40px 1fr 80px;
  gap: 16px;
  padding: 12px;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  align-items: center;
  transition: background 0.2s;
}

.track-item:hover {
  background: #282828;
}

.track-number {
  color: #b3b3b3;
  text-align: center;
}

.track-info {
  display: flex;
  flex-direction: column;
}

.track-title {
  font-weight: 600;
}

.track-artist {
  color: #b3b3b3;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.track-artist:hover {
  color: var(--primary-color);
}

.track-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Play Options Menu */
.play-options-menu {
  background: var(--border-color);
  border: 1px solid #404040;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 10003;
  min-width: 160px;
  overflow: hidden;
}

.play-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.play-option:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #282828;
  color: white;
  padding: 16px 24px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
}

.modal-content {
  background: var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: #fff !important;
}
#storageUsageModal .modal-content, #storageUsageList {
  color: #fff !important;
}

/* Queue Modal */
.queue-modal {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #404040;
}

.modal-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
}

.modal-header-actions .btn-secondary {
  margin-bottom: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #404040;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #606060;
}

.close-btn {
  background: none;
  border: none;
  color: #b3b3b3;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.close-btn:hover {
  color: white;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  color: #fff;
}

.queue-section {
  margin-bottom: 32px;
}

.queue-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: #b3b3b3;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.queue-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 6px;
  transition: background 0.2s;
  margin-bottom: 8px;
  width: 100%;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.queue-item.now-playing {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.3);
}

@media (max-width: 768px) {
  .queue-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 8px;
  }
  
  .queue-item-info {
    width: 100%;
    text-align: center;
  }
  
  .queue-item-actions {
    align-self: flex-end;
    margin-top: 8px;
  }
}

.queue-item.newly-added {
  animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
  0%, 100% {
    background: transparent;
  }
  50% {
    background: rgba(29, 185, 84, 0.3);
  }
}

.queue-number {
  color: #b3b3b3;
  font-size: 14px;
  text-align: center;
  width: 24px;
}

.queue-item img {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-small);
  object-fit: cover;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-artist {
  color: #b3b3b3;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .queue-item-title {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
    font-size: 16px;
    margin-bottom: 4px;
  }
  
  .queue-item-artist {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
    font-size: 14px;
  }
}

.queue-item-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}

/* Playlist Selection Modal */
.playlist-selection-list {
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.playlist-selection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.playlist-selection-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.playlist-selection-info {
  flex: 1;
}

.playlist-selection-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.playlist-selection-count {
  color: #b3b3b3;
  font-size: 13px;
}

.playlist-selection-arrow {
  font-size: 20px;
  color: #b3b3b3;
}

.create-playlist-form {
  padding-top: 20px;
  border-top: 1px solid #404040;
  display: flex;
  gap: 12px;
}

.playlist-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #404040;
  color: white;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 14px;
  outline: none;
}

.playlist-input:focus {
  border-color: #1db954;
  background: rgba(255, 255, 255, 0.15);
}

.playlist-input::placeholder {
  color: #b3b3b3;
}

/* Playlist Search */
.add-songs-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #404040;
}

.add-songs-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: #b3b3b3;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.playlist-search-results {
  display: none;
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--border-radius);
  border: 1px solid #404040;
}

.search-result-item {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-result-item img {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-small);
  object-fit: cover;
}

.search-result-info {
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-artist {
  color: #b3b3b3;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Year and Genre Cards */
.year-card, .genre-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 16px;
  transition: all 0.3s;
  cursor: pointer;
  text-align: center;
}

.year-card:hover, .genre-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
}

.year-artwork, .genre-artwork {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg);
}

.year-title, .genre-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--text);
}

.year-count, .genre-count {
  font-size: 14px;
  color: #b3b3b3;
}

/* Alpha Slider */
.alpha-slider {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 8px 6px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: none;
}

.view.active .alpha-slider {
  display: flex;
}

.alpha-slider::-webkit-scrollbar {
  display: none;
}

.alpha-letter {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--border-radius-small);
  transition: all 0.2s;
  text-align: center;
  user-select: none;
}

.alpha-letter:hover {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.15);
}

.alpha-letter.active {
  background: var(--primary-color);
  color: #fff;
}

.alpha-letter.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px;
  scroll-margin-top: 100px;
}

.section-header:first-child {
  margin-top: 0;
}

.section-title {
  font-size: calc(var(--base-font-size) * 2);
  font-weight: calc(var(--base-font-weight) + 400);
  color: var(--primary-color);
  white-space: nowrap;
  min-width: 50px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), transparent);
  border: none;
}

/* Mobile Responsive Styles */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: var(--primary-color);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius);
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.mobile-overlay.active {
  display: block;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  #castBtn {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    z-index: 10004;
    display: block !important;
    visibility: visible !important;
  }
  
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 80px;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    min-height: -webkit-fill-available;
    overflow: hidden;
    transition: grid-template-rows 0.3s ease;
  }
  
  .app.player-expanded {
    grid-template-rows: 1fr 160px;
  }
  
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .main {
    grid-column: 1;
    grid-row: 1;
    padding: 16px;
    padding-top: 60px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  .player {
    grid-row: 2;
    height: auto;
    min-height: 80px;
    max-height: 80px;
    padding: 8px 12px;
    gap: 8px;
    position: relative;
    bottom: 0;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  .player.expanded {
    min-height: 160px;
    max-height: 160px;
    grid-template-rows: auto auto auto;
    cursor: default;
  }
  
  .player-info {
    min-width: auto;
    max-width: 50%;
    flex-shrink: 1;
    overflow: hidden;
    grid-column: 1;
    grid-row: 1;
  }
  
  .player-info img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .player-info div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  #playerTitle {
    font-size: calc(var(--base-font-size) * 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  
  #playerArtist {
    font-size: calc(var(--base-font-size) * 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  
  .player-controls {
    gap: 8px;
    justify-content: center;
    min-width: auto;
    grid-column: 2;
    grid-row: 1;
  }
  
  .player-controls button {
    font-size: 16px;
    padding: 4px;
  }
  
  #play {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .player-expand-btn {
    display: block !important;
    grid-column: 3;
    grid-row: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 4px;
    cursor: pointer;
    transition: color 0.2s;
    align-self: center;
  }
  
  .player-expand-btn:hover {
    color: var(--text-primary);
  }
  
  .player-right {
    min-width: auto;
    gap: 8px;
    justify-content: center;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    margin-top: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .player.expanded .player-right {
    opacity: 1;
    pointer-events: auto;
  }
  
  .player-progress {
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: auto;
    margin-top: 12px;
    font-size: calc(var(--base-font-size) * 0.75);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .player.expanded .player-progress {
    opacity: 1;
    pointer-events: auto;
  }
  
  #volume {
    max-width: 120px;
    min-width: 80px;
  }
  
  .songs-grid,
  .artists-grid,
  .albums-grid,
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .song-card img {
    height: 140px;
  }
  
  .detail-header {
    flex-direction: column;
    text-align: center;
    padding: 24px 16px !important;
    max-width: 100%;
    overflow: hidden;
    align-items: center;
    justify-content: center;
  }
  
  .detail-header img {
    width: 160px !important;
    height: 160px !important;
    margin-bottom: 16px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .detail-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .detail-actions {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }
  
  .detail-actions .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh;
    margin: 20px;
  }
  
  .modal-header {
    padding: 16px 12px;
  }
  
  .modal-header h2 {
    font-size: 18px;
  }
  
  .modal-body {
    padding: 12px;
  }
  
  .queue-item,
  .track-item {
    padding: 12px 8px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    position: relative;
  }
  
  .queue-item.now-playing {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
  }
  
  .queue-number,
  .track-number {
    min-width: 30px;
    font-size: 12px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
  }
  
  .queue-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  
  .queue-item img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: var(--border-radius-small);
  }
  
  .queue-item-info {
    text-align: center;
    width: 100%;
    overflow: hidden;
  }
  
  .queue-item-title {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .queue-item-artist {
    font-size: 11px;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .queue-item-actions {
    flex-shrink: 0;
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    padding: 4px;
    margin-top: 4px;
  }
  
  .settings-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .settings-label {
    width: 100%;
  }
  
  .settings-control {
    width: 100%;
  }
  
  h2 {
    font-size: calc(var(--base-font-size) * 1.8);
  }
  
  h3 {
    font-size: calc(var(--base-font-size) * 1.3);
  }
  
  .logo {
    font-size: calc(var(--base-font-size) * 1.1);
    margin-bottom: 16px;
  }
  
  .alpha-slider {
    display: flex;
    position: fixed;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 1px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 4px 2px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    max-height: calc(100vh - 200px);
    overflow: visible;
    font-size: 8px;
  }
  
  .alpha-letter {
    font-size: 8px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.1s;
    text-align: center;
    user-select: none;
    line-height: 1;
    min-height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .alpha-letter:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
  }
  
  .alpha-letter.active {
    background: var(--primary-color);
    color: #fff;
  }
  
  .card-actions {
    gap: 4px;
  }
  
  .action-btn {
    padding: 6px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .app {
    grid-template-rows: 1fr 160px;
  }
  
  .player {
    height: 160px;
    padding: 12px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .player-info {
    min-width: 100%;
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .player-info img {
    width: 48px;
    height: 48px;
  }
  
  #playerTitle {
    font-size: calc(var(--base-font-size) * 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  #playerArtist {
    font-size: calc(var(--base-font-size) * 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .player-controls {
    gap: 12px;
    justify-content: center;
    width: 100%;
  }
  
  .player-controls button {
    font-size: 22px;
    padding: 6px;
  }
  
  #play {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  .player-progress {
    width: 100%;
    order: -1;
    margin-bottom: 4px;
  }
  
  #volume {
    display: none;
  }
  
  .songs-grid,
  .artists-grid,
  .albums-grid,
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    max-width: 100%;
  }
  
  .player-expand-btn {
    display: block !important;
  }
  
  .song-card,
  .artist-card,
  .album-card,
  .playlist-card {
    min-width: 0;
    overflow: hidden;
    padding: 12px;
  }
  
  .song-card img,
  .artist-card img,
  .album-card img,
  .playlist-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    max-height: 120px;
    margin-bottom: 8px;
  }
  
  .song-title,
  .artist-name,
  .album-name {
    font-size: calc(var(--base-font-size) * 0.85);
    line-height: 1.2;
    margin-bottom: 2px;
  }
  
  .song-artist,
  .artist-count,
  .album-artist,
  .album-year {
    font-size: calc(var(--base-font-size) * 0.75);
    line-height: 1.1;
  }
  .album-year {
    font-size: calc(var(--base-font-size) * 0.8);
  }
}

/* Fullscreen Now Playing View */
.fullscreen-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-view.active {
  display: block;
  opacity: 1;
}

#visualizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.close-fullscreen {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 32px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.close-fullscreen:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.fullscreen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fullscreen-album-art {
  width: 300px;
  height: 300px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  margin-bottom: 40px;
  object-fit: cover;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.fullscreen-info {
  margin-bottom: 40px;
  width: 100%;
}

.fullscreen-title {
  font-size: 42px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.fullscreen-artist {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.fullscreen-progress {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 40px;
  color: white;
  font-size: 16px;
}

.fullscreen-progress input[type="range"] {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.fullscreen-progress input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fullscreen-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

.fullscreen-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.fullscreen-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

#fullscreenPlay {
  width: 80px;
  height: 80px;
  font-size: 32px;
  background: var(--primary-color);
}

#fullscreenPlay:hover {
  background: var(--primary-hover);
}

.fullscreen-controls button.active {
  background: var(--primary-color);
}

@media (max-width: 768px) {
  .fullscreen-album-art {
    width: 200px;
    height: 200px;
  }
  
  .fullscreen-title {
    font-size: 28px;
  }
  
  .fullscreen-artist {
    font-size: 18px;
  }
  
  .fullscreen-controls button {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  #fullscreenPlay {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
  
  .close-fullscreen {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}
