:root {
  --primary: #1db954;
  --secondary: #9146ff;
  --bg: #0a0a0a;
  --card: #171717;
  --muted: #bdbdbd;
  --glass: rgba(255,255,255,0.04);
  --shadow: 0 14px 40px rgba(0,0,0,0.6);
  --volume-progress: 100%;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: #fff;
  padding-bottom: 200px;
  overflow-x: hidden;
}

/* ===== Background animation ===== */
.bg-animation {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 20% 80%, rgba(29,185,84,0.06) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(145,70,255,0.04) 0%, transparent 45%);
  pointer-events: none;
  filter: blur(.4px);
}

/* ===== Profile Dropdown Styles ===== */
.profile-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.profile-dropdown {
  position: relative;
  display: inline-block;
}

.profile-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50px;
  padding: 8px 16px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

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

.user-name {
  font-weight: 500;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.95);
  min-width: 180px;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  z-index: 1;
  overflow: hidden;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: #333;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.dropdown-content button:hover {
  background: rgba(0,0,0,0.05);
}

.dropdown-content i {
  width: 16px;
  text-align: center;
}

/* ===== Header ===== */
.page-title {
  text-align: center;
  margin: 18px 0;
  font-weight: 700;
  font-size: 1.9rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Filter Section ===== */
.filter-section {
  max-width: 1100px;
  margin: 12px auto;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.03);
  transition: all 0.3s ease;
}

/* When only 2 dropdowns are visible (centered) */
.filter-section.two-columns {
  max-width: 800px;
  padding: 10px;
}

.filter-label {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .92rem;
}
.form-select {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 8px;
}

/* ===== Search Bar ===== */
.search-container {
  max-width: 760px;
  margin: 12px auto 20px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}
.search-bar {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.03);
  color: #fff;
}

/* ===== Track List ===== */
main.music-section {
  max-width: 1100px;
  margin: 0 auto 160px;
  padding: 0 12px 40px;
}
.track.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
  scroll-margin-bottom: 140px;
}
.track.card:hover {
  transform: translateY(-4px);
  background: #222;
}
.track.playing {
  background: rgba(29,185,84,0.12);
  border-color: rgba(29,185,84,0.6);
}
.track-cover {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(29,185,84,0.25);
}
.track-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}
.track-artist {
  font-size: .9rem;
  color: var(--muted);
}

.track-download-btn {
  background: #232323;
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.track-download-btn:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.track-playlist-btn {
  background: #232323;
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
}
.track-playlist-btn:hover {
  background: var(--secondary);
  color: #000;
}

/* Make Create New Playlist text white */
.card-title {
  color: white !important;
}

/* Make playlist card titles white */
.playlist-card .card-title {
  color: white !important;
}

/* Make the create playlist button text white */
#createPlaylistBtn {
  color: white !important;
}

/* Make the back to playlists button text white */
#backToPlaylists {
  color: white !important;
}

/* Make current playlist title white */
#currentPlaylistTitle {
  color: white !important;
}

/* Make modal title white */
.modal-title {
  color: white !important;
}

/* Make modal content text white */
.modal-body {
  color: white !important;
}

/* Make the input placeholder text lighter */
#newPlaylistName::placeholder {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Make the input text white */
#newPlaylistName {
  color: white !important;
}

/* Make the playlist modal close button white */
.btn-close {
  filter: invert(1) !important;
  opacity: 0.8 !important;
}

/* Make the close button white on hover */
.btn-close:hover {
  filter: invert(1) !important;
  opacity: 1 !important;
}

/* Make playlist card info text white (track count and date) */
.playlist-card .card-text,
.playlist-info,
.playlist-meta {
    color: white !important;
    opacity: 0.9 !important;
}

/* Make any other text in playlist cards white */
.playlist-card small,
.playlist-card .text-muted {
    color: white !important;
    opacity: 0.8 !important;
}

/* Make the modal footer text white if needed */
.modal-footer {
    color: white !important;
}

/* Make all text in playlist cards white */
.card-body,
.card-body * {
    color: white !important;
}

/* Override any Bootstrap text-muted classes */
.text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Make empty state text white */
.empty-state h4,
.empty-state p {
    color: white !important;
    opacity: 0.9 !important;
}

/* Make track list text white */
.track-list,
.track-list * {
    color: white !important;
}

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

#noResults {
  color: #9aa0a6;
  margin: 12px 0;
  display: none;
}

/* Extra bottom margin for last few tracks to ensure they're accessible */
#trackList .col-md-6:last-child,
#trackList .col-md-6:nth-last-child(2),
#trackList .col-md-6:nth-last-child(3),
#trackList .col-md-6:nth-last-child(4) {
  margin-bottom: 25px;
}

/* ===== Player Bar ===== */
.player-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1180px;
  height: 96px;
  background: rgba(10,10,10,0.96);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 9999;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.03);
}

/* ===== Player Left ===== */
.player-left {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 260px;
  max-width: 360px;
  cursor: pointer;
  overflow: hidden;
}
.player-cover {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #222;
  flex-shrink: 0;
}
.song-meta { min-width: 0; overflow: hidden; }

