/* Theme tokens */
:root {
  --player-bg: #f7fcf9;
  --player-shadow: 0 2px 6px rgba(10, 58, 31, 0.12);
  --accent: #1f8a56;
  --accent-hover: #166a42;
  --track: #d8ebe0;
  --muted: #4c6555;
  --text-inverse: #ffffff;
  --tile-hover: #e8f3ed;
  --corner-soft: 8px;
  --corner-image: 6px;
}

/* Player shell */
.amplitude-wrapper {
  padding: 0 20px;
}

#amplitude-player {
  display: flex;
  flex-wrap: wrap;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  clear: both;
  padding: 16px;
  background-color: var(--player-bg);
  border-radius: var(--corner-soft);
  box-shadow: var(--player-shadow);
}

.amplitude-left {
  flex: 0 0 150px;
  margin-right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.album-art {
  width: 150px;
  height: 150px;
  border-radius: var(--corner-image);
}

.amplitude-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--muted);
}

/* Song meta */
.amplitude-song-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.amplitude-song-name {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--accent);
}

.amplitude-artist-name {
  font-size: 0.9em;
  color: var(--muted);
}

.amplitude-song-description {
  display: none;
  margin-top: 8px;
  font-size: 0.9em;
  color: var(--muted);
}

.amplitude-meta-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8em;
  color: var(--accent);
}

/* Controls */
.amplitude-control-buttons {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.amplitude-control-buttons .control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: var(--accent);
  background: transparent;
  border: none;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.amplitude-control-buttons .control-button:hover {
  color: var(--text-inverse);
  background: var(--accent);
}

.amplitude-prev,
.amplitude-stop,
.amplitude-next {
  width: 34px;
  height: 34px;
}

.amplitude-play-pause {
  width: 44px;
  height: 44px;
  border-radius: var(--corner-soft);
  background: var(--accent);
  color: var(--text-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  line-height: 1;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.amplitude-play-pause:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.amplitude-play-pause::before {
  font-size: 16px;
  content: "\f04b"; /* play */
}

.amplitude-play-pause.amplitude-playing::before {
  content: "\f04c"; /* pause */
}

/* Progress + volume sliders */
.amplitude-timeline {
  position: relative;
  width: 100%;
  margin: 6px 0;
}

input[type=range].amplitude-song-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--track);
  border-radius: 4px;
}

input[type=range].amplitude-song-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 16px;
  margin-top: -5px;
  cursor: pointer;
  border-radius: 2px;
  background: var(--accent);
}

input[type=range].amplitude-song-slider::-moz-range-thumb {
  width: 10px;
  height: 16px;
  cursor: pointer;
  border-radius: 2px;
  background: var(--accent);
}

input[type=range].amplitude-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 16px;
  cursor: pointer;
  border-radius: 2px;
  background: var(--accent);
}

input[type=range].amplitude-volume-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--track);
  border-radius: 4px;
  accent-color: var(--accent);
}

input[type=range].amplitude-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 16px;
  cursor: pointer;
  border-radius: 2px;
  background: var(--accent);
}

input[type=range].amplitude-volume-slider::-moz-range-track {
  height: 6px;
  background: var(--track);
  border-radius: 4px;
}

.amplitude-volume-slider {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  max-width: 240px;
}

.amplitude-volume-slider input[type=range] {
  width: 100%;
  margin-left: 10px;
  height: 6px;
  background: var(--track);
}

.amplitude-volume-slider .fa-volume-up {
  color: var(--accent);
  font-size: 0.9em;
}

.amplitude-volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

/* Playlist */
#amplitude-playlist {
  flex: 1 1 100%;
  margin-top: 16px;
  max-height: 200px;
  overflow-y: auto;
}

#amplitude-playlist.is-collapsed {
  display: none;
}

.amplitude-song-container {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--muted);
}

.amplitude-song-container:hover {
  background-color: var(--tile-hover);
}

.amplitude-song-container.amplitude-active-song-container {
  color: var(--text-inverse);
  font-weight: 700;
  background-color: var(--accent);
}

.amplitude-song-container.amplitude-active-song-container .playlist-song-name {
  color: var(--text-inverse);
  font-weight: 700;
}

.amplitude-song-container.amplitude-active-song-container .playlist-buy {
  color: var(--text-inverse);
}

.playlist-song-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.playlist-image-container img {
  width: 40px;
  height: 40px;
  margin-right: 12px;
  border-radius: 4px;
}

.playlist-song-name {
  font-size: 1em;
  color: var(--accent);
  flex: 1;
}

.playlist-buy {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 0.85em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}

.playlist-buy:hover {
  color: var(--accent-hover);
}

@media (min-width: 481px) {
  .playlist-buy {
    display: inline-flex;
  }
}

/* Optional extras */
.playlist-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.playlist-toggle {
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.playlist-toggle:hover {
  color: var(--text-inverse);
  background: var(--accent);
  border-color: var(--accent);
}

.playlist-label {
  font-size: 0.85em;
  color: var(--accent);
}

.amplitude-buy-now i {
  margin: 0 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.amplitude-buy-now {
  display: none;
  margin-top: 12px;
  align-self: flex-end;
  padding: 8px 16px;
  font-size: 0.9em;
  font-weight: bold;
  text-decoration: none;
  color: var(--text-inverse);
  background-color: var(--accent);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.amplitude-buy-now:hover {
  background-color: var(--accent-hover);
}

@media (max-width: 480px) {
  #amplitude-player {
    flex-direction: column;
    align-items: center;
    padding: 12px;
  }

  .amplitude-left {
    margin-right: 0;
    margin-bottom: 12px;
  }

  .album-art {
    width: 120px;
    height: 120px;
  }

  .amplitude-right {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .amplitude-control-buttons {
    justify-content: center;
  }

  .amplitude-volume-row {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .amplitude-meta-container {
    justify-content: center;
    gap: 8px;
  }

  .amplitude-volume-slider {
    justify-content: center;
  }
}
