/* پلیر شناور پرشین‌پاد — قابل جابه‌جایی و تغییر اندازه */
.ppfp {
  --ppfp-green: #08cb00;
  --ppfp-glow: #00ff9c;
  --ppfp-bg: #ffffff;
  --ppfp-fg: #1b1f23;
  --ppfp-bar: #f3f5f4;
  --ppfp-line: rgba(0, 0, 0, 0.12);

  position: fixed;
  z-index: 9999;
  direction: ltr; /* مختصات فیزیکی؛ متن‌ها داخل هدر RTL می‌شوند */
  display: flex;
  flex-direction: column;
  min-width: 260px;
  min-height: 150px;
  background: var(--ppfp-bg);
  color: var(--ppfp-fg);
  border: 1px solid var(--ppfp-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22), 0 0 0 2px rgba(8, 203, 0, 0.18),
    0 0 18px rgba(0, 255, 156, 0.28);
  font-family: "Vazirmatn", Vazir, sans-serif;
}

/* هماهنگ با حالت شب سایت: یکی از این دو را با کلاس/ویژگی سایت خودت تنظیم کن */
html[data-theme="dark"] .ppfp,
html.dark .ppfp,
body.dark .ppfp,
body.night .ppfp {
  --ppfp-bg: #14181b;
  --ppfp-fg: #eef2f0;
  --ppfp-bar: #1e2327;
  --ppfp-line: rgba(255, 255, 255, 0.14);
}

.ppfp[hidden] {
  display: none;
}

.ppfp__bar {
  direction: rtl;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--ppfp-bar);
  border-bottom: 1px solid var(--ppfp-line);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.ppfp--dragging .ppfp__bar {
  cursor: grabbing;
}

.ppfp__grip {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ppfp-green);
}

.ppfp__title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppfp__btn {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.ppfp__btn:hover {
  background: rgba(8, 203, 0, 0.16);
}

.ppfp__btn:focus-visible,
.ppfp__bar:focus-visible,
.ppfp__resize:focus-visible {
  outline: 2px solid var(--ppfp-green);
  outline-offset: 1px;
}

.ppfp__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.ppfp__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* هنگام کشیدن، iframe نباید موس را بگیرد */
.ppfp--dragging .ppfp__frame,
.ppfp--resizing .ppfp__frame {
  pointer-events: none;
}

.ppfp__resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(
    135deg,
    transparent 50%,
    var(--ppfp-green) 50%,
    var(--ppfp-green) 58%,
    transparent 58%,
    transparent 70%,
    var(--ppfp-green) 70%,
    var(--ppfp-green) 78%,
    transparent 78%
  );
  opacity: 0.85;
}

/* حالت کوچک‌شده: فقط نوار عنوان دیده می‌شود؛ پخش ادامه دارد */
.ppfp--min {
  min-height: 0;
  height: auto !important;
}

.ppfp--min .ppfp__body {
  height: 0;
  flex: none;
  visibility: hidden;
}

.ppfp--min .ppfp__resize {
  display: none;
}

/* لمسی: دستگیره‌ی تغییر اندازه بزرگ‌تر و بدون اسکرول/زوم هنگام کشیدن */
@media (pointer: coarse) {
  .ppfp__resize { width: 36px; height: 36px; }
  .ppfp__bar { min-height: 44px; padding: 8px 10px; }
  .ppfp__btn { width: 36px; height: 36px; }
}
.ppfp, .ppfp__resize, .ppfp__bar { touch-action: none; }
.ppfp__body { touch-action: auto; }

@media (prefers-reduced-motion: no-preference) {
  .ppfp {
    transition: box-shadow 0.2s ease;
  }
}

