/* ============================================================================
   song-card.css — shared song-card components (card-shared)
   Used by index.html ("Now in the Playlist") and stats-list.html (Song History).
   Contains the action cluster (play/heart/overflow), overflow menu, mood badges,
   rate button, rating modal, and the sticky web-player bar.

   NOTE: this file deliberately does NOT define the `.song-row` grid layout —
   each page owns its own row layout and column placement. Only additive,
   component-level styles live here.
   ============================================================================ */

/* ── Mood badges ── */
.mood-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 8px;
}
.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  text-decoration: none;
}
.mood-badge:hover {
  background: #ececec;
  border-color: #d8d8d8;
}
.mood-badge-more {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #888;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.mood-badge-more:hover {
  background: #e8e8e8;
  border-color: #aaa;
  color: #555;
}

/* ── Rate button (song list rows) ── */
.btn-rate {
  font-size: 12px;
  font-weight: 500;
  color: #999;
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 6px 16px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  margin-top: 5px;
  margin-bottom: 10px;
  display: inline-block;
  transition:
    border-color 0.12s,
    color 0.12s;
}
.btn-rate:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}
.btn-rate-inline {
  font-size: 13px;
  color: #1a1a1a;
  background: none;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.12s;
}
.btn-rate-inline:hover {
  background: #f5f5f5;
}

/* ── Mixtape heart button (circular, matches play + overflow) ── */
.btn-mixtape {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  color: #ccc;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.btn-mixtape:hover {
  color: #e84545;
  border-color: #e84545;
}
.btn-mixtape--recorded {
  color: #e84545;
  border-color: #e84545;
}
.btn-mixtape--recorded:hover {
  color: #c73030;
  border-color: #c73030;
}
.btn-mixtape:disabled {
  cursor: default;
  opacity: 0.4;
}

/* ── Action cluster (play → heart → overflow, stacked vertically) ── */
.action-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.action-cluster--corner {
  position: absolute;
  top: 0;
  right: -48px;
  z-index: 2;
}
@media (max-width: 600px) {
  .action-cluster--corner {
    position: absolute;
    top: 0;
    right: 0;
  }
}

/* ── Overflow menu button (circular, matches play + heart) ── */
.btn-overflow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.btn-overflow:hover {
  background: #f5f5f5;
  border-color: #bbb;
}
.btn-overflow[aria-expanded='true'] {
  background: #eee;
  border-color: #aaa;
}

/* ── Overflow dropdown menu ── */
.overflow-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 240px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  padding: 4px 0;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.12s,
    transform 0.12s;
}
.overflow-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.overflow-menu.open-up {
  display: block;
  opacity: 1;
  transform: translateY(0);
  top: auto;
  bottom: calc(100% + 4px);
}
.overflow-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.08s;
  white-space: nowrap;
}
.overflow-menu-item:hover {
  background: #f5f5f5;
}
.overflow-menu-item svg {
  flex-shrink: 0;
}
.overflow-menu-divider {
  height: 1px;
  background: #eee;
  margin: 4px 0;
}
.overflow-menu-item--admin {
  color: #888;
  font-size: 12px;
}
.overflow-icon-yt {
  color: #ff0000;
}
.overflow-icon-spotify {
  color: #1db954;
}
.overflow-icon-apple {
  color: #1a1a1a;
}
.overflow-icon-tidal {
  color: #1a1a1a;
}
.overflow-icon-bandcamp {
  color: #1da0c3;
}
.overflow-icon-mb {
  color: #eb743b;
}

