@font-face {
  font-family: "FFHand";
  src: url("../fonts/ffhand.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --ap-bg: #0a0a1a;
  --ap-accent: #ff355a;
  --ap-accent2: #ff6b81;
}

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

#audio-playlist {
  background-color: var(--ap-bg);
  background-image: var(--ap-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  position: relative;
  font-family: "FFHand", var(--font-family, "Titillium Web", sans-serif);
  color: #fff;
}

/* ---- FULLSCREEN BACKGROUND EQUALIZER ---- */

.bg-equalizer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  z-index: 0;
  pointer-events: none;
  padding: 0;
  opacity: 0.45;
  overflow: hidden;
  background: transparent;
}

.bg-equalizer .bg-bar {
  flex: 1 1 0;
  min-width: 40px;
  height: 4px;
  border-radius: 4px 4px 0 0;
  will-change: height, background, box-shadow;
}

.bg-equalizer.paused .bg-bar {
  height: 4px !important;
  opacity: 0.08;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
  transition: all 0.8s ease;
}

/* ---- Background glow orb ---- */

#bg-glow {
  position: fixed;
  top: 50%;
  left: 35%;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(345, 100%, 60%, 0.3) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.1;
  transform: translate(-50%, -50%);
  filter: blur(60px);
}

/* ---- HEADER: Title + Logo ---- */

.playlist-header {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 40px 0;
}

.playlist-title {
  flex: 1;
  text-align: center;
  font-size: 4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 53, 90, 0.5), 0 0 80px rgba(255, 53, 90, 0.2);
}

.header-logo {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  max-height: 70px;
  max-width: 180px;
  object-fit: contain;
  display: none;
}

/* ---- WRAPPER ---- */

#audio-playlist #wrapper {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.playlist-container {
  display: flex;
  width: 92%;
  max-width: 1800px;
  flex: 1;
  gap: 60px;
  align-items: center;
  margin: 0 auto;
}

/* ---- LEFT SIDE: Player image ---- */

.playlist-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cover-wrapper {
  width: 60vh;
  height: 60vh;
  max-width: 700px;
  max-height: 700px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: transform 0.08s ease-out, box-shadow 0.15s ease;
  will-change: transform, box-shadow;
}

.cover-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

#player-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- RIGHT SIDE: Song list ---- */

.playlist-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  will-change: transform, opacity;
}

/* ---- SONG ITEMS ---- */

.song-item {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 32px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.4s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.song-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 53, 90, 0.1), rgba(255, 107, 129, 0.04));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.song-item.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 53, 90, 0.3);
  box-shadow: 0 4px 30px rgba(255, 53, 90, 0.15);
}

.song-item.active::before {
  opacity: 1;
}

.song-item.inactive {
  opacity: 0.25;
  filter: grayscale(0.8);
  transform: scale(0.96);
}

.song-item.inactive:hover {
  opacity: 0.4;
  filter: grayscale(0.4);
}

/* Song cover */

.song-cover {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.4s ease;
  position: relative;
  z-index: 1;
}

.song-item.active .song-cover {
  box-shadow: 0 4px 25px rgba(255, 53, 90, 0.3);
}

/* Song info */

.song-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.song-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.song-artist {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.song-item.active .song-artist {
  color: rgba(255, 107, 129, 0.9);
}

.song-year {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.song-item.active .song-year {
  color: rgba(255, 255, 255, 0.4);
}

/* Song meta (right side of card) */

.song-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.song-length {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.3);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.song-item.active .song-length {
  color: rgba(255, 255, 255, 0.6);
}

.song-elapsed {
  font-size: 1rem;
  color: rgba(255, 53, 90, 0.7);
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
}

.song-progress-bar {
  width: 140px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.song-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ap-accent), var(--ap-accent2));
  border-radius: 3px;
  transition: width 0.3s linear;
}

.song-item.inactive .song-progress-bar,
.song-item.inactive .song-elapsed {
  visibility: hidden;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 1024px) {
  .playlist-container {
    flex-direction: column;
    height: auto;
    gap: 30px;
    padding: 40px 0;
  }

  .cover-wrapper {
    width: 40vh;
    height: 40vh;
  }

  .song-title {
    font-size: 1.6rem;
  }

  .song-cover {
    width: 80px;
    height: 80px;
  }

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