/* پیام بارگذاری / خطا و دکمه‌ی بارگذاری دوباره */
.ppfp__status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  direction: rtl;
  text-align: center;
  background: var(--ppfp-bg);
  color: var(--ppfp-fg);
  z-index: 1;
}
.ppfp__status[hidden] { display: none; }
.ppfp__msg { margin: 0; font-size: 13px; line-height: 1.8; }
.ppfp__acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ppfp__retry, .ppfp__ext {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.ppfp__retry { border: 0; background: var(--ppfp-green); color: #0b0e0c; }
.ppfp__ext { border: 1px solid var(--ppfp-line); color: inherit; background: transparent; }
.ppfp__retry:focus-visible, .ppfp__ext:focus-visible { outline: 2px solid var(--ppfp-green); outline-offset: 2px; }
.ppfp__retry[hidden], .ppfp__ext[hidden] { display: none; }
.ppfp__reload { font-size: 18px; }
.ppfp--min .ppfp__status { display: none; }

/* پوستر پخش در صفحه‌ی پادکست و «گوش بده» */
.pp-poster { text-align: center; }
.pp-poster-note { margin: 0 0 12px; color: var(--mut); font-size: .9rem; }
.pp-poster-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px;
  border: 0; border-radius: 999px; background: rgba(8, 203, 0, .10); color: var(--ink); font: inherit; font-size: .92rem; font-weight: 700; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(8, 203, 0, .45); cursor: pointer; white-space: nowrap;
  transition: background .2s ease, box-shadow .2s ease;
}   /* همان ظاهر نرم و سبز دکمه‌ی «ثبت پادکست» در منو */
.pp-poster-btn svg { width: 16px; height: 16px; fill: #08cb00; flex: none; }
.pp-poster-btn:hover { background: rgba(8, 203, 0, .18); box-shadow: inset 0 0 0 1px rgba(8, 203, 0, .6), 0 6px 18px rgba(8, 203, 0, .18); }
.pp-poster-btn:active { transform: scale(.98); }
.pp-poster-btn:focus-visible { outline: 3px solid #08cb00; outline-offset: 3px; }


/* ---------- پلیر داخلی: پخش مستقیم قسمت‌ها ---------- */
.ppfp__audio { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 26px; direction: rtl; overflow: hidden; }
.ppfp__audio[hidden] { display: none; }
.ppfp__frame[hidden] { display: none; }
.ppfp__now { flex: none; font-size: 13px; font-weight: 700; line-height: 1.7; max-height: 3.5em; overflow: hidden; }
.ppfp__au { flex: none; width: 100%; height: 40px; }
.ppfp__eps { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; align-content: start; }
.ppfp__eps li { min-width: 0; }
.ppfp__ep { display: block; width: 100%; padding: 5px 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 12.5px; line-height: 1.7; text-align: start; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppfp__ep:hover { background: rgba(8, 203, 0, .12); }
.ppfp__ep.on { background: rgba(8, 203, 0, .18); box-shadow: inset 0 0 0 1px rgba(8, 203, 0, .5); font-weight: 700; }
.ppfp__ep:focus-visible { outline: 2px solid var(--ppfp-green); outline-offset: 1px; }

/* لیست قسمت‌ها در صفحه‌ی پادکست */
.pp-eplist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; text-align: start; width: 100%; }
.pp-eplist li { min-width: 0; }
.pp-eplist { max-height: min(46vh, 340px); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 6px; scrollbar-width: thin; scrollbar-color: rgba(8, 203, 0, .55) transparent; -webkit-overflow-scrolling: touch; }
.pp-eplist::-webkit-scrollbar { width: 6px; }
.pp-eplist::-webkit-scrollbar-thumb { background: rgba(8, 203, 0, .5); border-radius: 999px; }
.pp-eplist::-webkit-scrollbar-track { background: transparent; }
.pp-eplist button { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-width: 0; box-sizing: border-box; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: .88rem; line-height: 1.8; text-align: start; cursor: pointer; }
.pp-eplist button svg { width: 14px; height: 14px; margin-top: .5em; fill: #08cb00; flex: none; }
.pp-eplist button span { flex: 1 1 0; min-width: 0; text-align: start; overflow-wrap: anywhere; }
.pp-eplist button:hover { background: rgba(8, 203, 0, .12); }
.pp-eplist button:focus-visible { outline: 2px solid #08cb00; outline-offset: 2px; }

/* سرعت پخش و تایمر خواب */
.ppfp__tools { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ppfp__tool select { height: 30px; padding: 0 8px; border: 1px solid var(--ppfp-line); border-radius: 8px; background: var(--ppfp-bar); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.ppfp__tool select:focus-visible { outline: 2px solid var(--ppfp-green); outline-offset: 1px; }
.ppfp__left { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.ppfp .sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* دکمه‌ی «نمایش بیشتر / نمایش همه‌ی قسمت‌ها» زیر فهرست قسمت‌ها */
.pp-more-btn { display: block; margin: 14px auto 0; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(8, 203, 0, .10); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(8, 203, 0, .45); cursor: pointer; }
.pp-more-btn:hover { background: rgba(8, 203, 0, .18); }
.pp-more-btn:disabled { opacity: .6; cursor: progress; }
.pp-more-btn:focus-visible { outline: 3px solid #08cb00; outline-offset: 3px; }
