/*
 * amplitude-suno.css
 * A Suno.com-inspired dark theme for AmplitudeJS
 * Drop this in after your existing stylesheet (or replace it).
 *
 * Covers all standard AmplitudeJS elements:
 *  - #amplitude-player  (bottom fixed bar)
 *  - #amplitude-left    (album art + song info)
 *  - #amplitude-center  (transport controls + progress)
 *  - #amplitude-right   (volume + extras)
 *  - #amplitude-playlist / .amplitude-song-container (track list rows)
 *  - All interactive elements: play/pause, prev, next, shuffle, repeat,
 *    progress bar, volume slider, mute button
 *  - All metadata elements: song name, artist, album, time, album art
 *
 * If your IDs/classes differ slightly, search-replace to match.
 * Google Fonts import — add this to your <head> if not already present:
 * <link href="https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
 */

/* ─── TOKENS ─────────────────────────────────────────────────────────── */
:root {
  --amp-bg:          #0d0d0f;
  --amp-surface:     #141416;
  --amp-surface2:    #1c1c1f;
  --amp-surface3:    #242428;
  --amp-border:      rgba(255,255,255,0.07);
  --amp-border-hover:rgba(255,255,255,0.15);
  --amp-accent:      #e8ff47;       /* Suno lime-yellow */
  --amp-accent-dim:  rgba(232,255,71,0.12);
  --amp-red:         #ff6b6b;
  --amp-text:        #f0f0f0;
  --amp-muted:       #6b6b75;
  --amp-muted2:      #3a3a42;
  --amp-font-display:'Syne', sans-serif;
  --amp-font-body:   'DM Sans', sans-serif;
  --amp-bar-h:       80px;
  --amp-radius:      10px;
  --amp-transition:  0.15s ease;
}

/* ─── GLOBAL RESETS FOR PLAYER SCOPE ─────────────────────────────────── */
#amplitude-player *,
#amplitude-playlist * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   BOTTOM NOW-PLAYING BAR  (#amplitude-player)
   ═══════════════════════════════════════════════════════════════════════ */

#amplitude-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--amp-bar-h);
  background: rgba(20, 20, 22, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--amp-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  z-index: 9999;
  font-family: var(--amp-font-body);
}

/* If you have a full-page player wrapper instead of fixed bar,
   swap `position:fixed` for `position:relative` and remove `bottom/left/right`. */

/* ─── LEFT SECTION: album art + song info ─── */
#amplitude-left,
.amplitude-player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 260px;
  min-width: 200px;
  flex-shrink: 0;
}

/* Album art */
#amplitude-player img.amplitude-album-art,
.amplitude-album-art {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--amp-surface3);
  display: block;
}

/* Song info container */
.amplitude-song-info,
#amplitude-song-info {
  min-width: 0;
  flex: 1;
}

