/* ==============================================================
   QURAN AUDIO PLAYER — Views/Quran/Audio.cshtml
   The qap- blocks themselves live in style.css (they come from the
   design); this file only covers what the database-driven page adds.
   ============================================================== */

/* artwork uploaded in the portal fills the cover card */
.qap-track-art .qap-track-img,
.qap-player-art .qap-track-img,
.qap-queue-art .qap-track-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.qap-player-art,
.qap-queue-art { position: relative; overflow: hidden; }

/* categories an administrator adds beyond Quran / Naath / Hamd */
.qap-badge-default { background: #475569; }
.qap-badge-dua { background: #0e7490; }

/* a track whose audio file has not been added yet */
.qap-track-card.qap-unavailable { cursor: not-allowed; opacity: .62; }
.qap-track-card.qap-unavailable:hover { transform: none; box-shadow: none; border-color: #e9ecef; }
.qap-soon { font-size: 11px; font-weight: 600; color: #b45309; }
body.dark .qap-soon { color: #f0ad5b; }

.qap-track-card:focus-visible { outline: 2px solid #1f7a63; outline-offset: 2px; }
.qap-track-card[hidden] { display: none; }

/* pill counters sit at the right edge */
.qap-cat-pill .ms-auto { font-weight: 500; }

/* list view keeps the title and the reciter on one line each */
.qap-track-card.list-card .qap-track-body { flex-wrap: wrap; row-gap: 0; }
.qap-track-card.list-card .qap-track-name,
.qap-track-card.list-card .qap-track-reciter { flex: 1 1 45%; min-width: 0; }

/* loop-one marker on the repeat button */
.qap-ctrl-btn { position: relative; }
.qap-ctrl-btn .qap-loop-one {
  position: absolute; top: 2px; right: 0; font-size: 9px; font-weight: 700; line-height: 1;
  background: #1f7a63; color: #fff; border-radius: 50%; width: 13px; height: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}

.qap-queue-item { width: 100%; border: none; background: transparent; text-align: left; }

@media (max-width: 991.98px) {
  .qap-sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1099;
  }
}

/* ==============================================================
   Favourites and playlists (signed-in listeners)
   ============================================================== */

/* the sidebar scrolls as a whole, so neither list may squeeze the other */
#qaPlaylistList,
#qaReciterList { flex: 0 0 auto; }

/* a playlist in the sidebar: one button that opens it, plus edit / delete beside it */
div.qap-pl-item { padding: 0 6px 0 0; cursor: default; }
.qap-pl-item-main {
  display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0;
  padding: 9px 4px 9px 10px; border: none; background: transparent; text-align: left;
  border-radius: 10px; cursor: pointer; color: inherit;
}
.qap-pl-item-main .qap-pl-item-name { max-width: 118px; }
.qap-pl-item:focus-within .qap-pl-item-actions { opacity: 1; }
.qap-pl-item-main:focus-visible,
.qap-pl-action-btn:focus-visible,
.qap-cat-pill:focus-visible,
.qap-create-playlist-btn:focus-visible,
.qap-track-action-btn:focus-visible,
.qap-heart-btn:focus-visible,
.qap-pl-move-btn:focus-visible,
.qap-pl-remove-btn:focus-visible,
.qap-pl-track-main:focus-visible,
.qap-atp-item:focus-visible,
.qap-color-dot:focus-visible { outline: 2px solid #1f7a63; outline-offset: 2px; }

/* hearts: the same red everywhere, and a favourite card keeps its heart on show */
.qap-track-action-btn.qap-fav-btn.active { color: #dc2626; }
.qap-track-card.is-fav .qap-track-actions,
.qap-track-card:focus-within .qap-track-actions { opacity: 1; }
.qap-heart-btn:disabled { opacity: .4; cursor: default; }
.qap-heart-btn:disabled:hover { color: #9ca3af; }
.qap-track-card.list-card .qap-track-footer { gap: 10px; }

/* no hover on touch screens: the row actions are always there */
@media (hover: none) {
  .qap-track-actions,
  .qap-pl-item-actions { opacity: 1; }
}

/* playlist detail rows */
.qap-pl-track-row.dragging { opacity: .4; }
.qap-pl-track-row[draggable="true"] .qap-drag-handle { cursor: grab; }
.qap-pl-track-row[draggable="false"] .qap-drag-handle { visibility: hidden; }
.qap-pl-track-main {
  display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0;
  border: none; background: transparent; padding: 0; text-align: left; color: inherit; cursor: pointer;
  border-radius: 8px;
}
.qap-pl-track-text { flex: 1 1 auto; min-width: 0; }
.qap-pl-track-art { position: relative; overflow: hidden; }
.qap-pl-track-art .qap-track-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}
.qap-pl-row-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.qap-pl-row-actions .qap-pl-remove-btn { margin-left: 0; opacity: 1; }
.qap-pl-move-btn {
  background: none; border: none; padding: 5px 7px; border-radius: 8px; line-height: 1;
  font-size: 15px; color: #6b7280; cursor: pointer; transition: all .15s;
}
.qap-pl-move-btn:hover:not(:disabled) { background: rgba(0,0,0,.06); color: #1c1c1c; }
.qap-pl-move-btn:disabled { opacity: .3; cursor: default; }

/* add-to-playlist entries are real buttons */
button.qap-atp-item { width: 100%; background: transparent; text-align: left; color: inherit; }
button.qap-atp-item:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 575.98px) {
  .qap-pl-track-row { flex-wrap: wrap; row-gap: 6px; }
  .qap-pl-track-row .qap-track-dur { display: none; }
  .qap-pl-row-actions { margin-left: auto; }
  .qap-playlist-cover-lg { width: 96px; height: 96px; font-size: 2.2rem; }
}

body.dark .qap-pl-item-main { color: #e5e7eb; }
body.dark .qap-pl-move-btn { color: #9ca3af; }
body.dark .qap-pl-move-btn:hover:not(:disabled) { background: rgba(255,255,255,.08); color: #fff; }
body.dark .qap-track-action-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
body.dark .qap-track-action-btn.qap-fav-btn.active { color: #f87171; }
body.dark .qap-heart-btn.active { color: #f87171; }
body.dark .qap-color-dot.active { border-color: #fff; }
