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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#music-player {
  max-width: 700px;
  width: 95%;
  padding: 30px;
  border-radius: 20px;
  position: relative;
  transition: all 0.3s ease;
}

#music-player.dark-mode {
  background: rgba(0, 0, 0, 0.85);
  color: #e0e0e0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#music-player.light-mode {
  background: rgba(238, 184, 200, 0.95);
  color: #333;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  font-size: 22px;
  color: inherit;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  transform: rotate(360deg);
}

#search-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 50px auto 25px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  width: 80%;
  max-width: 450px;
}

#search-input {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  outline: none;
  font-weight: 400;
}

#search-btn {
  padding: 10px;
  border: none;
  background: #007bff;
  color: white;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.3s ease;
}

#search-btn:hover {
  background: #0056b3;
}

#song-info {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
}

#album-art-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin-right: 25px;
}

#album-art {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#video-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  opacity: 1;
}

#song-details {
  flex: 1;
}

#song-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 5px;
}

#player {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#progress-container {
  width: 100%;
  margin-bottom: 5px;
}

#progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

#progress {
  height: 100%;
  background: #007bff;
  width: 0;
  border-radius: 3px;
  position: absolute;
  z-index: 2;
}

#wave-progress {
  height: 100%;
  width: 0;
  position: absolute;
  z-index: 1;
  background: linear-gradient(90deg, #007bff, #00c4ff);
  opacity: 0.7;
  animation: wave 1.5s linear infinite;
  background-size: 200% 100%;
}

@keyframes wave {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

#time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

#player-options {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 15px;
}

#loop-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

#loop-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.loop-count {
  font-size: 10px;
  margin-left: 2px;
  font-weight: bold;
}

#controls {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

#controls button {
  margin: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#controls button:hover {
  background: #007bff;
  color: white;
  transform: scale(1.1);
}

#play-pause-btn {
  padding: 18px;
  background: #007bff !important;
  color: white !important;
  transform: scale(1.1);
}

#play-pause-btn:hover {
  transform: scale(1.15);
}

#unavailable-message {
  text-align: center;
  font-size: 12px;
  color: #007bff;
  margin-top: 15px;
  font-weight: 500;
}

footer {
  position: fixed;
  bottom: 20px;
  width: 100%;
  text-align: center;
}

footer p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

@media (max-width: 600px) {
  #music-player {
      padding: 20px;
  }
  #album-art-container {
      width: 120px;
      height: 120px;
  }
  #song-title {
      font-size: 20px;
  }
  #controls button {
      padding: 12px;
      font-size: 18px;
  }
  #search-bar {
      padding: 3px;
      width: 90%;
      max-width: 350px;
      margin: 40px auto 20px;
  }
  #search-input {
      font-size: 13px;
      padding: 8px;
  }
  #search-btn {
      padding: 8px;
  }
}