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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

h1 {
  color: white;
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8em;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.heading {
  font-size: 1.8em;
  color: #fff;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.audio-player {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  position: relative;
  overflow: hidden;
}

.audio-player::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  background-size: 300% 100%;
  animation: gradient 3s ease infinite;
}

@keyframes gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.track-info {
  text-align: center;
  margin-bottom: 25px;
}

.track-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
}

.track-artist {
  font-size: 1em;
  color: #7f8c8d;
}

.album-art {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: rotate 20s linear infinite;
  animation-play-state: paused;
}

.album-art.playing {
  animation-play-state: running;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.album-art::before {
  content: "♪";
  font-size: 2.5em;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.repeat-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 45px;
  margin-bottom: 20px;
}

.control-btn {
  background: none;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  color: #2c3e50;
  touch-action: manipulation;
}

.control-btn:hover {
  transform: scale(1.1);
  background: rgba(52, 152, 219, 0.1);
}

.control-btn.active {
  background: rgba(46, 204, 113, 0.2);
  color: #27ae60;
}

.play-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  width: 60px;
  height: 60px;
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.play-btn:hover {
  background: linear-gradient(135deg, #2980b9, #3498db);
  transform: scale(1.05);
}

.play-btn.active {
  background: rgba(46, 204, 113, 0.2);
  color: #27ae60;
}

.loop-btn.active,
.repeat-btn.active {
  background: rgba(46, 204, 113, 0.2);
  color: #27ae60;
}

.control-btn::before {
  font-size: 1.2em;
}

.prev-btn::before {
  content: "⏮";
}

.play-btn::before {
  content: "▶";
}

.play-btn.playing::before {
  content: "⏸";
}

.next-btn::before {
  content: "⏭";
}

.loop-btn::before {
  content: "🔁";
}

.loop-btn.active::before {
  content: "🔁";
}

.repeat-btn::before {
  content: "🔂";
}

.repeat-btn.active::before {
  content: "🔂";
}

.repeat-controls span {
  font-size: 0.9em;
  color: #2c3e50;
  margin-left: 5px;
}

.progress-container {
  margin-bottom: 20px;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: #7f8c8d;
  margin-bottom: 8px;
}

.progress-bar,
.volume-bar {
  width: 100%;
  height: 6px;
  background: #ecf0f1;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

.progress,
.volume-progress {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
  position: relative;
}

.progress {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.volume-progress {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.progress::after,
.volume-progress::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  background: #2980b9;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.volume-progress::after {
  background: #c0392b;
}

.progress-bar.dragging .progress::after,
.volume-bar.dragging .volume-progress::after {
  opacity: 1;
}

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

.volume-icon {
  color: #7f8c8d;
  font-size: 1.1em;
}

.playlist {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.playlist h2 {
  font-size: 1.3em;
  color: #2c3e50;
  margin-bottom: 15px;
  text-align: center;
}

.playlist ul {
  list-style: none;
}

.playlist li {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  min-height: 50px;
  position: relative;
  touch-action: manipulation;
}

.playlist li:hover {
  background: rgba(52, 152, 219, 0.1);
}

.playlist li.active {
  background: rgba(52, 152, 219, 0.2);
  font-weight: 600;
}

.move-buttons {
  display: flex;
  flex-direction: column;
  gap: 1px; /* Even tighter gap than 2px for closer stacking */
  margin-right: 10px;
}

.move-btn {
  background: none;
  border: none;
  width: 25px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9dc3ee;
  transition: color 0.3s ease;
  margin: 0; /* Remove any default margins */
}

.move-btn:hover {
  color: #3498db;
}

.move-btn.up {
  transform: rotate(-90deg);
}

.move-btn.down {
  transform: rotate(90deg);
}

.move-btn::before {
  content: "▶";
  font-size: 1em;
}

.repeat-icon {
  font-size: 1.2em;
  color: #e74c3c;
  margin-left: 10px;
  display: none;
}

.track-details {
  flex: 1;
}

.track-details .track-title {
  font-size: 1em;
}

.track-details .track-artist {
  font-size: 0.85em;
}

.play-icon {
  font-size: 1em;
  color: #3498db;
}

.reset-button {
  display: block;
  margin: 10px auto;
  padding: 10px 20px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.reset-button:hover {
  background-color: #c0392b;
}

.drag-drop-message {
  text-align: center;
  color: #fff;
  font-size: 0.9em;
  margin-top: 10px;
}

@media (max-width: 480px) {
  .volume-container {
    display: none;
  }

  .audio-player,
  .playlist {
    padding: 15px;
    margin: 10px;
  }

  .album-art {
    width: 100px;
    height: 100px;
  }

  .track-title {
    font-size: 1.2em;
  }

  .controls {
    gap: 8px;
  }

  .control-btn {
    width: 45px;
    height: 45px;
  }

  .play-btn {
    width: 55px;
    height: 55px;
  }

  .repeat-controls {
    gap: 10px;
  }

  .repeat-controls span {
    font-size: 0.8em;
  }

  .playlist li {
    padding: 10px;
    min-height: 60px;
  }

  .progress-bar,
  .volume-bar {
    height: 8px;
  }

  .progress::after,
  .volume-progress::after {
    width: 16px;
    height: 16px;
  }

  .move-btn {
    width: 36px;
    height: 16px;
  }

  .move-btn::before {
    font-size: 0.9em;
  }

  .repeat-icon {
    font-size: 1.4em;
  }

  .reset-button {
    padding: 8px 15px;
    font-size: 0.9em;
  }

  .drag-drop-message {
    font-size: 0.8em;
  }
}
