:root {
  --primary: #121212;
  --secondary: #282828;
  --accent: #1db954;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
}

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

/* Base responsive adjustments */
html {
  font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--primary);
  color: var(--text);
  min-height: 100vh;
}

.title-section {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(to right, var(--accent), #4a90e2);
  margin-bottom: 2rem;
  padding: clamp(1rem, 4vw, 2rem);
}

.app-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.app-subtitle {
  font-size: 1.1rem;
  color: var(--text);
  opacity: 0.9;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.container {
  display: grid;
  grid-template-columns: 1fr;
  padding: 2rem;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
  gap: clamp(1rem, 3vw, 2rem);
}

.player {
  background: var(--secondary);
  padding: 2rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: clamp(1rem, 3vw, 2rem);
}

.artwork-container {
  width: 300px;
  height: 300px;
  position: relative;
  width: clamp(200px, 50vw, 300px);
  height: clamp(200px, 50vw, 300px);
}

.artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  animation: rotate 20s linear infinite paused;
}

.artwork.playing {
  animation-play-state: running;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

.track-info {
  text-align: center;
}

.track-info h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.track-info p {
  color: var(--text-secondary);
}

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s;
  padding: clamp(0.5rem, 2vw, 1rem);
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.control-btn:hover {
  transform: scale(1.1);
  color: var(--accent);
}

.play-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent);
  font-size: 1.5rem;
  width: clamp(2.5rem, 8vw, 3rem);
  height: clamp(2.5rem, 8vw, 3rem);
}

.play-btn:hover {
  transform: scale(1.05);
  background: #1ed760;
}

.volume-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: #4f4f4f;
  border-radius: 5px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.playlist {
  background: var(--secondary);
  padding: 1rem;
  border-radius: 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.playlist h2 {
  margin-bottom: 1rem;
}

.track-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  gap: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 0.5rem;
  padding: clamp(0.5rem, 2vw, 0.75rem);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.track-item.active {
  background: rgba(29, 185, 84, 0.2);
}

.track-item img {
  width: 50px;
  height: 50px;
  border-radius: 0.25rem;
  object-fit: cover;
  width: clamp(40px, 10vw, 50px);
  height: clamp(40px, 10vw, 50px);
}

@media (max-width: 480px) {
  .progress-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .volume-container {
    flex-direction: column;
    align-items: center;
  }

  .track-info h1 {
    font-size: 1.2rem;
  }

  .track-info p {
    font-size: 0.9rem;
  }

  .playlist h2 {
    font-size: 1.2rem;
  }
}

@media (min-width: 481px) and (max-width: 1023px) {
  .container {
    grid-template-columns: 1fr;
    max-width: 768px;
  }

  .playlist {
    max-height: 300px;
    overflow-y: auto;
  }
}

@media (min-width: 1024px) {
  .container {
    grid-template-columns: 3fr 1fr;
  }

  .playlist {
    max-height: 80vh;
    overflow-y: auto;
  }
}

@media (hover: none) {
  .control-btn:active {
    transform: scale(0.95);
  }

  .track-item:active {
    background: rgba(255, 255, 255, 0.15);
  }

  input[type="range"] {
    height: 10px; /* Larger touch target */
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 1024px) {
  .container {
    grid-template-columns: 3fr 1fr;
  }
}

.footer {
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
  background: var(--secondary);
  color: var(--text-secondary);
}

.footer p {
  font-size: 0.9rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer a:hover {
  opacity: 0.8;
}