/* ===== Song Title Animation ===== */
.song-title-container {
  width: 240px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: block;
}
#songTitleInner {
  display: inline-block;
  white-space: nowrap;
  padding-right: 6px;
  font-weight: 700;
  animation: none;
}
@keyframes scroll-title {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
.song-artist {
  color: var(--muted);
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Player Center ===== */
.player-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 12px;
}
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}
.control-btn {
  background: #232323;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .12s ease;
}
.control-btn:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.05);
}

/* ===== Active State for All Control Buttons ===== */
.control-btn.active {
    background: var(--primary) !important;
    color: #000 !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

/* ===== Volume Slider Styles ===== */
.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider-wrapper {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.volume-slider:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Webkit (Chrome, Safari, Edge) - Green Progress Line */
.volume-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--volume-progress, 100%), rgba(255, 255, 255, 0.2) var(--volume-progress, 100%), rgba(255, 255, 255, 0.2) 100%);
  border: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  margin-top: -4px;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--primary);
}

/* Firefox - Green Progress Line */
.volume-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
}

.volume-slider::-moz-range-progress {
  background: var(--primary);
  height: 4px;
  border-radius: 2px;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: var(--primary);
}

/* Big player volume slider adjustments */
.big-controls .volume-slider {
  width: 100px;
  height: 6px;
}

.big-controls .volume-slider::-webkit-slider-runnable-track {
  height: 6px;
}

.big-controls .volume-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
}

.big-controls .volume-slider::-moz-range-track {
  height: 6px;
}

.big-controls .volume-slider::-moz-range-progress {
  height: 6px;
}

.big-controls .volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
}

/* Ensure volume container is properly aligned in controls */
.controls .volume-container {
  margin-left: 5px;
}

/* ===== Progress Bar ===== */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 640px;
}
.time {
  min-width: 48px;
  text-align: center;
  color: #cfcfcf;
  font-size: 0.88rem;
}
#progress {
  position: relative;
  flex: 1;
  height: 8px;
  background: #222;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
#progressBar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,var(--primary),var(--secondary));
  border-radius: 6px;
  transition: width .12s linear;
}
#thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%,-50%);
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity .12s;
}
#progress:hover #thumb { opacity: 1; }

/* ===== Big Player Overlay ===== */
.big-player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  background: rgba(5,5,5,0.98);
  padding: 28px;
  z-index: 10000;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s, visibility .2s, transform .2s;
  transform: translateY(14px);
}
.big-player-overlay.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.big-cover img {
  width: min(420px,86vw);
  height: min(420px,86vw);
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}
.big-title {
  font-size: clamp(20px, 3.6vw, 36px);
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg,var(--primary),var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.big-artist { 
  color: var(--muted); 
  font-size: 1.2rem;
}
.big-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 880px;
}

/* Big player control buttons - all dark like small player */
.big-controls .control-btn {
    background: #232323 !important;
    color: #fff !important;
    font-size: 1.5rem;
    padding: 12px 20px;
    border-radius: 12px;
    min-width: 60px;
    height: 60px;
}

.big-controls .control-btn:hover {
    background: var(--primary) !important;
    color: #000 !important;
    transform: scale(1.15);
}

.big-controls .control-btn.active {
    background: var(--primary) !important;
    color: #000 !important;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.7);
}

.big-controls .add-to-playlist-btn {
  background: #232323 !important;
  color: #fff !important;
  font-size: 1.2rem;
  padding: 12px 20px;
  border-radius: 12px;
  min-width: 60px;
  height: 60px;
}

.big-controls .add-to-playlist-btn:hover {
  background: var(--secondary) !important;
  color: #000 !important;
  transform: scale(1.15);
}

/* Playlist Notifications */
.playlist-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    backdrop-filter: blur(10px);
}

.playlist-notification-success {
    background: rgba(29, 185, 84, 0.9);
    border: 1px solid rgba(29, 185, 84, 0.6);
}

.playlist-notification-error {
    background: rgba(220, 53, 69, 0.9);
    border: 1px solid rgba(220, 53, 69, 0.6);
}

/* Play button styles */
.play-playlist {
    background: rgba(29, 185, 84, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.play-playlist:hover {
    background: var(--primary);
    color: #ffffff !important;
}

.play-track {
    background: rgba(29, 185, 84, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.play-track:hover {
    background: var(--primary);
    color: #000;
}

/* Rename button styles */
.rename-playlist {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
    color: #ffc107;
}

.rename-playlist:hover {
    background: #ffc107;
    color: #000;
}

/* Ensure playlist cards display properly */
#playlistsContainer {
    display: flex;
    flex-wrap: wrap;
	color: #ffffff !important;
}

#noPlaylists {
    display: flex;
    flex-wrap: wrap;
	color: #ffffff !important;
}

#noPlaylists {
    display: flex;
    flex-wrap: wrap;
	color: #ffffff !important;
}

.playlist-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.playlist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.big-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 12px;
}
.big-progress {
  position: relative;
  flex: 1;
  height: 12px;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.big-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,var(--primary),var(--secondary));
  border-radius: 8px;
  transition: width .12s linear;
}
.big-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%,-50%);
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity .12s;
}
.big-progress:hover .big-thumb { opacity: 1; }

