/* ============================================================
   VOICES OF THE DAWN — Library styles
   Loaded on every page that uses library.js.
   ============================================================ */

/* Heart icon: filled state when track is favorited */
.track-icon-btn.is-favorited svg,
.lib-track__heart.is-favorited svg {
  fill: var(--gold);
  stroke: var(--gold);
}

/* === Playlist picker popover === */
.votd-pl-picker {
  position: absolute;
  z-index: 9000;
  background: rgba(25, 11, 21, 0.97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 184, 120, 0.25);
  border-radius: 6px;
  padding: 0.6rem;
  width: 280px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  font-family: var(--display);
  color: var(--cream);
  animation: votd-pop-in 0.15s ease-out;
}
@keyframes votd-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.votd-pl-picker__title {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
  padding: 0.2rem 0.4rem 0.5rem;
  font-weight: 400;
}
.votd-pl-picker__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}
.votd-pl-picker__empty {
  font-family: var(--serif);
  font-style: italic;
  color: var(--rose);
  opacity: 0.6;
  text-align: center;
  padding: 0.8rem 0;
  font-size: 0.9rem;
}
.votd-pl-picker__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
}
.votd-pl-picker__item:hover { background: rgba(232, 184, 120, 0.1); }
.votd-pl-picker__item.is-already { opacity: 0.55; }
.votd-pl-picker__item-name {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.votd-pl-picker__item-meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--rose);
  opacity: 0.7;
  white-space: nowrap;
}
.votd-pl-picker__new {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.6rem;
  border: 1px dashed rgba(232, 184, 120, 0.3);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.votd-pl-picker__new:hover {
  border-color: var(--gold);
  background: rgba(232, 184, 120, 0.08);
}

/* === Track row: desktop vs. mobile button visibility ===
   Desktop shows the inline action buttons (heart, plus, lyrics, YouTube).
   Mobile shows only a single "•••" more button — tapping it opens a
   bottom action sheet with all available actions. */
@media (max-width: 600px) {
  .track__actions { display: flex !important; gap: 0; }
  .track-icon-btn--desktop { display: none !important; }
}
@media (min-width: 601px) {
  .track-icon-btn--mobile { display: none !important; }
}

/* === Action sheet (mobile-friendly bottom sheet) === */
.votd-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 9990;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.votd-sheet-backdrop.is-visible { opacity: 1; }
.votd-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(25, 11, 21, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(232, 184, 120, 0.25);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0));
  z-index: 9991;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(.22, .61, .36, 1);
  font-family: var(--display);
  color: var(--cream);
  max-height: 80vh;
  overflow-y: auto;
}
.votd-sheet.is-visible { transform: translateY(0); }
.votd-sheet__header {
  padding: 0.4rem 0.6rem 1rem;
  border-bottom: 1px solid rgba(232, 184, 120, 0.1);
  margin-bottom: 0.5rem;
}
.votd-sheet__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.votd-sheet__sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--rose);
  opacity: 0.7;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.votd-sheet__actions { display: flex; flex-direction: column; gap: 2px; padding: 0.2rem 0; }
.votd-sheet__action {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 0.7rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
  min-height: 48px;
}
.votd-sheet__action:hover, .votd-sheet__action:active { background: rgba(232, 184, 120, 0.08); }
.votd-sheet__icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream-soft); flex-shrink: 0;
}
.votd-sheet__icon svg { width: 20px; height: 20px; fill: currentColor; }
.votd-sheet__icon.is-favorited svg { fill: var(--gold); stroke: var(--gold); color: var(--gold); }
.votd-sheet__cancel {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.95rem;
  border: 1px solid rgba(232, 184, 120, 0.2);
  border-radius: 8px;
  background: transparent;
  color: var(--cream);
  font-family: var(--display);
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 48px;
}
.votd-sheet__cancel:hover { background: rgba(232, 184, 120, 0.05); }

/* === Centered playlist picker modal === */
.votd-pl-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: rgba(25, 11, 21, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 184, 120, 0.25);
  border-radius: 12px;
  padding: 1rem;
  z-index: 9991;
  font-family: var(--display);
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.votd-pl-modal.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.votd-pl-modal__title {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
  padding: 0.2rem 0.4rem 0.7rem;
  font-weight: 400;
}
.votd-pl-modal__list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.votd-pl-modal__empty {
  font-family: var(--serif); font-style: italic;
  color: var(--rose); opacity: 0.6;
  text-align: center; padding: 0.8rem 0; font-size: 0.9rem;
}
.votd-pl-modal__item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem; border-radius: 6px;
  text-align: left; cursor: pointer;
  background: transparent; border: none; color: inherit; font: inherit;
  transition: background 0.15s; min-height: 48px;
}
.votd-pl-modal__item:hover, .votd-pl-modal__item:active { background: rgba(232, 184, 120, 0.1); }
.votd-pl-modal__item.is-already { opacity: 0.55; }
.votd-pl-modal__item-name { font-size: 0.95rem; font-weight: 400; color: var(--cream); }
.votd-pl-modal__item-meta {
  font-family: var(--serif); font-style: italic;
  color: var(--rose); opacity: 0.7; font-size: 0.85rem;
}
.votd-pl-modal__new {
  margin-top: 0.6rem; width: 100%; padding: 0.85rem;
  border: 1px dashed rgba(232, 184, 120, 0.3); border-radius: 6px;
  font-size: 0.9rem; color: var(--gold);
  background: transparent; cursor: pointer; font-family: inherit; min-height: 48px;
}
.votd-pl-modal__new:hover { border-color: var(--gold); background: rgba(232, 184, 120, 0.05); }
.votd-pl-modal__cancel {
  margin-top: 0.4rem; width: 100%; padding: 0.85rem;
  border: 1px solid rgba(232, 184, 120, 0.15); border-radius: 6px;
  font-size: 0.9rem; color: var(--cream);
  background: transparent; cursor: pointer; font-family: inherit; min-height: 48px;
}
.votd-pl-modal__cancel:hover { background: rgba(232, 184, 120, 0.05); }

/* === Toast === */
.votd-toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(25, 11, 21, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 184, 120, 0.3);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--cream);
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}
.votd-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
