/* ═══════════════════════════════════════════════════════════════
   audio_player_page.css — Le Tidiane v3
   Design inspiré de QuranPro — thème sobre & élégant
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ap-bg:        #0b1a12;
  --ap-surface:   rgba(255,255,255,0.04);
  --ap-surface2:  rgba(255,255,255,0.07);
  --ap-mint:      #8EB69B;
  --ap-mint-dim:  rgba(142,182,155,0.12);
  --ap-mint-bd:   rgba(142,182,155,0.20);
  --ap-green:     #074c2a;
  --ap-green-mid: #235347;
  --ap-border:    rgba(255,255,255,0.07);
  --ap-border2:   rgba(255,255,255,0.12);
  --ap-text:      #e8eaed;
  --ap-muted:     rgba(232,234,237,0.45);
  --ap-radius:    14px;
  --ap-radius-sm: 9px;
}

body.light-mode {
  --ap-bg:        #f4f6f3;
  --ap-surface:   rgba(0,0,0,0.03);
  --ap-surface2:  rgba(0,0,0,0.06);
  --ap-border:    rgba(0,0,0,0.08);
  --ap-border2:   rgba(0,0,0,0.13);
  --ap-text:      #1a2e20;
  --ap-muted:     rgba(26,46,32,0.45);
  --ap-green:     #235347;
}

/* ── PAGE WRAPPER ─────────────────────────────────────────────── */
.ap-page {
  background: var(--ap-bg);
  min-height: 100vh;
  color: var(--ap-text);
  font-family: 'DM Sans', system-ui, sans-serif;
  position: relative;
}

/* Reset layout constraints from base */
.ap-page ~ * .main-wrapper-2,
.ap-page .main-container {
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* ── LOADING SCREEN ───────────────────────────────────────────── */
.ap-loading {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--ap-bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease;
}
.ap-loading.hidden { opacity: 0; pointer-events: none; }
.ap-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(142,182,155,0.2);
  border-top-color: var(--ap-mint);
  animation: ap-spin 0.75s linear infinite;
}
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* ── SPLIT LAYOUT ─────────────────────────────────────────────── */
.ap-split {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 900px) {
  .ap-split {
    flex-direction: row;
    min-height: 100vh;
  }
}

/* ── PLAYER PANE (left on desktop, top on mobile) ─────────────── */
.ap-player-pane {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 24px;
}

@media (min-width: 900px) {
  .ap-player-pane {
    width: 400px;
    min-width: 360px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--ap-border);
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--ap-border2) transparent;
  }
  .ap-player-pane::-webkit-scrollbar { width: 4px; }
  .ap-player-pane::-webkit-scrollbar-track { background: transparent; }
  .ap-player-pane::-webkit-scrollbar-thumb { background: var(--ap-border2); border-radius: 4px; }
}

/* ── BACKGROUND ART (blurred) ─────────────────────────────────── */
.ap-bg-art {
  position: absolute;
  inset: -20px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.25) saturate(1.5);
  transform: scale(1.1);
  pointer-events: none;
  transition: background-image 0.6s ease;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.ap-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}

.ap-back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  color: var(--ap-text);
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.ap-back-btn:hover { background: var(--ap-surface2); transform: translateX(-2px); color: var(--ap-text); }

.ap-header-center {
  flex: 1; min-width: 0;
  text-align: center;
}
.ap-header-eyebrow {
  display: block;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ap-mint); opacity: 0.8; margin-bottom: 2px;
}
.ap-header-title {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--ap-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ap-options-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--ap-muted);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.ap-options-btn:hover { background: var(--ap-surface); color: var(--ap-text); }

/* ── COVER ART ────────────────────────────────────────────────── */
.ap-cover-wrap {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 16px 32px 20px;
}

.ap-cover-inner {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ap-green), var(--ap-green-mid));
  box-shadow:
    0 8px 32px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease;
  display: flex; align-items: center; justify-content: center;
}

.ap-cover-inner.playing {
  transform: scale(1.02);
  box-shadow:
    0 12px 48px rgba(0,0,0,0.65),
    0 0 0 1px rgba(142,182,155,0.15),
    0 0 60px rgba(142,182,155,0.08);
}

.ap-cover-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
  border-radius: 20px;
}
.ap-cover-img.visible { display: block; }

.ap-cover-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: rgba(142,182,155,0.5);
}