/* ── Play button ── */
.btn-play {
  width: 32px;
  height: 32px;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
  padding: 0;
  font-family: inherit;
}
.btn-play:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.btn-play svg {
  width: 14px;
  height: 14px;
  display: block;
}
.btn-play.is-playing {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spin-icon {
  animation: spin 1s linear infinite;
}
.btn-play--lg {
  width: 44px;
  height: 44px;
}
.btn-play--lg svg {
  width: 18px;
  height: 18px;
}
.btn-mixtape--lg {
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.btn-overflow--lg {
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.song-row.is-now-playing {
  background: #faf9ff;
  border-radius: 8px;
}
.song-row.is-now-playing .song-title {
  color: #4f46e5;
}

/* ── Mood Rating Modal ── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#modal-overlay.open {
  display: flex;
}
#modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 20px 22px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #aaa;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.1s;
}
.modal-close:hover {
  color: #1a1a1a;
}
.modal-song-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
  word-break: break-word;
}
.modal-song-artist {
  font-size: 13px;
  color: #777;
  margin-bottom: 18px;
}
.modal-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  border: 1px solid #ddd;
  border-radius: 99px;
  font-size: 13px;
  color: #555;
  background: #fff;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
  font-family: inherit;
}
.mood-chip:hover {
  border-color: #999;
  color: #1a1a1a;
}
.mood-chip.selected {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.modal-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 16px 0;
}
.rating-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rating-row-label {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.rating-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.rating-row-remove {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.1s;
}
.rating-row-remove:hover {
  color: #e00;
}
.rating-btn {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
  color: #555;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s;
  font-family: inherit;
}
.rating-btn:hover {
  border-color: #999;
  color: #1a1a1a;
}
.rating-btn.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
@media (max-width: 480px) {
  #modal-overlay {
    align-items: flex-start;
    padding-top: 12px;
  }
  #modal {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}
@media (max-width: 400px) {
  .rating-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .rating-btn {
    padding: 7px 13px;
    font-size: 13px;
  }
}
.add-mood-label {
  font-size: 10px;
  font-weight: 600;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.typeahead-wrapper {
  position: relative;
}
.add-mood-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.1s;
}
.add-mood-input:focus {
  border-color: #999;
}
.mood-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  max-height: 196px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}
.mood-dropdown.open {
  display: block;
}
.mood-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 13px;
  color: #111;
  cursor: pointer;
  transition: background 0.08s;
}
.mood-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}
.mood-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}
.mood-dropdown-item:only-child {
  border-radius: 8px;
}
.mood-dropdown-item:hover {
  background: #f5f5f5;
}
.mood-dropdown-item.already-selected {
  color: #bbb;
  cursor: default;
}
.mood-dropdown-item.create-option {
  border-top: 1px solid #f0f0f0;
  font-style: italic;
  color: #555;
}
.mood-dropdown-item.create-option:hover {
  background: #f5f5f5;
}
.mood-dropdown-check {
  font-size: 11px;
  color: #bbb;
}
.mood-dropdown-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #bbb;
  text-align: center;
}
.add-mood-error {
  font-size: 12px;
  color: #c00;
  margin-top: 6px;
}
.modal-submit {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.modal-submit:hover:not(:disabled) {
  background: #333;
}
.modal-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.modal-confirm {
  text-align: center;
  padding: 28px 0 16px;
}
.modal-confirm-icon {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1;
}
.modal-confirm-text {
  font-size: 17px;
  font-weight: 700;
}
.sk {
  background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ── Sticky bottom web-player bar ── */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: #fff;
  z-index: 100;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  transform: translateY(100%);
}
.player-bar.visible {
  transform: translateY(0);
}
body.player-active .nav-fab {
  bottom: 96px;
}
.player-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
}
.player-art {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #333;
  flex-shrink: 0;
}
.player-track-info {
  flex: 1;
  min-width: 0;
}
.player-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.player-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
  font-family: inherit;
}
.player-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.player-btn svg {
  width: 16px;
  height: 16px;
}
.player-btn.toggle {
  color: #777;
  position: relative;
}
.player-btn.toggle.active {
  color: #4f46e5;
}
.player-btn.toggle.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #4f46e5;
}
.player-btn.toggle .repeat-one-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
.player-btn-main {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #1a1a1a;
}
.player-btn-main:hover {
  background: #e5e5e5;
}
.player-btn-main.disabled {
  background: #2a2a2a;
  color: #555;
  cursor: not-allowed;
}
.player-btn-main.disabled:hover {
  background: #2a2a2a;
}
.player-spotify-tag {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #1db954;
  flex-shrink: 0;
}
.player-spotify-tag.visible {
  display: inline-flex;
}
.player-spotify-tag svg {
  flex-shrink: 0;
}
.player-open-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #999;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #444;
  border-radius: 14px;
  transition: all 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.player-open-link:hover {
  color: #fff;
  border-color: #888;
}
.player-expand-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
}
.player-expand-btn:hover {
  color: #fff;
}
.player-embed {
  background: #111;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.player-embed.expanded {
  max-height: 300px;
}
.player-embed iframe {
  width: 100%;
  display: block;
}
.spotify-compact-embed {
  background: #111;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.spotify-compact-embed.visible {
  max-height: 80px;
}
.spotify-compact-embed iframe {
  width: 100%;
  display: block;
  border-radius: 0;
}
@media (max-width: 600px) {
  .player-inner {
    padding: 8px 12px;
    gap: 8px;
  }
  .player-controls {
    gap: 2px;
  }
  .player-open-link {
    display: none;
  }
  .player-spotify-tag.visible {
    display: none;
  }
  .player-btn {
    width: 32px;
    height: 32px;
  }
  .player-btn-main {
    width: 36px;
    height: 36px;
  }
}
