/* =========================================================
   DJ Echarry — MixCard component styles
   ---------------------------------------------------------
   Shared premium mix-card look, used by both the main site's
   Mixes section (.mix-card-full) and the Link in Bio page
   (.mix-card-linkinbio). One card layout, driven by
   js/mix-card.js — do not fork this file per page.
   ========================================================= */

.mixes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mix-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  grid-template-areas: "media body play";
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(245, 241, 234, 0.03);
  transition: border-color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}

.mix-card > * {
  min-width: 0;
}

.mix-card:hover {
  border-color: var(--color-gold-soft);
  background: var(--color-bg-elevated);
}

/* ---- 16:9 media: ready for YouTube-style thumbnails ---------- */
.mix-card-media {
  grid-area: media;
  position: relative;
  width: 100%;
}

.mix-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 28% 22%, rgba(212, 175, 55, 0.22), transparent 62%),
    linear-gradient(160deg, #1c1917 0%, #0b0a09 100%);
  border: 1px solid var(--color-border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-soft);
  overflow: hidden;
}

.mix-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mix-card-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mix-card-cover-placeholder svg {
  width: clamp(44px, 9%, 72px);
  height: auto;
}

.mix-card-share-wrap {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
}

.mix-card-share {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-soft);
  background: rgba(8, 8, 8, 0.78);
  color: var(--color-text);
  backdrop-filter: blur(8px);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.mix-card-share:hover,
.mix-card-share:focus-visible,
.mix-card-share[aria-expanded="true"] {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.mix-card-share svg {
  width: 14px;
  height: 14px;
}

.mix-card-share-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: var(--space-2);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.mix-card-share-menu[hidden] {
  display: none;
}

.mix-card-share-menu button,
.mix-card-share-menu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.mix-card-share-menu button:hover,
.mix-card-share-menu button:focus-visible,
.mix-card-share-menu a:hover,
.mix-card-share-menu a:focus-visible {
  background: var(--color-gold-soft);
  color: var(--color-gold);
}

.mix-card-share-toast {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 5;
  padding: var(--space-2) var(--space-3);
  background: var(--color-gold);
  color: var(--color-bg);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.mix-card-share-toast[hidden] {
  display: none;
}

/* ---- Body column: DJ name / title / genres / meta ------------ */
.mix-card-body {
  grid-area: body;
}

.mix-card-dj {
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: var(--space-2);
}

.mix-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.mix-card-genres {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* ---- Waveform ----------------------------------------------------
   Decorative but stable per mix (see js/mix-card.js) — not a real
   audio analysis, so it's marked aria-hidden and isn't seekable.
   Idle: muted gray. Playing: gold, gentle staggered bounce. */
.mix-card-waveform {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
  width: 100%;
  margin-bottom: var(--space-3);
}

.mix-card-waveform span {
  flex: 1 1 0;
  min-width: 2px;
  height: var(--h, 30%);
  border-radius: 2px;
  background: var(--color-border);
  transform-origin: bottom;
  transition: background var(--dur-med) var(--ease-out);
}

.mix-card:hover .mix-card-waveform span {
  background: var(--color-gold-soft);
}

.mix-card-waveform.is-playing span {
  background: var(--color-gold);
}

@media (prefers-reduced-motion: no-preference) {
  .mix-card-waveform.is-playing span {
    animation: mix-waveform-bounce 1.1s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 0.035s);
  }
}

@keyframes mix-waveform-bounce {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1);
  }
}

.mix-card-meta {
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ---- Play button ------------------------------------------------ */
.mix-card-play {
  grid-area: play;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--color-gold);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-gold);
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.mix-card-play:hover,
.mix-card-play:focus-visible {
  background: var(--color-gold);
  color: var(--color-bg);
  transform: scale(1.05);
  box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.12);
}

.mix-card-play.is-playing {
  background: var(--color-gold);
  color: var(--color-bg);
  box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.16);
}

.mix-card-play svg {
  width: 19px;
  height: 19px;
}

.mix-card-play .icon-pause {
  display: none;
}

.mix-card-play.is-playing .icon-play {
  display: none;
}

.mix-card-play.is-playing .icon-pause {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .mix-card-play.is-playing {
    animation: mix-play-pulse 2.2s ease-in-out infinite;
  }
}

@keyframes mix-play-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.16);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.08);
  }
}

/* =========================================================
   Mobile — thumbnail stays beside the title, while the
   waveform and duration/play row use the full card width.
   ========================================================= */
@media (max-width: 640px) {
  .mix-card {
    grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
    grid-template-areas:
      "media dj"
      "media title"
      "media genres"
      "waveform waveform"
      "meta play";
    column-gap: var(--space-4);
    row-gap: var(--space-2);
    padding: var(--space-4);
  }

  .mix-card-media {
    align-self: start;
  }

  .mix-card-share-label {
    display: none;
  }

  .mix-card-share {
    padding: var(--space-2);
  }

  .mix-card-share-menu {
    right: 0;
  }

  .mix-card-body {
    display: contents;
  }

  .mix-card-dj {
    grid-area: dj;
  }

  .mix-card-title {
    grid-area: title;
    font-size: 1.15rem;
    margin-bottom: var(--space-1);
  }

  .mix-card-genres {
    grid-area: genres;
    margin-bottom: 0;
  }

  .mix-card-waveform {
    grid-area: waveform;
    margin: var(--space-2) 0 var(--space-1);
    height: 30px;
  }

  .mix-card-meta {
    grid-area: meta;
    align-self: center;
  }

  .mix-card-play {
    grid-area: play;
    justify-self: end;
    align-self: center;
    width: 46px;
    height: 46px;
  }

  .mix-card-play svg {
    width: 16px;
    height: 16px;
  }
}