/* Equalizer bars overlay when playing */
.ap-cover-eq {
  position: absolute;
  bottom: 14px; right: 14px;
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}
.ap-cover-eq.visible { display: flex; }
.ap-eq-bar {
  width: 3px; border-radius: 3px;
  background: var(--ap-mint);
  animation: ap-eq 1s ease-in-out infinite;
  opacity: 0.85;
}
.ap-eq-bar:nth-child(1) { animation-delay: 0s; }
.ap-eq-bar:nth-child(2) { animation-delay: 0.15s; }
.ap-eq-bar:nth-child(3) { animation-delay: 0.30s; }
.ap-eq-bar:nth-child(4) { animation-delay: 0.10s; }
@keyframes ap-eq {
  0%,100% { height: 4px; }
  50%      { height: 18px; }
}

/* Glow ring when playing */
.ap-cover-glow {
  position: absolute; inset: -3px; border-radius: 23px;
  border: 2px solid transparent;
  transition: border-color 0.5s ease;
  pointer-events: none;
}
.ap-cover-inner.playing .ap-cover-glow {
  border-color: rgba(142,182,155,0.3);
  animation: ap-glow-pulse 2.5s ease-in-out infinite;
}
@keyframes ap-glow-pulse {
  0%,100% { border-color: rgba(142,182,155,0.2); }
  50%      { border-color: rgba(142,182,155,0.45); }
}

/* ── TRACK INFO ───────────────────────────────────────────────── */
.ap-track-info {
  position: relative; z-index: 2;
  text-align: center;
  padding: 0 24px 12px;
}

.ap-track-counter {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ap-mint); opacity: 0.7; margin-bottom: 6px;
}

.ap-track-title-wrap {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.ap-track-title {
  font-family: Inter, sans-serif;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 600; line-height: 1.2;
  color: var(--ap-text); margin: 0;
  white-space: nowrap;
  display: inline-block;
  will-change: transform;
  /* ← AJOUT : padding pour compenser le masque */
  padding: 0 8%;
}
.ap-track-title.is-scrolling {
  animation: titleScroll 12s linear infinite;
  padding: 0; /* reset pendant l'animation */
}
@keyframes titleScroll {
  0%        { transform: translateX(0); }
  10%       { transform: translateX(0); } /* pause au début */
  90%       { transform: translateX(var(--ap-scroll-dist)); }
  100%      { transform: translateX(var(--ap-scroll-dist)); } /* pause à la fin */
}

.ap-track-artist {
  font-size: 13px; color: var(--ap-muted);
  margin: 4px 0 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── PROGRESS ─────────────────────────────────────────────────── */
.ap-progress-wrap {
  position: relative; z-index: 2;
  padding: 4px 24px 2px;
  width: 100%;
}

.ap-progress-input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 4px;
  outline: none; cursor: pointer;
  background: linear-gradient(
    to right,
    var(--ap-mint) 0%, var(--ap-mint) var(--ap-fill, 0%),
    rgba(255,255,255,0.12) var(--ap-fill, 0%), rgba(255,255,255,0.12) 100%
  );
  transition: height 0.15s;
}
body.light-mode .ap-progress-input {
  background: linear-gradient(
    to right,
    var(--ap-green-mid) 0%, var(--ap-green-mid) var(--ap-fill, 0%),
    #d0e8d8 var(--ap-fill, 0%), #d0e8d8 100%
  );
}
.ap-progress-input:hover { height: 6px; }
.ap-progress-input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ap-mint); border: 2px solid var(--ap-bg);
  cursor: pointer; transition: transform 0.15s;
}
.ap-progress-input::-webkit-slider-thumb:hover { transform: scale(1.3); }
.ap-progress-input::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ap-mint); border: 2px solid var(--ap-bg);
  cursor: pointer;
}
body.light-mode .ap-progress-input::-webkit-slider-thumb { background: var(--ap-green-mid); }

.ap-times {
  display: flex; justify-content: space-between;
  margin-top: 5px;
  font-size: 11px; color: var(--ap-muted);
  font-variant-numeric: tabular-nums;
}

/* ── MAIN CONTROLS ────────────────────────────────────────────── */
.ap-controls {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  padding: 14px 24px 8px;
}

