:root {
  --primary: #ff2d2d;
  --primary-dark: #cc2424;
  --bg-dark: #0a0a0b;
  --bg-darker: #080809;
  --bg-light: #1e1e22;
  --text: #f0f0f0;
  --text-secondary: #a0a0a0;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  padding-bottom: 180px; /* Space for the sticky player */
}

h1 {
  color: var(--primary);
  text-align: center;
  margin: 1.5rem 0 2rem;
  font-size: 2.2rem;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(255, 45, 45, 0.2);
  letter-spacing: -0.5px;
}

/* Playlist Styles */
#playlist {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

#playlist .track {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 1rem;
  color: var(--text);
  backdrop-filter: blur(5px);
}

#playlist .track:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(5px);
}

#playlist .track.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 45, 45, 0.3);
  border-color: var(--primary);
}

#playlist .track-number {
  display: inline-block;
  width: 24px;
  text-align: center;
  margin-right: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

#playlist .active .track-number {
  color: rgba(255, 255, 255, 0.8);
}

/* Player Styles */
.player-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 20, 24, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem 0;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.player-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.track-info {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.controls button {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
  background: rgba(255, 255, 255, 0.05);
}

.controls button:active {
  transform: scale(0.95);
}

#playPauseBtn {
  width: 60px;
  height: 60px;
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(255, 45, 45, 0.3);
}

#playPauseBtn:hover {
  background: var(--primary-dark) !important;
  transform: scale(1.05);
}

#prevBtn, #nextBtn {
  font-size: 1.5rem;
}

#loopBtn {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  background: transparent !important;
}

#loopBtn.active {
  color: var(--primary);
  background: transparent;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 0.5rem 0 1rem;
  cursor: pointer;
  transition: height 0.2s;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-container:hover {
  height: 6px;
}

/* Custom Audio Element */
audio {
  display: none; /* Hide default audio controls */
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    padding-bottom: 180px;
  }
  
  h1 {
    font-size: 1.8rem;
    margin: 1rem 0 1.5rem;
  }
  
  #playlist .track {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }
  
  .controls {
    gap: 1rem;
  }
  
  .controls button {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  
  #playPauseBtn {
    width: 56px;
    height: 56px;
  }
  
  #loopBtn {
    width: 32px;
    height: 32px;
    right: 1rem;
  }
}

/* Animation for active state */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.playing #playPauseBtn {
  animation: pulse 2s infinite;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
