/* ============================================================
 * animations.css — site-wide motion polish
 * ------------------------------------------------------------
 * Subtle, tasteful motion tuned to the dark deathcore aesthetic:
 * slow ease-outs, low-opacity fades, small translations, and a
 * faint red-glow on interactive focus. Kept in one file so it's
 * easy to tune or disable, and fully gated behind
 * prefers-reduced-motion for accessibility.
 *
 * Loaded AFTER the bundle + auth CSS so these transitions layer
 * on top without fighting layout. Nothing here changes position
 * or size at rest — only motion on hover/tap/entrance.
 * ============================================================ */

/* Respect users who ask for less motion: no entrance animation,
   no transforms — everything renders in its final state. */
@media (prefers-reduced-motion: reduce) {
  .anim-rise, .anim-fade, .header-artist,
  #play-btn, #prev-btn, #next-btn, #like-btn {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-motion: no-preference) {

  /* ---------- ENTRANCE ANIMATIONS ---------- */
  /* A slow, low fade-and-rise for major sections/cards on first
     paint. Applied via the .anim-rise / .anim-fade helper classes
     (added in the page HTML or by script). Staggered children use
     inline animation-delay or the nth-child rules below. */
  @keyframes dsrRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes dsrFade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .anim-rise {
    animation: dsrRise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .anim-fade {
    animation: dsrFade 0.9s ease-out both;
  }

  /* Header artist nav: each name fades/rises in with a slight
     stagger so the row assembles rather than snapping in. */
  .site-header .header-artist {
    animation: dsrRise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .site-header .header-artist:nth-child(1) { animation-delay: 0.02s; }
  .site-header .header-artist:nth-child(2) { animation-delay: 0.07s; }
  .site-header .header-artist:nth-child(3) { animation-delay: 0.12s; }
  .site-header .header-artist:nth-child(4) { animation-delay: 0.17s; }
  .site-header .header-artist:nth-child(5) { animation-delay: 0.22s; }
  .site-header .header-artist:nth-child(6) { animation-delay: 0.27s; }
  .site-header .header-artist:nth-child(7) { animation-delay: 0.32s; }

  /* ---------- HOVER / TAP FEEDBACK ---------- */

  /* Nav artist names: brighten + a hair of lift on hover; the
     current one already has full opacity so this reads as a gentle
     "wake" on the dimmed siblings. */
  .site-header .header-artist {
    transition: opacity 0.2s ease, transform 0.2s ease,
                text-shadow 0.25s ease;
  }
  .site-header .header-artist:hover {
    opacity: 1;
    transform: translateY(-1px);
    text-shadow: 0 0 10px rgba(192, 0, 0, 0.55);
  }

  /* BOOKING / sign-in / generic auth buttons: subtle raise and a
     faint red glow on hover, quick press-down on active. */
  .ds-booking-link,
  .auth-btn {
    transition: transform 0.16s ease, box-shadow 0.2s ease,
                background 0.2s ease, color 0.2s ease;
  }
  .ds-booking-link:hover,
  .auth-btn:hover {
    transform: translateY(-1px);
  }
  .ds-booking-link:active,
  .auth-btn:active {
    transform: translateY(0) scale(0.98);
  }

  /* Transport controls (play/prev/next/like): scale + glow on hover,
     a satisfying press on tap. These are the most-touched controls,
     so the feedback is a touch more pronounced (still subtle). */
  #play-btn, #prev-btn, #next-btn, #like-btn {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.2s ease, opacity 0.2s ease;
  }
  #play-btn:hover, #prev-btn:hover, #next-btn:hover, #like-btn:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 0 6px rgba(192, 0, 0, 0.5));
  }
  #play-btn:active, #prev-btn:active, #next-btn:active, #like-btn:active {
    transform: scale(0.92);
  }

  /* Like button, when active/liked, gets a one-shot pulse. Toggle
     the .just-liked class from script on like to trigger it. */
  @keyframes dsrLikePulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); filter: drop-shadow(0 0 10px rgba(192, 0, 0, 0.8)); }
    100% { transform: scale(1); }
  }
  #like-btn.just-liked {
    animation: dsrLikePulse 0.45s ease-out;
  }

  /* Comment cue (mobile): gentle brighten on tap. */
  .player-comment-cue {
    transition: opacity 0.15s ease, transform 0.15s ease,
                filter 0.2s ease;
  }
  .player-comment-cue:hover {
    filter: drop-shadow(0 0 5px rgba(192, 0, 0, 0.5));
  }

  /* ---------- PLAYER BAR ---------- */

  /* (Bar entrance animation removed — it used animation-fill-mode: both,
     which left a persistent transform on .player-bar. That transform
     created a stacking context that made the now-playing logo paint over
     the track list on desktop. Not worth a layout bug for an entrance.) */

  /* Now-playing title: when it changes track, a soft cross-fade.
     Toggle .track-changing from script right before swapping text
     to get the fade; it eases back to full on its own. */
  .player-title-text {
    transition: opacity 0.35s ease;
  }
  .player-title-text.track-changing {
    opacity: 0;
  }

  /* Track rows in the queue: hover brings a faint red wash and a
     small inward nudge, so the list feels responsive to the cursor. */
  .track-row {
    transition: background 0.2s ease, transform 0.16s ease;
  }
  .track-row:hover {
    background: rgba(192, 0, 0, 0.06);
    transform: translateX(2px);
  }

  /* (Cover breathing glow removed — it was applying box-shadow/animation to
     the now-playing logo elements and interfered with the desktop player
     bar layout, overlapping the track list.) */

  /* Progress-fill: a subtle sheen so the played portion feels lit. */
  .progress-fill {
    transition: width 0.12s linear;
  }
}