.ap-btn {
  background: none; border: none; cursor: pointer;
  color: var(--ap-text); display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border-radius: 50%;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.ap-btn:hover { background: var(--ap-surface2); }
.ap-btn:active { transform: scale(0.93); }

.ap-btn-label {
  font-size: 8px; font-weight: 800; letter-spacing: -0.5px;
  line-height: 1; color: var(--ap-text);
}

.ap-btn-sm {
  width: 44px; height: 44px; opacity: 0.75;
}
.ap-btn-sm:hover { opacity: 1; }

.ap-btn-md {
  width: 48px; height: 48px; opacity: 0.85;
}
.ap-btn-md:hover { opacity: 1; }

.ap-btn-play {
  width: 64px; height: 64px;
  background: var(--ap-mint) !important;
  color: #0b1a12 !important;
  opacity: 1 !important;
  box-shadow: 0 4px 20px rgba(142,182,155,0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.ap-btn-play:hover {
  background: #a6ccb3 !important;
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(142,182,155,0.5);
}
.ap-btn-play:active { transform: scale(0.96); }
body.light-mode .ap-btn-play {
  background: var(--ap-green-mid) !important;
  color: white !important;
  box-shadow: 0 4px 20px rgba(35,83,71,0.35);
}

/* ── SECONDARY CONTROLS (shuffle, speed, repeat) ──────────────── */
.ap-secondary {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  gap: 28px;
  padding: 4px 24px 8px;
}

.ap-sec-btn {
  background: none; border: none; cursor: pointer;
  color: var(--ap-muted); display: flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  transition: color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
}
.ap-sec-btn:hover { color: var(--ap-text); background: var(--ap-surface); }
.ap-sec-btn:active { transform: scale(0.9); }
.ap-sec-btn.active { color: var(--ap-mint) !important; }

.ap-speed-btn {
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--ap-border2); border-radius: 20px !important;
  padding: 0 12px; width: auto !important;
  color: var(--ap-text) !important;
  background: var(--ap-surface) !important;
}
.ap-speed-btn:hover { border-color: var(--ap-mint) !important; color: var(--ap-mint) !important; }
.ap-speed-btn.active { background: var(--ap-green) !important; border-color: var(--ap-mint) !important; color: var(--ap-mint) !important; }
body.light-mode .ap-speed-btn { background: rgba(0,0,0,0.05) !important; border-color: var(--ap-border2); }

.ap-repeat-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ap-mint); font-size: 5px; font-weight: 800;
  line-height: 8px; text-align: center; color: #0b1a12;
  display: none;
}
.ap-repeat-dot.visible { display: block; }

/* ── VOLUME ───────────────────────────────────────────────────── */
.ap-volume-row {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 28px 12px;
}

.ap-vol-icon {
  flex-shrink: 0; opacity: 0.4; color: var(--ap-text);
}
.ap-vol-icon:last-child { opacity: 0.75; }

.ap-volume-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 3px; border-radius: 3px;
  outline: none; cursor: pointer;
  background: linear-gradient(
    to right,
    var(--ap-mint) 0%, var(--ap-mint) var(--ap-vol-fill, 80%),
    rgba(255,255,255,0.12) var(--ap-vol-fill, 80%), rgba(255,255,255,0.12) 100%
  );
  transition: height 0.15s;
}
.ap-volume-slider:hover { height: 5px; }
.ap-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--ap-mint); border: 2px solid var(--ap-bg);
  cursor: pointer; transition: transform 0.15s;
}
.ap-volume-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.ap-volume-slider::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ap-mint); border: 2px solid var(--ap-bg);
  cursor: pointer;
}
body.light-mode .ap-volume-slider::-webkit-slider-thumb { background: var(--ap-green-mid); }

/* ── ZIKR SECTION ─────────────────────────────────────────────── */
.ap-zikr-section {
  position: relative; z-index: 2;
  margin: 4px 20px 0;
  padding: 14px 16px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
}
body.light-mode .ap-zikr-section { background: rgba(0,0,0,0.04); }

.ap-zikr-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}

.ap-zikr-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ap-muted); font-weight: 700;
}

