/* ═══════════════════════════════════════════════════════
   BIO-TOPIC READER PAGE — Dark Professional Theme
   قناة المهدي الفضائية · RTL · Arabic
═══════════════════════════════════════════════════════ */

/* ────────────────────────────────────────
   ROOT TOKENS
──────────────────────────────────────── */
:root {
  --bt-bg:        #2b2b2b;
  --bt-bg2:       #333333;
  --bt-bg3:       #2c2c2c;
  --bt-card:      #2e2e2e;
  --bt-card2:     #333333;
  --bt-teal:      #366d6d;
  --bt-teal-lt:   #4a9090;
  --bt-teal-dk:   #274f4f;
  --bt-gold:      #c9a227;
  --bt-gold2:     #e8c547;
  --bt-text:      #e0e0e0;
  --bt-text2:     #c0c0c0;
  --bt-muted:     #888888;
  --bt-border:    rgba(201,162,39,.18);
  --bt-border2:   rgba(255,255,255,.07);
  --bt-shadow:    rgba(0,0,0,.4);
  --bt-sidebar-w: 300px;
  --bt-radius:    8px;
}

/* ────────────────────────────────────────
   PAGE WRAPPER
──────────────────────────────────────── */
.btr-page {
  background: var(--bt-bg);
  min-height: 100vh;
  direction: rtl;
  font-family: 'Bahij', 'Tajawal', 'Tahoma', Arial, sans-serif;
  color: var(--bt-text);
  font-size: 16px;
  position: relative;
}
/* ── نمط النجوم — مطابق لصفحة المرئيات (.page-programs::before) ── */
.btr-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 800px;
  background-image: url('../images/stars1.png');
  background-size: 655px;
  background-position: top center;
  background-repeat: repeat;
  opacity: 0.10;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100px, rgba(0,0,0,0) 500px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100px, rgba(0,0,0,0) 500px);
  z-index: 0;
  pointer-events: none;
}



/* ────────────────────────────────────────
   LAYOUT — SIDEBAR + MAIN
──────────────────────────────────────── */
.btr-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "main";
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  padding: 0 16px 60px;
  gap: 0;
  box-sizing: border-box;
}

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.btr-sidebar {
  display: none !important;
}

.btr-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bt-bg2);
  border: 1px solid var(--bt-border2);
  border-radius: var(--bt-radius);
  overflow: hidden;
}

/* ── رأس السايدبار ── */
.btr-sb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--bt-teal-dk), #1a3838);
  border-bottom: 2px solid var(--bt-gold);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.btr-sb-header i {
  color: var(--bt-gold);
  font-size: 1.1rem;
}

/* ── قائمة المحاور في السايدبار ── */
.btr-topics-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bt-teal) transparent;
}

.btr-topics-nav::-webkit-scrollbar { width: 4px; }
.btr-topics-nav::-webkit-scrollbar-thumb { background: var(--bt-teal); border-radius: 4px; }

.btr-nav-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  text-decoration: none;
  color: var(--bt-text2);
  border-bottom: 1px solid var(--bt-border2);
  transition: background .15s, color .15s;
  min-height: 46px;
  position: relative;
}

.btr-nav-item:hover {
  background: rgba(54,109,109,.15);
  color: var(--bt-gold);
}

.btr-nav-item:hover .btr-nav-num {
  background: var(--bt-teal-lt);
  color: #fff;
}

/* المحور النشط */
.btr-nav-active {
  background: rgba(201,162,39,.1);
  color: var(--bt-gold) !important;
  border-right: 3px solid var(--bt-gold);
}

.btr-nav-active .btr-nav-num {
  background: var(--bt-gold) !important;
  color: #1e1e1e !important;
  font-weight: 800;
}

/* رقم المحور */
.btr-nav-num {
  flex-shrink: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  background: var(--bt-bg3);
  font-size: 13px;
  font-weight: 700;
  color: var(--bt-muted);
  border-left: 1px solid var(--bt-border2);
  transition: background .15s, color .15s;
}

/* عنوان المحور */
.btr-nav-title {
  flex: 1;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* عداد المشاهدات */
.btr-nav-views {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--bt-muted);
  padding: 0 8px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}

.btr-nav-views i { opacity: .5; font-size: 10px; }

/* ── بطاقة معلومات سريعة ── */
.btr-sb-info-card {
  flex-shrink: 0;
  padding: 14px 14px 12px;
  background: var(--bt-bg3);
  border-top: 1px solid var(--bt-border2);
}

.btr-sb-info-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--bt-gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btr-sb-info-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btr-sb-info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--bt-muted);
}

.btr-sb-info-list li strong {
  color: var(--bt-text);
  font-size: 13px;
}

.btr-sb-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  background: var(--bt-teal);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
}

.btr-sb-back-btn:hover {
  background: var(--bt-teal-lt);
  color: #fff;
}

/* ════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════ */
.btr-main {
  grid-area: main;
  min-width: 0;
  padding-top: 6px;
}

