/* Importing Google Fonts - Sora */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Sora", sans-serif;
}

:root {
  --bg: #07070b;
  --text: #f6f6fb;
  --muted: #9a9ab0;
  --accent: #ff4d6d;
  --tint: #ff4d6d;
  --card-w: 260px;
  --card-h: 380px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* Background glow picks up the active slide colour */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 50% at 50% 35%, color-mix(in srgb, var(--tint) 35%, transparent), transparent 70%);
  transition: background 0.8s ease;
}

.coverflow-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 16px 60px;
}

.cf-head {
  text-align: center;
}

.cf-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tint);
  transition: color 0.6s ease;
}

.cf-head h1 {
  margin-top: 8px;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ---------- Coverflow stage ---------- */
.coverflow {
  position: relative;
  height: calc(var(--card-h) + 120px);
  margin-top: 30px;
  overflow-x: clip;
  outline: none;
  user-select: none;
  touch-action: pan-y;
}

.stage {
  position: absolute;
  inset: 0;
  perspective: 1200px;
  cursor: grab;
}

.stage.dragging {
  cursor: grabbing;
}

.slide {
  position: absolute;
  top: 30px;
  left: 50%;
  width: var(--card-w);
  height: var(--card-h);
  margin-left: calc(var(--card-w) / -2);
  border-radius: 20px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.7s ease,
    filter 0.7s ease;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  -webkit-box-reflect: below 10px linear-gradient(transparent 65%, rgba(0, 0, 0, 0.25));
}

.stage.dragging .slide {
  transition: none;
}

/* Poster artwork built with gradients + SVG */
.poster {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background: var(--art);
}

.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.75));
}

.poster svg {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 70%;
  transform: translateX(-50%);
  opacity: 0.9;
}

.poster-title {
  position: relative;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.poster-sub {
  position: relative;
  margin-top: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.poster-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

/* Shine sweep on the active slide */
.slide.active .poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.25) 45%, transparent 60%);
  transform: translateX(-100%);
  animation: shine 1.2s 0.4s ease forwards;
}

@keyframes shine {
  to {
    transform: translateX(100%);
  }
}

/* ---------- Arrows ---------- */
.arrow {
  position: absolute;
  top: calc(30px + var(--card-h) / 2);
  z-index: 50;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.arrow:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%) scale(1.08);
}

.arrow.prev {
  left: 8px;
}

.arrow.next {
  right: 8px;
}

/* ---------- Details ---------- */
.details {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.details > * {
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.details.changing > * {
  opacity: 0;
  transform: translateY(10px);
}

.meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag {
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 600;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 16%, transparent);
  transition:
    color 0.6s ease,
    background 0.6s ease;
}

.rating::before {
  content: "★ ";
  color: #fbbf24;
}

.title {
  margin: 12px 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.desc {
  color: var(--muted);
  line-height: 1.7;
}

.detail-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-play {
  color: #fff;
  background: var(--tint);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--tint) 45%, transparent);
  transition:
    background 0.6s ease,
    transform 0.2s ease;
}

.btn-list {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-list.added {
  color: #22c55e;
}

/* ---------- Dots + autoplay ---------- */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
}

.dots {
  display: flex;
  gap: 8px;
}

.dots button {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
  transition:
    width 0.35s ease,
    background 0.35s ease;
}

.dots button.active {
  width: 28px;
  background: var(--tint);
}

.autoplay {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
}

/* Ring that fills up until the next auto slide */
.progress-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--tint) calc(var(--p, 0) * 1turn), transparent 0);
  mask: radial-gradient(circle, transparent 15px, #000 16px);
  -webkit-mask: radial-gradient(circle, transparent 15px, #000 16px);
}

.icon-play,
.autoplay.paused .icon-pause {
  display: none;
}

.autoplay.paused .icon-play {
  display: inline;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  :root {
    --card-w: 200px;
    --card-h: 290px;
  }

  .arrow {
    width: 42px;
    height: 42px;
  }

  .poster-title {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .details > * {
    transition-duration: 0.01ms !important;
  }

  .slide.active .poster::after {
    animation: none;
  }
}