.ap-zikr-toggle {
  display: flex; align-items: center; gap: 5px;
  background: var(--ap-mint-dim); border: 1px solid var(--ap-mint-bd);
  color: var(--ap-mint); border-radius: 20px;
  padding: 5px 12px; font-size: 11px; cursor: pointer;
  transition: background 0.2s;
}
.ap-zikr-toggle:hover { background: rgba(142,182,155,0.2); }
body.light-mode .ap-zikr-toggle { background: #eef6f1; border-color: #d0e8d8; color: var(--ap-green-mid); }

.ap-zikr-picker {
  background: var(--ap-surface2); border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm); overflow: hidden; margin-bottom: 8px;
}
body.light-mode .ap-zikr-picker { background: white; border-color: #d0e8d8; }

.ap-zikr-search { padding: 8px 10px; border-bottom: 1px solid var(--ap-border); }
.ap-zikr-search-input {
  width: 100%; background: rgba(255,255,255,0.06); border: none;
  border-radius: 7px; padding: 6px 10px; color: var(--ap-text);
  font-size: 12px; outline: none;
}
body.light-mode .ap-zikr-search-input { background: #f0f4f1; color: var(--ap-text); }

.ap-zikr-list { max-height: 150px; overflow-y: auto; }
.ap-zikr-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--ap-text); font-size: 12px; cursor: default;
  transition: background 0.15s;
}
.ap-zikr-item:hover { background: var(--ap-mint-dim); }
body.light-mode .ap-zikr-item { border-bottom-color: #f0f4f1; }
.ap-zikr-item-info { flex: 1; min-width: 0; }
.ap-zikr-item-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-zikr-item-folder { font-size: 10px; opacity: 0.45; }
.ap-zikr-play-btn {
  background: var(--ap-green); border: none; color: white;
  border-radius: 50%; width: 22px; height: 22px;
  font-size: 9px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s;
}
.ap-zikr-play-btn:hover { background: var(--ap-green-mid); }
.ap-zikr-loading {
  padding: 14px; text-align: center; font-size: 12px; color: var(--ap-muted);
}

.ap-zikr-playing {
  display: flex; align-items: center; gap: 8px;
  background: var(--ap-mint-dim); border: 1px solid var(--ap-mint-bd);
  border-radius: var(--ap-radius-sm); padding: 8px 12px;
}
body.light-mode .ap-zikr-playing { background: #eef6f1; border-color: #d0e8d8; }
.ap-zikr-playing-info {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  color: var(--ap-mint);
}
body.light-mode .ap-zikr-playing-info { color: var(--ap-green-mid); }
.ap-zikr-playing-info span {
  font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-zikr-vol-row {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--ap-muted); flex-shrink: 0;
}
.ap-zikr-vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 70px; height: 3px; border-radius: 3px;
  outline: none; cursor: pointer;
  background: linear-gradient(
    to right,
    var(--ap-mint) 0%, var(--ap-mint) var(--ap-zikr-fill, 30%),
    rgba(255,255,255,0.15) var(--ap-zikr-fill, 30%), rgba(255,255,255,0.15) 100%
  );
}
.ap-zikr-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ap-mint); cursor: pointer;
}
.ap-zikr-stop {
  background: rgba(255,255,255,0.08); border: none; color: var(--ap-text);
  border-radius: 50%; width: 24px; height: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s;
}
.ap-zikr-stop:hover { background: rgba(255,255,255,0.15); }
body.light-mode .ap-zikr-stop { background: #d0e8d8; color: var(--ap-green-mid); }

/* ── TRACKLIST PANE ───────────────────────────────────────────── */
.ap-tracklist-pane {
  flex: 1; min-width: 0;
  background: var(--ap-bg);
}

@media (min-width: 900px) {
  .ap-tracklist-pane {
    overflow-y: auto;
    height: 100vh;
    position: sticky;
    top: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--ap-border2) transparent;
  }
  .ap-tracklist-pane::-webkit-scrollbar { width: 4px; }
  .ap-tracklist-pane::-webkit-scrollbar-track { background: transparent; }
  .ap-tracklist-pane::-webkit-scrollbar-thumb { background: var(--ap-border2); border-radius: 4px; }
}

/* ── TRACKLIST HEADER ─────────────────────────────────────────── */
.ap-tl-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--ap-bg);
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--ap-border);
}

.ap-tl-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}

.ap-tl-title-group { flex: 1; min-width: 0; }

.ap-tl-title {
  font-family: Inter, sans-serif;
  font-size: 20px; font-weight: 600; color: var(--ap-text);
  margin: 0 0 3px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ap-tl-meta {
  font-size: 11px; color: var(--ap-muted);
}

.ap-tl-actions {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0; flex-wrap: wrap;
  margin-top: 2px;
}

.ap-tl-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  color: rgba(232,234,237,0.7);
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  cursor: pointer;
}
.ap-tl-action-btn:hover { background: var(--ap-surface2); color: var(--ap-text); }
.ap-tl-action-btn--mint {
  background: var(--ap-mint-dim); border-color: var(--ap-mint-bd); color: var(--ap-mint);
}
.ap-tl-action-btn--mint:hover { background: rgba(142,182,155,0.22); color: #b2d4bf; }

.ap-tl-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.ap-tl-filter {
  font-size: 10px; color: var(--ap-muted);
  text-transform: uppercase; letter-spacing: 0.12em;
}

/* Sort dropdown */
.ap-tl-sort-wrap { position: relative; }
.ap-tl-sort-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--ap-surface); border: 1px solid var(--ap-border2);
  border-radius: 20px; padding: 6px 12px; font-size: 11px;
  color: var(--ap-text); cursor: pointer; white-space: nowrap;
  font-family: inherit; transition: background 0.14s;
}
.ap-tl-sort-btn:hover { background: var(--ap-surface2); }
.ap-sort-chevron { transition: transform 0.2s; }
.ap-tl-sort-btn[aria-expanded="true"] .ap-sort-chevron { transform: rotate(180deg); }