/* Song name */
[data-amplitude-song-info="name"],
.amplitude-song-name,
span[amplitude-song-info="name"] {
  font-family: var(--amp-font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--amp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Artist */
[data-amplitude-song-info="artist"],
.amplitude-song-artist,
span[amplitude-song-info="artist"] {
  font-size: 0.75rem;
  color: var(--amp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* Album */
[data-amplitude-song-info="album"],
.amplitude-song-album,
span[amplitude-song-info="album"] {
  font-size: 0.7rem;
  color: var(--amp-muted2);
  display: block;
  margin-top: 1px;
}

/* ─── CENTER SECTION: controls + progress ─── */
#amplitude-center,
.amplitude-player-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Transport buttons row */
.amplitude-controls,
.amplitude-transport {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ─── BASE BUTTON STYLE (shared by all control btns) ─── */
#amplitude-player button,
#amplitude-player [data-amplitude-function] {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--amp-transition);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* ─── SHUFFLE ─── */
#amplitude-shuffle,
.amplitude-shuffle {
  color: var(--amp-muted);
  font-size: 0.85rem;
  padding: 6px;
  border-radius: var(--amp-radius);
}
#amplitude-shuffle:hover,
.amplitude-shuffle:hover {
  color: var(--amp-text);
}
#amplitude-shuffle.amplitude-shuffle-on,
.amplitude-shuffle-on {
  color: var(--amp-accent);
}

/* ─── PREVIOUS ─── */
#amplitude-prev,
.amplitude-prev {
  color: var(--amp-muted);
  font-size: 1rem;
  padding: 6px;
  border-radius: var(--amp-radius);
}
#amplitude-prev:hover,
.amplitude-prev:hover {
  color: var(--amp-text);
  transform: scale(1.08);
}

/* ─── PLAY / PAUSE ─── */
#amplitude-play-pause,
.amplitude-play-pause,
[data-amplitude-function="play_pause"] {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  background: var(--amp-text) !important;
  color: #000 !important;
  font-size: 1rem;
  transition: all var(--amp-transition);
}
#amplitude-play-pause:hover,
.amplitude-play-pause:hover,
[data-amplitude-function="play_pause"]:hover {
  background: var(--amp-accent) !important;
  transform: scale(1.06);
}

/* AmplitudeJS toggles a `playing` class when audio is active */
#amplitude-play-pause.amplitude-playing,
.amplitude-play-pause.amplitude-playing,
[data-amplitude-function="play_pause"].amplitude-playing {
  background: var(--amp-accent) !important;
  color: #000 !important;
}

/* ─── NEXT ─── */
#amplitude-next,
.amplitude-next {
  color: var(--amp-muted);
  font-size: 1rem;
  padding: 6px;
  border-radius: var(--amp-radius);
}
#amplitude-next:hover,
.amplitude-next:hover {
  color: var(--amp-text);
  transform: scale(1.08);
}

/* ─── REPEAT ─── */
#amplitude-repeat,
.amplitude-repeat {
  color: var(--amp-muted);
  font-size: 0.85rem;
  padding: 6px;
  border-radius: var(--amp-radius);
}
#amplitude-repeat:hover,
.amplitude-repeat:hover {
  color: var(--amp-text);
}
#amplitude-repeat.amplitude-repeat-on,
.amplitude-repeat-on {
  color: var(--amp-accent);
}

/* ─── PROGRESS BAR ─── */
.amplitude-progress-container,
#amplitude-progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 500px;
}

/* Current time */
.amplitude-current-time,
#amplitude-current-time,
span.amplitude-current-minutes,
span.amplitude-current-seconds {
  font-size: 0.7rem;
  color: var(--amp-muted);
  font-family: var(--amp-font-body);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

/* Duration time */
.amplitude-duration,
#amplitude-duration,
span.amplitude-duration-minutes,
span.amplitude-duration-seconds {
  font-size: 0.7rem;
  color: var(--amp-muted);
  font-family: var(--amp-font-body);
  white-space: nowrap;
  min-width: 28px;
}

/* The range/progress bar AmplitudeJS uses:
   class="amplitude-song-played-progress" on an <input type="range"> or a <progress>  */
input[type="range"].amplitude-song-played-progress,
progress.amplitude-song-played-progress,
.amplitude-song-played-progress {
  flex: 1;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--amp-surface3);
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  border: none;
  transition: height var(--amp-transition);
}
input[type="range"].amplitude-song-played-progress:hover,
.amplitude-song-played-progress:hover {
  height: 5px;
}

/* Webkit track fill */
input[type="range"].amplitude-song-played-progress::-webkit-slider-runnable-track {
  background: var(--amp-surface3);
  height: 3px;
  border-radius: 3px;
}
input[type="range"].amplitude-song-played-progress:hover::-webkit-slider-runnable-track {
  height: 5px;
}

/* Webkit thumb */
input[type="range"].amplitude-song-played-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  margin-top: -4.5px;
  opacity: 0;
  transition: opacity var(--amp-transition);
  cursor: pointer;
}
input[type="range"].amplitude-song-played-progress:hover::-webkit-slider-thumb {
  opacity: 1;
  margin-top: -3.5px;
}

/* Firefox */
input[type="range"].amplitude-song-played-progress::-moz-range-track {
  background: var(--amp-surface3);
  height: 3px;
  border-radius: 3px;
}
input[type="range"].amplitude-song-played-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border: none;
  border-radius: 50%;
  opacity: 0;
  cursor: pointer;
}
input[type="range"].amplitude-song-played-progress:hover::-moz-range-thumb {
  opacity: 1;
}

/* Progress element fallback */
progress.amplitude-song-played-progress {
  color: var(--amp-text);
}
progress.amplitude-song-played-progress::-webkit-progress-bar {
  background: var(--amp-surface3);
  border-radius: 3px;
}
progress.amplitude-song-played-progress::-webkit-progress-value {
  background: var(--amp-text);
  border-radius: 3px;
}
progress.amplitude-song-played-progress::-moz-progress-bar {
  background: var(--amp-text);
  border-radius: 3px;
}

/* ─── RIGHT SECTION: volume, extras ─── */
#amplitude-right,
.amplitude-player-right {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 180px;
  flex-shrink: 0;
  justify-content: flex-end;
}

/* ─── MUTE BUTTON ─── */
#amplitude-mute,
.amplitude-mute,
[data-amplitude-function="mute"] {
  color: var(--amp-muted);
  font-size: 0.85rem;
  padding: 6px;
  border-radius: var(--amp-radius);
}
#amplitude-mute:hover,
.amplitude-mute:hover {
  color: var(--amp-text);
}
#amplitude-mute.amplitude-muted,
.amplitude-muted {
  color: var(--amp-muted2);
}

/* ─── VOLUME SLIDER ─── */
input[type="range"].amplitude-volume-slider,
.amplitude-volume-slider {
  width: 90px;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--amp-surface3);
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  border: none;
  transition: height var(--amp-transition);
}
input[type="range"].amplitude-volume-slider:hover {
  height: 5px;
}
input[type="range"].amplitude-volume-slider::-webkit-slider-runnable-track {
  background: var(--amp-surface3);
  height: 3px;
  border-radius: 3px;
}
input[type="range"].amplitude-volume-slider:hover::-webkit-slider-runnable-track {
  height: 5px;
}
input[type="range"].amplitude-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--amp-text);
  border-radius: 50%;
  margin-top: -4.5px;
  opacity: 0;
  transition: opacity var(--amp-transition);
  cursor: pointer;
}
input[type="range"].amplitude-volume-slider:hover::-webkit-slider-thumb {
  opacity: 1;
  margin-top: -3.5px;
}
input[type="range"].amplitude-volume-slider::-moz-range-track {
  background: var(--amp-surface3);
  height: 3px;
  border-radius: 3px;
}
input[type="range"].amplitude-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--amp-text);
  border: none;
  border-radius: 50%;
  opacity: 0;
}
input[type="range"].amplitude-volume-slider:hover::-moz-range-thumb {
  opacity: 1;
}