/* Close button for big player */
.big-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all .2s ease;
}
.big-close-btn:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.1);
}

/* ===== Playlist Styles ===== */
.playlist-menu-container {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 280px;
    max-width: 320px;
    max-height: 400px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.playlist-menu-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
}

.playlist-menu-header h6 {
    margin: 0;
    flex: 1;
    color: #fff;
    font-weight: 600;
}

.playlist-menu-close {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    color: #fff;
}

.playlist-menu-close:hover {
    opacity: 1;
}

.playlist-menu-body {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.playlist-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-menu-item:hover:not(.in-playlist) {
    background-color: rgba(255, 255, 255, 0.1);
}

.playlist-menu-item.in-playlist {
    color: var(--muted);
    cursor: not-allowed;
    background: rgba(29, 185, 84, 0.1);
}

.playlist-menu-item small {
    margin-left: auto;
    font-size: 12px;
}

.playlist-menu-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.playlist-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    backdrop-filter: blur(10px);
}

.playlist-message-success {
    background: rgba(29, 185, 84, 0.9);
    border: 1px solid rgba(29, 185, 84, 0.6);
}

.playlist-message-error {
    background: rgba(220, 53, 69, 0.9);
    border: 1px solid rgba(220, 53, 69, 0.6);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Player playlist buttons */
.player-actions {
    margin-left: 12px;
}

.playlist-btn, .big-playlist-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.playlist-btn:hover, .big-playlist-btn:hover {
    opacity: 1;
    background: var(--secondary);
    transform: scale(1.1);
}

/* Playlist page styles */
.playlist-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.empty-state {
    padding: 60px 20px;
    color: var(--muted);
}

.create-playlist-section .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal styles */
.track-list .track {
    transition: background-color 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--card);
}

.track-list .track:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.remove-track {
    opacity: 0.7;
    transition: opacity 0.2s;
    background: rgba(220, 53, 69, 0.2);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

.remove-track:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.4);
}

/* Back to library button */
.back-to-library {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px auto;
    font-weight: 500;
}

.back-to-library:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Playlist mode header */
.playlist-mode-header {
    text-align: center;
    margin: 20px 0;
}

.playlist-mode-header h1 {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    margin-bottom: 10px;
}

.playlist-info {
    color: var(--muted);
    font-size: 1rem;
}

/* ===== Modal Styles ===== */
.modal-content {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  color: #fff;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.modal-title {
  color: #fff;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 20px;
  color: #fff;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.playlist-option {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
}

.playlist-option.added {
  background: rgba(29, 185, 84, 0.1);
  border-color: var(--primary);
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #000;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 10000;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}

/* Responsive adjustments for playlist features */
@media (max-width: 768px) {
    .playlist-menu-container {
        min-width: 250px;
        max-width: 280px;
    }
    
    .track-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .track-playlist-btn, .track-download-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .playlist-btn, .big-playlist-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
}

/* Ensure playlist features work in both light and dark themes */
.playlist-menu-container *,
.playlist-message * {
    color: inherit;
}

/* Loading state for playlist operations */
.playlist-loading {
    opacity: 0.7;
    pointer-events: none;
}

.playlist-loading::after {
    content: '...';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body {
    padding-bottom: 240px;
  }
  
  .song-title-container { width: 140px; }
  .player-bar {
    padding: 12px;
    height: auto;
    flex-direction: column;
    gap: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
  }
  .player-left { width: 100%; justify-content: flex-start; }
  .player-center { width: 100%; margin: 8px 0; }
  
  .volume-slider {
    width: 60px;
  }
  
  .big-controls .volume-slider {
    width: 80px;
  }
  
  .big-player-overlay {
    padding: 20px;
  }
  .big-controls .control-btn {
    font-size: 1.2rem;
    padding: 10px 16px;
    min-width: 50px;
    height: 50px;
  }
  
  /* Mobile filter adjustments */
  .filter-section.two-columns {
    max-width: 100%;
    padding: 8px;
  }
  
  .filter-section .row.justify-content-center .col-md-4 {
    width: 100%;
    max-width: 300px;
    margin-bottom: 10px;
  }
  
  /* Stack controls vertically on very small screens */
  @media (max-width: 480px) {
    .big-controls .controls {
      flex-direction: column;
      gap: 8px;
    }
    
    .big-controls .volume-container {
      margin-left: 0;
      justify-content: center;
    }
  }
  
  /* Increase bottom margin on mobile for track list */
  main.music-section {
    margin-bottom: 180px;
  }
  
  .track.card {
    scroll-margin-bottom: 160px;
  }
  
  /* Extra bottom margin for last few tracks on mobile */
  #trackList .col-md-6:last-child,
  #trackList .col-md-6:nth-last-child(2),
  #trackList .col-md-6:nth-last-child(3),
  #trackList .col-md-6:nth-last-child(4) {
    margin-bottom: 35px;
  }
}

/* === Fix: allow scrolling until the last song === */
#trackList {
  padding-bottom: 110px;
}

@media (max-width: 768px) {
  #trackList {
    padding-bottom: 250px;
  }
}