.ap-tl-sort-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #0e2418; border: 1px solid var(--ap-border2);
  border-radius: 12px; min-width: 185px; z-index: 800;
  overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none; transform: translateY(-5px);
  transition: opacity 0.17s, transform 0.17s;
}
.ap-tl-sort-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
body.light-mode .ap-tl-sort-menu { background: #f0f4f1; }

.ap-sort-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 11px 16px; font-size: 12px;
  color: rgba(232,234,237,0.65); cursor: pointer;
  background: none; border: none; text-align: left;
  font-family: inherit; transition: background 0.12s, color 0.12s;
}
.ap-sort-item:hover { background: rgba(255,255,255,0.06); color: var(--ap-text); }
.ap-sort-item.active { color: var(--ap-mint); }
.ap-sort-check { color: var(--ap-mint); font-size: 12px; }
body.light-mode .ap-sort-item { color: rgba(26,46,32,0.65); }
body.light-mode .ap-sort-item:hover { color: var(--ap-text); }

/* ── TRACK ITEMS ──────────────────────────────────────────────── */
#ap-list { padding: 6px; }
@media (min-width: 900px) { #ap-list { padding: 8px 20px 0; } }

.ap-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: var(--ap-radius);
  cursor: pointer; position: relative; overflow: hidden;
  transition: background 0.14s, transform 0.1s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ap-item:last-child { border-bottom: none; }
.ap-item:hover { background: rgba(255,255,255,0.05); }
.ap-item:active { transform: scale(0.99); }
.ap-item.playing {
  background: var(--ap-mint-dim);
  border-bottom-color: transparent;
}
body.light-mode .ap-item:hover  { background: rgba(0,0,0,0.04); }
body.light-mode .ap-item.playing{ background: rgba(142,182,155,0.12); }

.ap-item-num {
  width: 24px; min-width: 24px; font-size: 11px;
  color: var(--ap-muted); text-align: center; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ap-item-eq {
  width: 24px; min-width: 24px; flex-shrink: 0;
  display: none; justify-content: center; align-items: flex-end;
  height: 16px; gap: 2px;
}
.ap-item.playing .ap-item-num { display: none; }
.ap-item.playing .ap-item-eq  { display: flex; }
.ap-eq-b {
  width: 3px; border-radius: 2px; background: var(--ap-mint);
  animation: ap-eq-list 0.85s ease-in-out infinite; display: block;
}
.ap-eq-b:nth-child(2) { animation-delay: 0.14s; }
.ap-eq-b:nth-child(3) { animation-delay: 0.28s; }
@keyframes ap-eq-list { 0%,100%{ height:4px; } 50%{ height:14px; } }

.ap-item-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--ap-mint-dim); border: 1px solid var(--ap-mint-bd);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ap-mint); transition: background 0.14s;
}
.ap-item:hover   .ap-item-icon,
.ap-item.playing .ap-item-icon { background: rgba(142,182,155,0.2); }
@media (min-width: 769px) { .ap-item-icon { width: 40px; height: 40px; } }