/* Volume up / down buttons (rarely used but styled just in case) */
#amplitude-volume-up,   .amplitude-volume-up,
#amplitude-volume-down, .amplitude-volume-down {
  color: var(--amp-muted);
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
}
#amplitude-volume-up:hover, .amplitude-volume-up:hover,
#amplitude-volume-down:hover, .amplitude-volume-down:hover {
  color: var(--amp-text);
  background: var(--amp-surface3);
}

/* ─── PLAYBACK SPEED ─── */
#amplitude-playback-speed,
.amplitude-playback-speed {
  font-family: var(--amp-font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--amp-muted);
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--amp-border);
  background: var(--amp-surface2);
  cursor: pointer;
  transition: all var(--amp-transition);
}
#amplitude-playback-speed:hover,
.amplitude-playback-speed:hover {
  color: var(--amp-text);
  border-color: var(--amp-border-hover);
}


/* ═══════════════════════════════════════════════════════════════════════
   PLAYLIST  (#amplitude-playlist / .amplitude-playlist)
   ═══════════════════════════════════════════════════════════════════════ */

#amplitude-playlist,
.amplitude-playlist,
ul.amplitude-song-list {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--amp-font-body);
  list-style: none;
  padding: 0;
  /* leave space for fixed bar: */
  margin-bottom: calc(var(--amp-bar-h) + 16px);
}

/* ─── INDIVIDUAL SONG ROW ─── */
.amplitude-song-container,
li.amplitude-song-container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--amp-border);
  cursor: pointer;
  transition: background var(--amp-transition);
  position: relative;
}
.amplitude-song-container:last-child {
  border-bottom: none;
}
.amplitude-song-container:hover {
  background: var(--amp-surface2);
}

/* Active / playing song row */
.amplitude-song-container.amplitude-active-song-container,
.amplitude-song-container.amplitude-playing {
  background: rgba(232,255,71,0.04);
}

/* Song number / index */
.amplitude-song-index,
.song-number {
  width: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--amp-muted);
  flex-shrink: 0;
}
.amplitude-song-container.amplitude-active-song-container .amplitude-song-index,
.amplitude-song-container.amplitude-playing .amplitude-song-index {
  color: var(--amp-accent);
}