/* ── رأس المحور ── */
.btr-content-header {
  background: linear-gradient(135deg, var(--bt-bg2) 0%, var(--bt-bg3) 100%);
  border: 1px solid var(--bt-border2);
  border-top: 3px solid var(--bt-gold);
  border-radius: var(--bt-radius);
  padding: 28px 32px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.btr-content-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(201,162,39,.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.btr-ch-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btr-ch-num {
  background: var(--bt-gold);
  color: #1e1e1e;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
}

.btr-ch-sep {
  color: var(--bt-muted);
}

.btr-ch-total,
.btr-ch-views {
  font-size: 13px;
  color: var(--bt-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btr-ch-views i { opacity: .6; }

.btr-ch-title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.btr-ch-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.btr-ch-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--bt-gold), transparent);
}

.btr-ch-divider span:last-child {
  background: linear-gradient(90deg, transparent, var(--bt-gold));
}

.btr-ch-divider i {
  color: var(--bt-gold);
  font-size: .9rem;
  opacity: .7;
}

/* ════════════════════════════════════════
   زر تحكم حجم الخط العائم
════════════════════════════════════════ */
.btr-font-controls {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201,162,39,.25);
  border-radius: 16px;
  padding: 12px 10px;
  box-shadow:
    0 8px 32px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,.05) inset;
}

/* العنوان العمودي */
.btr-fc-label {
  font-size: 10px;
  color: var(--bt-gold);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 1px;
  opacity: .7;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btr-fc-label i {
  writing-mode: horizontal-tb;
  font-size: 12px;
  color: var(--bt-gold);
  margin-bottom: 6px;
}

.btr-fc-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

/* الأزرار */
.btr-fc-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(201,162,39,.2);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btr-fc-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(201,162,39,.15), transparent 70%);
  opacity: 0;
  transition: opacity .25s;
}

.btr-fc-btn:hover {
  background: rgba(201,162,39,.15);
  border-color: rgba(201,162,39,.5);
  color: var(--bt-gold);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(201,162,39,.2);
}

.btr-fc-btn:hover::before { opacity: 1; }

.btr-fc-btn:active { transform: scale(.95); }

/* زر الإعادة */
.btr-fc-reset {
  font-size: 11px;
  opacity: .7;
  margin-top: 2px;
  border-style: dashed;
}

.btr-fc-reset:hover { opacity: 1; }

/* عرض النسبة */
.btr-fc-size {
  font-size: 11px;
  color: var(--bt-gold);
  font-weight: 700;
  min-width: 36px;
  text-align: center;
  background: rgba(201,162,39,.1);
  border-radius: 6px;
  padding: 3px 0;
  letter-spacing: .5px;
}

/* حالة السكون — شفاف قليلاً */
.btr-font-controls {
  opacity: 0.35;
  transition: opacity .3s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.btr-font-controls:hover,
.btr-font-controls.btr-fc-active {
  opacity: 1;
}

.btr-font-controls.btr-fc-dragging {
  cursor: grabbing;
  opacity: 1;
  box-shadow:
    0 16px 48px rgba(0,0,0,.7),
    0 0 0 2px rgba(201,162,39,.4) inset;
  transition: box-shadow .15s;
}

/* موبايل: نفس التصميم العمودي لكن أصغر قليلاً */
@media (max-width: 768px) {
  .btr-font-controls {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 8px;
    gap: 5px;
    border-radius: 14px;
  }
  .btr-fc-btn  { width: 32px; height: 32px; border-radius: 8px; }
  .btr-fc-size { font-size: 10px; min-width: 32px; }
}

/* ── مقال المحتوى ── */
.btr-article {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--bt-radius);
  margin-bottom: 20px;
  min-height: 400px;
}

/* المحتوى المكتوب */
.btr-article-body {
  padding: 32px 36px;
  font-size: 17px;
  line-height: 2;
  color: var(--bt-text);
}

.btr-article-body h2,
.btr-article-body h3 {
  color: var(--bt-gold);
  font-weight: 700;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bt-border);
}

.btr-article-body h2 { font-size: 1.3rem; }
.btr-article-body h3 { font-size: 1.1rem; }

.btr-article-body p {
  margin: 0 0 18px;
  text-align: justify;
}

.btr-article-body blockquote {
  border-right: 4px solid var(--bt-gold);
  background: rgba(201,162,39,.06);
  border-radius: 0 var(--bt-radius) var(--bt-radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 1.05rem;
  font-style: normal;
  color: rgba(255,255,255,.88);
}

.btr-article-body ul,
.btr-article-body ol {
  padding-right: 20px;
  margin: 0 0 18px;
}

.btr-article-body li {
  margin-bottom: 8px;
  line-height: 1.85;
}

.btr-article-body a {
  color: var(--bt-teal-lt);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}

.btr-article-body a:hover { color: var(--bt-gold); }

.btr-article-body img {
  max-width: 100%;
  border-radius: var(--bt-radius);
  margin: 16px 0;
}

/* ── Placeholder — لما لا يوجد محتوى ── */
.btr-placeholder {
  padding: 60px 32px;
  text-align: center;
}

.btr-placeholder-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bt-teal-dk), #1a3838);
  border: 2px solid var(--bt-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--bt-gold);
  margin: 0 auto 20px;
}

