/* ══════════════════════════════════════════════════════════════════
   AMG Playlist — [amg_playlist]
   از همان متغیرهای پوسته‌ای AMG Music Box استفاده می‌کند (--amg-bg,
   --amg-surface, --amg-accent, --amg-glow, --amg-border, ...) که در
   amg-player.css تعریف شده‌اند (این فایل به آن به‌عنوان dependency
   وابسته است) — پس همیشه با ظاهر AMG Music Box هماهنگ می‌ماند و رنگ‌ها
   دوباره‌کاری/تکراری نمی‌شوند.
   ══════════════════════════════════════════════════════════════════ */

.amg-pl-wrapper{
  --amg-pl-radius:18px;
  --amg-pl-art-height:280px;
  font-family:system-ui,-apple-system,'Segoe UI',sans-serif;
  direction:ltr;
  max-width:640px;
  margin:0 auto;
  background:var(--amg-surface);
  border:1px solid var(--amg-border,rgba(255,255,255,.08));
  border-radius:var(--amg-pl-radius);
  overflow:hidden;
  color:var(--amg-text,#fff);
  box-shadow:0 10px 40px rgba(0,0,0,.35);
}
.amg-pl-align-right{margin-inline-start:0;margin-inline-end:auto}
.amg-pl-align-left{margin-inline-start:auto;margin-inline-end:0}

.amg-pl-title{
  padding:14px 18px 0;
  font-size:15px;
  font-weight:800;
  color:var(--amg-text,#fff);
}

.amg-pl-body{position:relative}

/* ── Hero art (style=hero only) ── */
.amg-pl-hero-art{
  position:relative;
  width:100%;
  height:var(--amg-pl-art-height);
  background:linear-gradient(150deg,color-mix(in srgb,var(--amg-accent) 18%,var(--amg-bg)),var(--amg-bg));
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.amg-pl-hero-img{width:100%;height:100%;object-fit:cover;transition:opacity .25s ease}
.amg-pl-hero-icon{color:rgba(255,255,255,.18);transition:opacity .18s ease}
.amg-pl-hero-icon svg{width:64px;height:64px}
.amg-pl-hero-art::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(180deg,transparent 40%,var(--amg-surface) 100%);
  pointer-events:none;
}

/* ── Now playing info / controls (shared, both styles) ── */
.amg-pl-now{padding:16px 18px 10px}
.amg-pl-now-info{display:flex;flex-direction:column;gap:2px;margin-bottom:10px;min-height:38px}
.amg-pl-now-title{font-size:15px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.amg-pl-now-artist{font-size:12.5px;color:var(--amg-muted,rgba(255,255,255,.55))}

.amg-pl-progress{
  position:relative;height:5px;border-radius:99px;background:rgba(255,255,255,.1);
  cursor:pointer;overflow:hidden;
}
.amg-pl-progress-fill{
  position:absolute;inset-inline-start:0;top:0;bottom:0;width:0%;
  background:var(--amg-accent);border-radius:99px;
  box-shadow:0 0 8px var(--amg-glow);
  transition:width .1s linear;
}
.amg-pl-times{display:flex;justify-content:space-between;font-size:10.5px;color:var(--amg-muted,rgba(255,255,255,.45));margin-top:5px;font-variant-numeric:tabular-nums}

.amg-pl-controls{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:14px}
.amg-pl-btn{
  background:none;border:none;color:var(--amg-text,#fff);opacity:.75;cursor:pointer;
  display:flex;align-items:center;justify-content:center;padding:6px;border-radius:50%;
  transition:all .15s ease;position:relative;
}
.amg-pl-btn svg{width:18px;height:18px}
.amg-pl-btn:hover{opacity:1;background:rgba(255,255,255,.08)}
.amg-pl-play-main{
  width:46px;height:46px;background:var(--amg-accent);color:#001018;opacity:1;
  box-shadow:0 4px 16px var(--amg-glow);
}
.amg-pl-play-main svg{width:20px;height:20px}
.amg-pl-play-main:hover{filter:brightness(1.1);background:var(--amg-accent)}
.amg-pl-shuffle.on,.amg-pl-repeat.on{opacity:1;color:var(--amg-accent)}
.amg-pl-repeat-one{
  position:absolute;bottom:-2px;inset-inline-end:-2px;background:var(--amg-accent);color:#001018;
  font-size:8px;font-weight:800;border-radius:50%;width:12px;height:12px;
  display:none;align-items:center;justify-content:center;line-height:1;
}
.amg-pl-repeat[data-mode="one"] .amg-pl-repeat-one{display:flex}
.amg-pl-repeat[data-mode="one"],.amg-pl-repeat[data-mode="all"]{opacity:1;color:var(--amg-accent)}

/* ── کنترل صدا ── */
.amg-pl-volume-wrap{position:relative}
.amg-pl-vol-icon-on,.amg-pl-vol-icon-off{width:18px;height:18px}
.amg-pl-volume-pop{
  display:none;position:absolute;bottom:calc(100% + 8px);inset-inline-start:50%;transform:translateX(-50%);
  background:var(--amg-bg,#0b0d13);border:1px solid var(--amg-border,rgba(255,255,255,.1));
  border-radius:10px;padding:10px 6px;box-shadow:0 8px 24px rgba(0,0,0,.4);z-index:6;
}
.amg-pl-volume-pop.open{display:block}
.amg-pl-volume-range{
  writing-mode:vertical-lr;direction:ltr;width:20px;height:80px;accent-color:var(--amg-accent);cursor:pointer;
}

/* ── دکمه‌ی باز/بسته‌کردن لیست (فقط در استایل mini کاربرد دارد) ── */
.amg-pl-mini-toggle{
  display:none;width:100%;background:none;border:none;border-top:1px solid var(--amg-border,rgba(255,255,255,.08));
  color:var(--amg-muted,rgba(255,255,255,.5));padding:6px 0;cursor:pointer;align-items:center;justify-content:center;
}
.amg-pl-mini-toggle svg{width:16px;height:16px;transition:transform .2s ease}
.amg-pl-mini-toggle.open svg{transform:rotate(180deg)}

/* ── Track list ── */
.amg-pl-list{
  max-height:340px;overflow-y:auto;
  border-top:1px solid var(--amg-border,rgba(255,255,255,.08));
}
.amg-pl-row{
  display:flex;align-items:center;gap:10px;padding:9px 14px;cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.04);transition:background .12s ease;
}
.amg-pl-row:last-child{border-bottom:none}
.amg-pl-row:hover{background:rgba(255,255,255,.04)}
.amg-pl-row.active{background:color-mix(in srgb,var(--amg-accent) 12%,transparent)}
.amg-pl-row-num{
  width:22px;flex-shrink:0;text-align:center;font-size:11px;color:var(--amg-muted,rgba(255,255,255,.4));
  font-variant-numeric:tabular-nums;
}
.amg-pl-row.active .amg-pl-row-num{color:var(--amg-accent)}
.amg-pl-row-thumb{
  width:38px;height:38px;border-radius:8px;flex-shrink:0;overflow:hidden;
  background:linear-gradient(135deg,#1a2540,#241a3a);display:flex;align-items:center;justify-content:center;
}
.amg-pl-row-thumb img{width:100%;height:100%;object-fit:cover}
.amg-pl-row-thumb svg{width:16px;height:16px;color:rgba(255,255,255,.25)}
.amg-pl-row-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.amg-pl-row-title{font-size:12.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.amg-pl-row.active .amg-pl-row-title{color:var(--amg-accent)}
.amg-pl-row-artist{font-size:11px;color:var(--amg-muted,rgba(255,255,255,.45));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.amg-pl-row-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
.amg-pl-row-quality{
  font-size:10px;background:rgba(255,255,255,.06);border:1px solid var(--amg-border,rgba(255,255,255,.1));
  color:var(--amg-text,#fff);border-radius:6px;padding:3px 4px;max-width:64px;cursor:pointer;
}
.amg-pl-dl-wrap{position:relative}
.amg-pl-icon-btn,.amg-pl-dl-toggle{
  width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:50%;
  color:var(--amg-muted,rgba(255,255,255,.5));transition:all .15s ease;background:none;border:none;cursor:pointer;padding:0;
}
.amg-pl-dl-toggle:hover{color:var(--amg-accent);background:rgba(255,255,255,.08)}
.amg-pl-dl-toggle svg{width:14px;height:14px}
.amg-pl-dl-menu{
  display:none;position:absolute;inset-inline-end:0;top:calc(100% + 4px);z-index:6;
  background:var(--amg-bg,#0b0d13);border:1px solid var(--amg-border,rgba(255,255,255,.1));
  border-radius:10px;padding:6px;min-width:110px;box-shadow:0 8px 24px rgba(0,0,0,.4);
}
.amg-pl-dl-menu.open{display:flex;flex-direction:column;gap:2px}
.amg-pl-dl-menu a{
  color:var(--amg-text,#fff);font-size:11px;padding:6px 8px;border-radius:6px;text-decoration:none;
  white-space:nowrap;transition:background .12s ease;
}
.amg-pl-dl-menu a:hover{background:rgba(255,255,255,.08);color:var(--amg-accent)}
.amg-pl-row-playing-icon{width:16px;height:16px;color:var(--amg-accent);flex-shrink:0;display:none}
.amg-pl-row.active .amg-pl-row-playing-icon{display:block}
.amg-pl-row.active .amg-pl-row-num{display:none}

/* ── Lyrics popup — فقط برای آهنگِ در حال پخش رندر می‌شود، هربار آهنگ
   عوض شود محتوایش جایگزین می‌شود؛ هیچ متنِ آهنگ دیگری همزمان در دسترس
   نیست. ── */
.amg-pl-lyrics-popup{
  position:absolute;inset:0;z-index:5;background:var(--amg-surface);
  display:flex;flex-direction:column;border-radius:var(--amg-pl-radius);
}
.amg-pl-lyrics-head{
  display:flex;align-items:center;justify-content:space-between;padding:14px 16px;
  border-bottom:1px solid var(--amg-border,rgba(255,255,255,.08));
}
.amg-pl-lyrics-close{background:none;border:none;color:var(--amg-text,#fff);cursor:pointer;padding:4px;opacity:.7}
.amg-pl-lyrics-close:hover{opacity:1}
.amg-pl-lyrics-close svg{width:18px;height:18px}
.amg-pl-lyrics-body{flex:1;overflow-y:auto;padding:16px 20px;font-size:14px;line-height:2.1;text-align:center}
.amg-pl-lyrics-line{opacity:.4;transition:opacity .2s,color .2s;padding:2px 0}
.amg-pl-lyrics-line.active{opacity:1;color:var(--amg-accent);font-weight:700}

/* ══════════ style=compact — لیست فشرده، بدون کاور بزرگ ══════════ */
.amg-pl-style-compact .amg-pl-hero-art{display:none}
.amg-pl-style-compact .amg-pl-now{padding-top:14px}
.amg-pl-style-compact{max-width:480px}

/* ══════════ style=hero — کاور بزرگ بالا، دوباره در لیست هم تامب‌نیل
   کوچک هست تا کاربر بدون اسکرول کل لیست را هم ببیند ══════════ */
.amg-pl-style-hero .amg-pl-row-thumb{width:32px;height:32px}

/* ══════════ style=card — «کاور متوسط»: کاورِ مربعِ کوچک‌ترِ گردگوشه در
   وسط، الهام از کارت‌های پلی‌لیستِ اسپاتیفای ══════════ */
.amg-pl-style-card{max-width:420px}
.amg-pl-style-card .amg-pl-body{padding-top:22px;display:flex;flex-direction:column;align-items:center}
.amg-pl-style-card .amg-pl-hero-art{
  width:150px;height:150px;flex-shrink:0;border-radius:18px;
  box-shadow:0 16px 34px rgba(0,0,0,.45);
}
.amg-pl-style-card .amg-pl-now{width:100%;text-align:center;padding-top:14px}
.amg-pl-style-card .amg-pl-now-info{align-items:center}
.amg-pl-style-card .amg-pl-controls{justify-content:center}

/* ══════════ style=side — «کاور بغل»: کاور و اطلاعات کنار هم، شبیه
   هدرِ آلبومِ اپل‌موزیک/ساندکلاد ══════════ */
.amg-pl-style-side .amg-pl-body{
  display:flex;align-items:flex-start;gap:16px;padding:18px 18px 4px;
}
.amg-pl-style-side .amg-pl-hero-art{
  width:110px;height:110px;flex-shrink:0;border-radius:14px;margin:0;
}
.amg-pl-style-side .amg-pl-now{flex:1;min-width:0;padding:0}
.amg-pl-style-side .amg-pl-controls{justify-content:flex-start}

/* ══════════ style=grid — لیستِ آهنگ‌ها به‌صورت شبکه‌ی کارت، الهام از
   شبکه‌ی «Made for you»ی اسپاتیفای ══════════ */
.amg-pl-style-grid .amg-pl-hero-art{display:none}
.amg-pl-style-grid .amg-pl-now{padding-top:14px}
.amg-pl-style-grid .amg-pl-list{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
  gap:10px;padding:12px 14px;border-top:1px solid var(--amg-border,rgba(255,255,255,.08));max-height:420px;
}
.amg-pl-style-grid .amg-pl-row{
  flex-direction:column;align-items:stretch;gap:6px;padding:8px;border-radius:12px;
  border:1px solid transparent;border-bottom:1px solid transparent;
}
.amg-pl-style-grid .amg-pl-row:hover{border-color:var(--amg-border,rgba(255,255,255,.1))}
.amg-pl-style-grid .amg-pl-row.active{background:rgba(255,255,255,.06);border-color:var(--amg-accent)}
.amg-pl-style-grid .amg-pl-row-num{display:none}
.amg-pl-style-grid .amg-pl-row-thumb{width:100%;height:100px;border-radius:9px}
.amg-pl-style-grid .amg-pl-row-info{width:100%}
.amg-pl-style-grid .amg-pl-row-title,.amg-pl-style-grid .amg-pl-row-artist{white-space:normal}
.amg-pl-style-grid .amg-pl-row-actions{width:100%;justify-content:space-between}

/* ══════════ style=mini — نوارِ فوق‌فشرده و شناور، لیست فقط با کلیک
   باز می‌شود ══════════ */
.amg-pl-style-mini{max-width:360px}
.amg-pl-style-mini .amg-pl-hero-art{display:none}
.amg-pl-style-mini .amg-pl-now{padding:12px 14px 8px}
.amg-pl-style-mini .amg-pl-controls{gap:4px;margin-top:6px}
.amg-pl-style-mini .amg-pl-lyrics-btn{display:none !important}
.amg-pl-style-mini .amg-pl-mini-toggle{display:flex}
.amg-pl-style-mini .amg-pl-list{max-height:0;overflow:hidden;transition:max-height .25s ease;border-top:none}
.amg-pl-style-mini .amg-pl-list.expanded{max-height:280px;border-top:1px solid var(--amg-border,rgba(255,255,255,.08))}

/* ══════════ style=wave — هدرِ گرادیانیِ رنگِ تمِ پلیر، الهام از
   صفحه‌ی پخشِ ساندکلاد ══════════ */
.amg-pl-style-wave .amg-pl-hero-art{
  height:150px;width:100%;border-radius:0;position:relative;overflow:hidden;
}
.amg-pl-style-wave .amg-pl-hero-art::before{
  content:'';position:absolute;inset:0;
  background:linear-gradient(135deg,var(--amg-accent) 0%,var(--amg-bg,#0b0d13) 120%);
  opacity:.9;z-index:0;
}
.amg-pl-style-wave .amg-pl-hero-art img,.amg-pl-style-wave .amg-pl-hero-icon{position:relative;z-index:1}
.amg-pl-style-wave .amg-pl-now{
  margin-top:-24px;position:relative;z-index:2;background:var(--amg-surface,var(--amg-bg));
  border-radius:20px 20px 0 0;padding-top:18px;
}
.amg-pl-style-wave .amg-pl-play-main{width:54px;height:54px}
.amg-pl-style-wave .amg-pl-play-main svg{width:22px;height:22px}

@media (max-width:480px){
  .amg-pl-controls{gap:6px}
  .amg-pl-row-quality{display:none}
  .amg-pl-style-side .amg-pl-body{flex-direction:column;align-items:center;text-align:center}
}

/* ══════════ Gutenberg editor canvas box (amg/playlist block) ══════════ */
.amg-pl-editor-box{
  border:1px dashed rgba(0,212,255,.4);border-radius:12px;padding:16px;
  background:rgba(0,212,255,.04);
}
.amg-pl-editor-head{margin-bottom:10px;font-size:13px}
.amg-pl-editor-list{margin:10px 0 0;padding-inline-start:18px;font-size:11.5px;color:#666;max-height:120px;overflow-y:auto}
.amg-pl-editor-empty{font-size:11.5px;color:#888;margin-top:8px}
