/* soundtrack.css */
/* All shared styles have been moved to shared.css */

/* --- ALBUM COVER SPECIFIC STYLES --- */

/* Main container for the tracklist content */
.album-back {
  max-width: 600px;
  width: 90%;
  background-color: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 4px;
  padding: 2.5rem 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure the link on the title doesn't get default blue styling */
/* Update the existing .tracklist-title rule */
.tracklist-title {
  font-family: "Kaushan Script", cursive;
  font-weight: normal;
  font-size: 3rem; /* A good size for the album back */
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 2rem !important;
  color: #fff;
  transition: color 0.3s ease;
}

.tracklist-title:hover {
  color: #e0e0e0; /* Slight hover effect for the link */
}

/* Styling for the ordered list (tracklist) */
.tracklist {
  list-style: none;
  counter-reset: track-number; /* Initialize a counter */
  padding-left: 0;
  margin-bottom: 2rem;
}

.tracklist li {
  counter-increment: track-number; /* Increment the counter for each li */
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  /* Add padding and a transition for a smooth hover effect */
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-left: -0.75rem; /* Offset padding to maintain alignment */
  margin-right: -0.75rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tracklist li:hover {
  background-color: rgba(0, 0, 0, 0.3);
  color: #fff; /* Make text brighter on hover */
}

/* Style the track number using the counter */
.tracklist li::before {
  content: counter(
    track-number,
    decimal-leading-zero
  ); /* Display counter with leading zero */
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  min-width: 40px; /* Ensures alignment */
  text-align: right;
  margin-right: 1.25rem;
}

.album-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: rgba(255, 255, 255, 0.6);
}

.copyright {
  font-size: 0.75rem;
  line-height: 1.5;
}

.barcode {
  height: 40px;
  width: 120px;
  display: flex;
  align-items: flex-end; /* Aligns bars to the bottom */
}

.barcode span {
  display: block;
  background-color: #e0e0e0;
  width: 2px;
  margin-right: 1px;
}

/* Varying heights for barcode bars */
.barcode span:nth-child(2n) {
  height: 100%;
}
.barcode span:nth-child(3n) {
  height: 85%;
}
.barcode span:nth-child(4n) {
  height: 70%;
}
.barcode span:nth-child(5n) {
  height: 90%;
}
.barcode span:nth-child(7n) {
  height: 75%;
}
.barcode span:nth-of-type(1),
.barcode span:nth-of-type(24) {
  height: 100%;
  width: 3px;
}

/* --- ENTRANCE ANIMATION (Adapted for new elements) --- */
.tracklist-title,
.tracklist li,
.album-footer {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.container.is-visible .tracklist-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

/* Staggered animation for each tracklist item */
.container.is-visible .tracklist li {
  opacity: 1;
  transform: translateY(0);
}

/* IMPROVEMENT: Using a loop-like structure with CSS variables for cleaner, more maintainable staggered delays */
.container.is-visible .tracklist li:nth-child(1) {
  transition-delay: calc(0.3s + 1 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(2) {
  transition-delay: calc(0.3s + 2 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(3) {
  transition-delay: calc(0.3s + 3 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(4) {
  transition-delay: calc(0.3s + 4 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(5) {
  transition-delay: calc(0.3s + 5 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(6) {
  transition-delay: calc(0.3s + 6 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(7) {
  transition-delay: calc(0.3s + 7 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(8) {
  transition-delay: calc(0.3s + 8 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(9) {
  transition-delay: calc(0.3s + 9 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(10) {
  transition-delay: calc(0.3s + 10 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(11) {
  transition-delay: calc(0.3s + 11 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(12) {
  transition-delay: calc(0.3s + 12 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(13) {
  transition-delay: calc(0.3s + 13 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(14) {
  transition-delay: calc(0.3s + 14 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(15) {
  transition-delay: calc(0.3s + 15 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(16) {
  transition-delay: calc(0.3s + 16 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(17) {
  transition-delay: calc(0.3s + 17 * 0.05s);
}
.container.is-visible .tracklist li:nth-child(18) {
  transition-delay: calc(0.3s + 18 * 0.05s);
}

.container.is-visible .album-footer {
  opacity: 1;
  transform: translateY(0);
  /* Animate the footer last, after the longest list item delay */
  transition-delay: 1.4s;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .album-back {
    /* Reduce padding on smaller screens */
    padding: 2rem 1.5rem;
  }

  .tracklist-title {
    font-size: 2.5rem;
  }

  .tracklist li {
    font-size: 1rem;
  }

  .tracklist li::before {
    margin-right: 1rem;
    min-width: 30px;
  }

  .album-footer {
    /* Stack the footer elements vertically */
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Add space between the stacked items */
    text-align: center;
  }
}