.btr-placeholder h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px;
}

.btr-placeholder > p {
  font-size: 14px;
  color: var(--bt-muted);
  margin: 0 0 28px;
}

.btr-placeholder-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 500px;
  margin: 0 auto;
}

.btr-ps-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bt-bg3);
  border: 1px solid var(--bt-border2);
  border-radius: var(--bt-radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--bt-text2);
  text-align: right;
}

.btr-ps-item i {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bt-teal-dk);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--bt-gold);
}

/* ════════════════════════════════════════
   PAGINATION — التنقل بين المحاور
════════════════════════════════════════ */
.btr-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.btr-pag-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bt-bg2);
  border: 1px solid var(--bt-border2);
  border-radius: var(--bt-radius);
  text-decoration: none;
  color: var(--bt-text);
  transition: background .2s, border-color .2s, transform .15s;
}

.btr-pag-btn:hover {
  background: rgba(54,109,109,.2);
  border-color: var(--bt-teal);
  color: var(--bt-gold);
  transform: translateY(-2px);
}

.btr-pag-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ديسكتوب: السابق arrow يمين / التالي arrow يسار */
.btr-pag-prev {
  flex-direction: row;           /* HTML=[arrow][info] → RTL: arrow يمين ✓ */
  justify-content: flex-start;
}
.btr-pag-next {
  flex-direction: row;           /* HTML=[info][arrow] → RTL: info يمين، arrow يسار ✓ */
  justify-content: flex-start;
}

.btr-pag-prev .btr-pag-info,
.btr-pag-next .btr-pag-info {
  flex: 1;
  min-width: 0;
}

.btr-pag-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bt-teal-dk);
  border: 1px solid var(--bt-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bt-gold);
  flex-shrink: 0;
  transition: background .2s;
}

.btr-pag-btn:hover .btr-pag-arrow {
  background: var(--bt-teal);
}

.btr-pag-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.btr-pag-prev .btr-pag-info { align-items: flex-start; }
.btr-pag-next .btr-pag-info { align-items: flex-end; }

.btr-pag-label {
  font-size: 11px;
  color: var(--bt-muted);
  margin-bottom: 3px;
}

.btr-pag-name {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.btr-pag-index {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  background: var(--bt-teal-dk);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  text-decoration: none;
  color: var(--bt-gold);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  transition: background .2s;
  white-space: nowrap;
}

.btr-pag-index:hover { background: var(--bt-teal); color: #fff; }
.btr-pag-index i { font-size: 1.2rem; }

/* ════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════ */
.btr-anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1);
}

.btr-anim-in {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --bt-sidebar-w: 260px; }
}

@media (max-width: 720px) {
  .btr-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    padding: 0 10px 40px;
    gap: 0;
  }

  .btr-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    z-index: 999;
    transition: right .3s ease;
    border-radius: 0;
  }

  .btr-sidebar-inner {
    height: 100%;
    border-radius: 0;
  }

  .btr-sidebar.btr-sidebar-open {
    right: 0;
    box-shadow: -6px 0 30px rgba(0,0,0,.6);
  }

  .btr-content-header { padding: 20px 18px 16px; }
  .btr-article-body { padding: 20px 18px; font-size: 16px; }

  /* ── التنقل في الموبايل — توحيد كامل للأزرار الثلاثة ── */
  .btr-pagination {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* حجم موحد تماماً — عرضاً وارتفاعاً */
  .btr-pag-btn,
  .btr-pag-index {
    width: 100% !important;
    height: 70px !important;
    min-height: unset !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden;
    flex-shrink: 0;
  }

  /* "كل المحاور" يظهر أولاً */
  .btr-pag-index {
    order: -1;
    flex-direction: row !important;
    justify-content: center;
    font-size: 14px;
  }

  /* السابق: row-reverse لتطابق العرض */
  .btr-pag-prev {
    flex-direction: row-reverse;
    gap: 10px;
  }

  /* التالي: row لتطابق العرض */
  .btr-pag-next {
    flex-direction: row;
    gap: 10px;
  }

  /* كلا الزرين: معلومات محاذاة يمين */
  .btr-pag-prev .btr-pag-info,
  .btr-pag-next .btr-pag-info {
    flex: 1;
    min-width: 0;
    align-items: flex-start;
    text-align: right;
  }

  /* السهم أصغر للموبايل */
  .btr-pag-arrow {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    font-size: 12px;
  }

  .btr-pag-label { font-size: 10px; margin-bottom: 2px; }

  .btr-pag-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btr-placeholder-steps { grid-template-columns: 1fr; }
}

/* ── زر فتح السايدبار (موبايل) — محذوف ── */
.btr-sidebar-toggle {
  display: none !important;
}
