/* Basic page styles remain similar */
html, body {
  background: url("background.webp") no-repeat center center fixed;
  background-size: cover;  /* Make the image fill the viewport */
  background-color: #333;  /* fallback color if the image fails to load */
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  color: #fafafa;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

h1 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 2rem;
}

p {
  margin-bottom: 2rem;
}

#music-list {
  width: 90%;
  max-width: 600px;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Container for each track */
.track-item {
  /* Dark transparent background instead of solid white */
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  
  padding: 1rem;
  animation: fadeIn 0.6s ease forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.track-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Adjust text colors for readability on dark background */
.track-title {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  color: #fafafa; /* Brighter text */
}

.track-description {
  font-style: italic;
  color: #cccccc; /* Lighter grey on dark bg */
  margin-bottom: 1rem;
}

/* Custom audio player container */
.custom-audio-player {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Play/Pause Button */
.play-btn {
  position: relative;
  width: 40px; 
  height: 40px;
  border-radius: 50%;
  background-color: #1b8ceb;
  border: none;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.play-btn:hover {
  background-color: #1672bf;
  transform: scale(1.05);
}

.play-btn:focus {
  outline: 2px solid #1672bf;
}

/* --- PLAY ICON (triangle) --- */
.play-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0; 
  height: 0;
  border-left: 10px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

/* --- PAUSE ICON (two vertical bars) --- */
.play-btn.paused::before,
.play-btn.paused::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 4px;
  height: 16px;
  background: #fff;
  transform: translateY(-50%);
  border: none;
}

.play-btn.paused::before {
  left: 12px; /* first bar */
}

.play-btn.paused::after {
  left: 24px; /* second bar */
}

/* Progress bar */
.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #ccc;
  position: relative;
  cursor: pointer;
  transition: height 0.2s ease;
}

/* Grow the progress bar on hover */
.progress-bar:hover {
  height: 16px;
  border-radius: 5px;
}

.progress-fill {
  background: #1b8ceb;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* Download link (rounded button style) */
.download-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  color: #0066cc;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #0066cc;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.download-link:hover {
  background-color: #0066cc;
  color: #fff;
}

/* Time display */
.time-display {
  color: #fafafa; /* White text to show on dark background */
  width: 70px; /* enough space for mm:ss up to 99:99 */
  font-size: 0.9rem;
  text-align: right;
}

/* Footer styling (unchanged) */
footer {
  margin-top: auto;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  /*border: 1px solid rgba(255, 255, 255, 0.2);*/
  padding: 1rem 0;
  text-align: center;
}

footer p {
  margin: 0;
  color: #fafafa;
  font-size: 0.95rem;
}

/* FadeIn animation for each track */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