/* Playlist album art thumbnail */
.amplitude-song-container img.amplitude-album-art,
.amplitude-playlist-album-art {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--amp-surface3);
}

/* Song info inside playlist */
.amplitude-song-container .amplitude-song-info,
.playlist-song-info {
  flex: 1;
  min-width: 0;
}

/* Song name in playlist row */
.amplitude-song-container [data-amplitude-song-info="name"],
.amplitude-song-container .amplitude-song-name,
.amplitude-song-container span[amplitude-song-info="name"] {
  font-family: var(--amp-font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--amp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.amplitude-song-container.amplitude-active-song-container [data-amplitude-song-info="name"],
.amplitude-song-container.amplitude-playing [data-amplitude-song-info="name"],
.amplitude-song-container.amplitude-active-song-container .amplitude-song-name,
.amplitude-song-container.amplitude-playing .amplitude-song-name {
  color: var(--amp-accent);
}

/* Artist in playlist row */
.amplitude-song-container [data-amplitude-song-info="artist"],
.amplitude-song-container .amplitude-song-artist,
.amplitude-song-container span[amplitude-song-info="artist"] {
  font-size: 0.75rem;
  color: var(--amp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* Duration in playlist row */
.amplitude-song-container .amplitude-song-duration,
.amplitude-song-container .song-duration,
.amplitude-song-container [data-amplitude-song-info="duration"] {
  font-size: 0.78rem;
  color: var(--amp-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Playlist play/pause button per-row (if you render one) */
.amplitude-song-container .amplitude-play-pause {
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  background: var(--amp-surface3) !important;
  color: var(--amp-muted) !important;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity var(--amp-transition), background var(--amp-transition);
}
.amplitude-song-container:hover .amplitude-play-pause {
  opacity: 1;
}
.amplitude-song-container.amplitude-active-song-container .amplitude-play-pause,
.amplitude-song-container.amplitude-playing .amplitude-play-pause {
  opacity: 1;
  background: var(--amp-accent) !important;
  color: #000 !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   WAVEFORM / VISUALIZATION  (amplitude-wave-form / canvas)
   ═══════════════════════════════════════════════════════════════════════ */

canvas.amplitude-wave-form,
.amplitude-wave-form,
canvas.amplitude-visualization {
  width: 100% !important;
  height: 40px;
  border-radius: 4px;
  opacity: 0.7;
  display: block;
}

/* Playing mini animation bars (if you build them manually) */
.amp-playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.amp-playing-bar {
  width: 3px;
  background: var(--amp-accent);
  border-radius: 2px;
  animation: ampBarPulse 0.8s ease-in-out infinite alternate;
}
.amp-playing-bar:nth-child(2) { animation-delay: 0.15s; }
.amp-playing-bar:nth-child(3) { animation-delay: 0.3s;  }
.amp-playing-bar:nth-child(4) { animation-delay: 0.1s;  }

@keyframes ampBarPulse {
  from { height: 3px;  }
  to   { height: 14px; }
}


/* ═══════════════════════════════════════════════════════════════════════
   ICON BUTTON UTILITY (for any extra action buttons you add)
   ═══════════════════════════════════════════════════════════════════════ */

.amp-icon-btn {
  background: var(--amp-surface2);
  border: 1px solid var(--amp-border);
  color: var(--amp-muted);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--amp-transition);
  font-size: 0.78rem;
}
.amp-icon-btn:hover {
  color: var(--amp-text);
  border-color: var(--amp-border-hover);
}
.amp-icon-btn.active {
  color: var(--amp-accent);
  border-color: var(--amp-accent-dim);
}


/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE  — collapse volume on small screens
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  #amplitude-right,
  .amplitude-player-right {
    display: none;
  }

  #amplitude-left,
  .amplitude-player-left {
    width: auto;
    flex-shrink: 1;
  }

  #amplitude-player {
    padding: 0 12px;
    gap: 12px;
  }

  .amplitude-controls,
  .amplitude-transport {
    gap: 8px;
  }

  #amplitude-play-pause,
  .amplitude-play-pause,
  [data-amplitude-function="play_pause"] {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  #amplitude-left img.amplitude-album-art,
  .amplitude-album-art {
    width: 36px;
    height: 36px;
  }

  [data-amplitude-song-info="artist"],
  .amplitude-song-artist {
    display: none;
  }
}