.ap-item-info { flex: 1; min-width: 0; }
.ap-item-title {
  font-size: 13px; font-weight: 400; color: var(--ap-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.35;
}
.ap-item.playing .ap-item-title { color: var(--ap-mint); font-weight: 500; }
.ap-item-sub {
  font-size: 11px; color: var(--ap-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 769px) { .ap-item-title { font-size: 14px; } }

.ap-item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ap-item-dur {
  font-size: 11px; color: var(--ap-muted);
  font-variant-numeric: tabular-nums; min-width: 36px; text-align: right;
}
.ap-item-badge {
  font-size: 9px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.05em; color: rgba(142,182,155,0.7);
  background: var(--ap-mint-dim); border: 1px solid rgba(142,182,155,0.18);
  border-radius: 5px; padding: 2px 6px;
}
.ap-item-more {
  background: none; border: none; cursor: pointer; color: var(--ap-muted);
  padding: 5px 2px; display: flex; align-items: center; border-radius: 6px;
  flex-shrink: 0; transition: background 0.12s, color 0.12s;
}
.ap-item-more:hover { background: var(--ap-surface2); color: var(--ap-text); }

/* Item animations */
@keyframes ap-item-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ap-item--hidden  { opacity: 0; transform: translateY(8px); }
.ap-item--visible {
  animation: ap-item-in 0.3s cubic-bezier(0.22,0.68,0,1.1) both;
  animation-delay: var(--item-delay, 0ms);
}

/* Ripple */
@keyframes ap-ripple { to { transform: scale(3); opacity: 0; } }
.ap-item-ripple {
  position: absolute; border-radius: 50%;
  pointer-events: none; width: 50px; height: 50px;
  background: rgba(142,182,155,0.1);
  transform: scale(0);
  animation: ap-ripple 0.4s ease-out forwards;
}

/* ── SENTINEL / END MSG ───────────────────────────────────────── */
#ap-sentinel {
  display: flex; align-items: center; justify-content: center;
  padding: 18px; min-height: 56px;
}
.ap-sentinel-spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(142,182,155,0.2); border-top-color: var(--ap-mint);
  animation: ap-spin 0.75s linear infinite; display: none;
}
.ap-sentinel-spin.active { display: block; }
#ap-end-msg {
  display: none; text-align: center; padding: 16px;
  font-size: 11px; color: var(--ap-muted); letter-spacing: 0.05em;
}

/* ── EMPTY STATE ──────────────────────────────────────────────── */
#ap-empty {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px 40px; text-align: center; gap: 12px;
}
.ap-empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--ap-mint-dim); border: 1px solid var(--ap-mint-bd);
  display: flex; align-items: center; justify-content: center;
  color: var(--ap-mint); margin-bottom: 8px;
}
.ap-empty-title { font-size: 15px; font-weight: 500; color: var(--ap-text); margin: 0; }

/* ── CONTEXT MENU ─────────────────────────────────────────────── */
#ap-ctx {
  position: fixed;
  background: #0e2418; border: 1px solid var(--ap-border2);
  border-radius: 12px; min-width: 190px; z-index: 800;
  overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: none;
}
#ap-ctx.open { display: block; }
.ap-ctx-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 16px; font-size: 13px;
  color: rgba(232,234,237,0.7);
  background: none; border: none; text-align: left;
  cursor: pointer; font-family: inherit;
  transition: background 0.11s, color 0.11s;
}
.ap-ctx-item:hover { background: rgba(255,255,255,0.06); color: var(--ap-text); }
.ap-ctx-item--red { color: #d96666; }
.ap-ctx-item--red:hover { background: rgba(180,60,60,0.1); color: #e07777; }
.ap-ctx-sep { height: 1px; background: var(--ap-border); margin: 3px 0; }
body.light-mode #ap-ctx { background: #f0f4f1; }
body.light-mode .ap-ctx-item { color: rgba(26,46,32,0.7); }

#ap-ov { display: none; position: fixed; inset: 0; z-index: 450; }
#ap-ov.on { display: block; }

/* ── HIDDEN UTIL ──────────────────────────────────────────────── */
.ap-hidden { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ── MOBILE RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 899px) {
  .ap-cover-wrap { padding: 12px 40px 16px; }
  .ap-cover-inner { max-width: 240px; }
  .ap-controls { gap: 8px; padding: 10px 16px 6px; }
  .ap-btn-play { width: 58px; height: 58px; }
  .ap-btn-sm { width: 40px; height: 40px; }
  .ap-btn-md { width: 44px; height: 44px; }
  .ap-zikr-section { margin: 4px 12px 0; }
  .ap-volume-row { padding: 4px 20px 10px; }
  #ap-list { padding: 4px 8px 0; }
  .ap-tl-header { padding: 12px 14px 10px; }
}


/* ── Loader sur le bouton play ── */
.ap-btn-play {
  position: relative;
}

.ap-btn-play.loading::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(142,182,155,0.2);
  border-top-color: #8EB69B;
  animation: ap-btn-spin 0.75s linear infinite;
  z-index: 2;
}

.ap-btn-play.loading svg {
  opacity: 0.3;
}

@keyframes ap-btn-spin {
  to { transform: rotate(360deg); }
}