/* === BASE STYLES === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 40px 20px 20px;
}

header h1 {
  color: #cc3830;
  font-size: 2.5rem;
  margin: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* === GRID LAYOUT === */
#songList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}

/* === SONG CARD === */
.song-card {
  background-color: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

/* === SHAKE ANIMATION === */
@keyframes tweak-out {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-2px, -1px) rotate(-1deg); }
  20% { transform: translate(2px, 1px) rotate(1deg); }
  30% { transform: translate(-2px, 1px) rotate(0deg); }
  40% { transform: translate(2px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(2px, -2px) rotate(0deg); }
  70% { transform: translate(-2px, -1px) rotate(1deg); }
  80% { transform: translate(1px, 2px) rotate(-1deg); }
  90% { transform: translate(-1px, -2px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.song-card:hover {
  animation: tweak-out 0.4s 3;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

/* === ALBUM ART === */
.song-art {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background-color: #2a2a2a;
}

/* === CARD CONTENT === */
.song-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.songTitle {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  color: #ffffff;
  font-weight: 600;
}

.song-desc {
  margin: 0 0 16px 0;
  color: #a0a0a0;
  font-size: 0.9rem;
  flex-grow: 1; 
  min-height: 3.2em; /* <-- ADD THIS LINE */
}

/* === CUSTOM AUDIO PLAYER === */
.custom-player {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 12px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0; /* Remove default gap */
}

.main-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  transition: margin-bottom 0.3s ease;
}

/* When volume is active, add space below main controls */
.custom-player.volume-active .main-controls {
  margin-bottom: 12px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  min-width: 32px;
  min-height: 32px;
}

.ctrl-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.ctrl-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.time-display {
  font-size: 0.85rem;
  font-family: monospace;
  color: #cccccc;
  flex-grow: 1;
  text-align: center;
  margin: 0 10px;
}

.vol-btn svg {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vol-btn.flipped svg {
  transform: scaleX(-1);
}

/* Volume slider row */
.vol-slider-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.custom-player.volume-active .vol-slider-row {
  max-height: 40px;
  opacity: 1;
  margin-top: 8px;
}

.vol-adjust-btn {
  font-size: 1.2rem;
  font-weight: bold;
  padding: 0 8px;
  line-height: 1;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 28px;
}

.vol-adjust-btn:hover {
  color: #cc3830;
}

.vol-slider {
  flex-grow: 1;
  max-width: 120px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #444;
  border-radius: 3px;
  outline: none;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #cc3830;
  border-radius: 50%;
  cursor: pointer;
}

.vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #cc3830;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
/* Update the slider container to align items nicely */
.vol-slider-container {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center; /* Centers buttons and slider vertically */
  justify-content: center;
  gap: 10px; /* Space between the minus, slider, and plus */
}

.vol-slider-container.active {
  height: 35px; /* Slightly taller to fit buttons nicely */
  opacity: 1;
}
/* Style the plus/minus buttons */
.vol-adjust-btn {
  font-size: 1.2rem;
  font-weight: bold;
  padding: 0 8px;
  line-height: 1;
}
/* Make the slider take up the remaining space between buttons */
.vol-slider {
  flex-grow: 1;
  max-width: 120px;
}
/* Remove default list styling and make it horizontal */
nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px; /* Adds space between the links */
}

/* Style the links */
nav a {
    text-decoration: none;
    color: inherit; /* Inherits text color from the body/header */
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline; /* Adds an underline when you hover over them */
}