* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #121212;
  color: #fff;
}

body.light-mode {
  background-color: #f5f5f5;
  color: #333;
}

.player-container {
  width: 350px;
  padding: 20px;
  background-color: #1a1a1a;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

body.light-mode .player-container {
  background-color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.player-header span {
  font-weight: 500;
  font-size: 16px;
}

.album-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.album-cover:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.visualizer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s;
}

.playing .visualizer {
  opacity: 1;
}

.visualizer-bar {
  width: 4px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}

@keyframes visualize1 { 0%, 100% { height: 10px; } 50% { height: 20px; } }
@keyframes visualize2 { 0%, 100% { height: 15px; } 50% { height: 25px; } }
@keyframes visualize3 { 0%, 100% { height: 10px; } 50% { height: 30px; } }
@keyframes visualize4 { 0%, 100% { height: 20px; } 50% { height: 15px; } }
@keyframes visualize5 { 0%, 100% { height: 15px; } 50% { height: 25px; } }

.playing .visualizer-bar:nth-child(1) { animation: visualize1 0.8s ease infinite; }
.playing .visualizer-bar:nth-child(2) { animation: visualize2 1.2s ease infinite; }
.playing .visualizer-bar:nth-child(3) { animation: visualize3 0.7s ease infinite; }
.playing .visualizer-bar:nth-child(4) { animation: visualize2 1.0s ease infinite; }
.playing .visualizer-bar:nth-child(5) { animation: visualize5 0.9s ease infinite; }

.song-info {
  text-align: center;
  margin-bottom: 20px;
}

.song-info h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #fff;
}

body.light-mode .song-info h2 {
  color: #333;
}

.song-info p {
  font-size: 16px;
  color: #aaa;
}

body.light-mode .song-info p {
  color: #777;
}

.player-progress {
  margin-bottom: 25px;
}

#progress-bar {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 10px;
}

body.light-mode #progress-bar {
  background: #ddd;
}

#progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #aaa;
}

body.light-mode .time-info {
  color: #777;
}

.player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.player-controls button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

.player-controls button:hover {
  color: #fff;
}

#play-btn {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #1DB954, #1aa34a);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(29, 185, 84, 0.3);
}

#play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(29, 185, 84, 0.4);
}

#play-btn:active {
  transform: scale(0.95);
}

.player-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-footer button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

.player-footer button:hover {
  color: #fff;
}

body.light-mode .player-footer button:hover {
  color: #333;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

#volume-slider {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 5px;
  cursor: pointer;
}

body.light-mode #volume-slider {
  background: #ddd;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.playlist {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100%;
  background-color: #1a1a1a;
  transition: right 0.3s ease;
  z-index: 10;
  padding: 20px;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

.playlist::-webkit-scrollbar {
  display: none; 
}

.playlist.active {
  right: 0;
}

body.light-mode .playlist {
  background-color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
  position: sticky;
  top: 0;
  background-color: #1a1a1a;
  z-index: 2;
}

body.light-mode .playlist-header {
  border-bottom: 1px solid #eee;
  background-color: #fff;
}

.playlist-header button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
}

.playlist-items {
  list-style: none;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 5px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.playlist-item:hover {
  background-color: #252525;
  transform: translateX(5px);
}

.playlist-item.active {
  background-color: #2a2a2a;
  border-left: 3px solid #1DB954;
  padding-left: 12px;
}

@keyframes equalizer {
  0% { height: 5px; }
  50% { height: 15px; }
  100% { height: 5px; }
}

.playlist-item.active::after {
  content: '';
  display: block;
  width: 3px;
  height: 15px;
  background-color: #1DB954;
  margin-left: 10px;
  animation: equalizer 0.8s ease-in-out infinite;
}

body.light-mode .playlist-item {
  border-bottom: 1px solid #eee;
}

body.light-mode .playlist-item:hover,
body.light-mode .playlist-item.active {
  background-color: #f2f2f2;
}

.playlist-item-info {
  display: flex;
  flex-direction: column;
}

.playlist-item-title {
  font-weight: 500;
  margin-bottom: 5px;
}

.playlist-item-artist {
  font-size: 12px;
  color: #aaa;
}

.playlist-item-duration {
  color: #aaa;
  font-size: 12px;
  margin-right: 10px;
}

.delete-song-btn {
  opacity: 0;
  color: #ff4d4d;
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  transition: opacity 0.2s;
}

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

.playlist-item .delete-song-btn:hover {
  color: #ff6666;
  transform: scale(1.2);
}

body.light-mode .playlist-item .delete-song-btn {
  color: #ff4d4d;
}

body.light-mode .playlist-item .delete-song-btn:hover {
  color: #ff6666;
}

.playback-rate {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.rate-btn {
  background: #2a2a2a;
  border: none;
  color: #aaa;
  border-radius: 15px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

body.light-mode .rate-btn {
  background: #eee;
  color: #777;
}

.rate-btn:hover {
  color: #fff;
  background: #333;
}

body.light-mode .rate-btn:hover {
  color: #333;
  background: #ddd;
}

.rate-btn.active {
  background: #1DB954;
  color: #fff;
}

body.light-mode .rate-btn.active {
  background: #1DB954;
  color: #fff;
}

.attribution {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-top: 5px;
  margin-bottom: 10px;
}

body.light-mode .attribution {
  color: #777;
}

/* Animation for the playing state */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.playing .album-cover .vinyl-disk {
  animation: rotate 20s linear infinite;
}

/* Button active states */
button.active {
  color: #1DB954 !important;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  z-index: 20;
}

#theme-toggle-btn {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

#theme-toggle-btn:hover {
  color: #fff;
}

body.light-mode #theme-toggle-btn:hover {
  color: #333;
}

#upload-btn {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

#upload-btn:hover {
  color: #fff;
}

body.light-mode #upload-btn:hover {
  color: #333;
}

.equalizer-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background-color: #1a1a1a;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
}

body.light-mode .equalizer-popup {
  background-color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.equalizer-popup.active {
  display: block;
}

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

.equalizer-header h3 {
  margin: 0;
  font-size: 18px;
}

.equalizer-header button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
}

.equalizer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eq-preset-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.eq-preset-btn {
  background: #2a2a2a;
  border: none;
  color: #aaa;
  border-radius: 15px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

body.light-mode .eq-preset-btn {
  background: #eee;
  color: #777;
}

.eq-preset-btn:hover {
  color: #fff;
  background: #333;
}

body.light-mode .eq-preset-btn:hover {
  color: #333;
  background: #ddd;
}

.eq-preset-btn.active {
  background: #1DB954;
  color: #fff;
}

.eq-sliders {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 150px;
}

.eq-slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30px;
}

.eq-slider {
  height: 120px;
  -webkit-appearance: none;
  appearance: none;
  width: 5px;
  background: #333;
  border-radius: 5px;
  outline: none;
  writing-mode: bt-lr; /* IE */
  -webkit-appearance: slider-vertical; /* WebKit */
}

body.light-mode .eq-slider {
  background: #ddd;
}

.eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  background: #1DB954;
  border-radius: 50%;
  cursor: pointer;
}

.eq-hz {
  margin-top: 8px;
  font-size: 10px;
  color: #aaa;
}