/* إعادة ضبط بسيطة */
@font-face {
  font-family: "GE_SS_Two";
  src: url("../fonts/GE_SS_Two.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "MontserratAlternates";
  src: url("../fonts/MontserratAlternates.otf") format("opentype");
  font-display: swap;
}


*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
#root {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #020617, #020617 40%, #000000);
  color: #f9fafb;
  direction: rtl;
}

/* الجذر */
.app-root {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* طبقة خلفية شفافة */
.background-overlay {
  position: absolute;
  inset: -60px; /* يزيد مساحة الخلفية لتغطية الحواف السفلية */
  background:
    radial-gradient(circle at 10% 20%, rgba(220, 38, 38, 0.22), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.95) 0%, rgba(5, 8, 22, 0.96) 50%, rgba(5, 9, 20, 0.98) 100%);
  opacity: 0.95;
  pointer-events: none;
}

/* الحاوية الرئيسية */
.app-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;  /* إزالة المسافة العلوية تماماً */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;  /* تقليل المسافات بين العناصر */
}

/* الهيدر */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;   /* يبقي اللوجو بالنص */
  justify-content: flex-start;  /* يجعل العناصر في الأعلى */
  gap: 4px;
  margin-top: 16px;  /* إنزال الهيدر لأسفل قليلاً */
}


/* شعار المكتبة في الهيدر */
.header-logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-logo {
  width: 250px;      /* تكبير الشعار أكثر */
  height: auto;
  margin-bottom: 6px;
  margin-top: 0;
  filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.55));
}


.header-title-block {
  text-align: right;      /* النصوص كلّها تنتقل لليسار */
  width: 100%;
}


.site-title {
  font-size: 1.4rem;
  font-weight: ;
  letter-spacing: 0.04em;
  margin-bottom: 0;  /* إزالة المسافة */
  margin-top: -5px;  /* رفع للأعلى */
}

.site-subtitle {
  font-size: 0.95rem;
  color: #e5e7eb;
  line-height: 1.6;
  margin-bottom: 0;  /* إزالة المسافة */
}

/* شارة وضع المعرض */
.header-badge {
  display: inline-flex;
  align-items: center;     /* أهم سطر! ينزّل النقطة للنص */
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(12px);
}

.header-badge {
  margin-right: 0 !important;   /* ينقل الشارة لليمين */
  margin-left: auto !important;
  text-align: right !important;
  justify-content: flex-end !important;
}

.badge-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e5e7eb;
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #22c55e; /* الأخضر */
  display: inline-block;
  margin: 0 6px;
  animation: pulse-dot 1.3s ease-in-out infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    opacity: 1;
  }
  50% {
    transform: scale(1.6);
    box-shadow: 0 0 12px 4px rgba(34, 197, 94, 0.4);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2);
    opacity: 1;
  }
}


.language-switcher {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lang-btn {
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.lang-btn.active {
  background: #f97316;
  color: #000;
}

.lang-btn:hover {
  background: rgba(249, 115, 22, 0.8);
}

/* الأقسام */
.section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  max-width: 520px;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-description {
  font-size: 0.9rem;
  color: #e5e7eb;
  line-height: 1.6;
}

/* نص مميز */
.accent {
  color: #f97316;
  font-weight: 700;
}

/* حالة عدم وجود بيانات */
.empty-state {
  padding: 20px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  text-align: center;
  font-size: 0.9rem;
}

/* زر رجوع */
.back-button {
  border: none;
  outline: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
  cursor: pointer;
  margin-bottom: 8px;
}

/* ================== التصنيفات ================== */

.categories-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

/* موبايل */
@media (max-width: 767px) {
  .categories-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* تابلت */
@media (min-width: 768px) and (max-width: 1199px) {
  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* شاشات كبيرة – 4 تصنيفات في الصف */
@media (min-width: 1200px) {
  .categories-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.category-card {
  border-radius: 18px;
  background: radial-gradient(circle at top left, #1b2735, #050816);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px 20px;
  text-align: right;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.55);
  margin-bottom: 10px;
}

.category-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.9);
}

.category-pill-text {
  font-size: 0.75rem;
  color: #e5e7eb;
}

.category-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #f9fafb;
}

.category-description {
  font-size: 0.85rem;
  color: #e5e7eb;
  line-height: 1.6;
  margin-bottom: 14px;
}

.category-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #c4b5fd;
}

.category-link {
  text-decoration: underline dotted;
}

/* ================== الكتب – كروت أفقية ================== */

.books-grid {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

/* موبايل */
@media (max-width: 767px) {
  .books-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* تابلت */
@media (min-width: 768px) and (max-width: 1199px) {
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* شاشات كبيرة */
@media (min-width: 1200px) {
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* بطاقة الكتاب الأفقية داخل صفحة التصنيف */
.book-card-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;   /* يخلي الصورة + النص في نص البطاقة عموديًا */
  gap: 18px;
  border-radius: 18px;
  background: radial-gradient(circle at top left, #0b1623, #050816);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}


.book-card-horizontal:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

/* الغلاف */
.book-cover-h {
  width: 140px;
  height: 210px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: radial-gradient(circle at top, #1f2933, #020617);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover-h img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover-text {
  font-weight: 700;
  font-size: 1.5rem;
  color: #e5e7eb;
}

/* النص داخل البطاقة */
.book-info-h {
  display: flex;
  flex-direction: column;
  justify-content: center;   /* كل النصوص في النص عموديًا */
  flex: 1;
  text-align: right;
  gap: 10px;                 /* مسافة بسيطة بين العنوان والبادجات والزر */
}

.book-title-h {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 4px;
}

.book-author-h {
  font-size: 14px;
  color: #cbd5e1;
  margin-top: 4px;
}

.book-teaser {
  font-size: 0.83rem;
  color: #e5e7eb;
  line-height: 1.5;
  margin-top: 6px;
}

/* عناصر التقييم والمدة */
.book-meta-h {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.meta-pill {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
}

/* زر "شاهد الملخص / افتح الكتاب" */
.book-actions-h {
  margin-top: 6px;
}


.book-btn-h {
  padding: 8px 16px;
  background: linear-gradient(90deg, #ca8a04, #eab308, #facc15);
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  transition: opacity 0.2s;
}

.book-btn-h:hover {
  opacity: 0.85;
}

/* ================== تفاصيل الكتاب ================== */

.book-details-section {
  gap: 20px;
}



/* مسار تنقل */
.breadcrumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.back-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.8rem;
  color: #cbd5f5;
  text-decoration: underline;
}

.breadcrumb-separator {
  font-size: 0.8rem;
  color: #9ca3af;
}

.breadcrumb-current {
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* تخطيط تفاصيل الكتاب */
.book-details-layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

.book-details-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* الإطار الخارجي للغلاف الكبير */
.book-cover-large {
  width: 100%;
  max-width: 320px;
  height: 420px;
  margin: 0 auto 1.5rem;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(circle at top, #111827, #020617);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  flex-shrink: 0;
}

.book-cover-large-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* منع قصّ أجزاء من الغلاف */
  padding: 12px;       /* مسافة بسيطة لتجنب الالتصاق بالحواف */
  display: block;
  background: #0b1623;
}

.book-cover-large-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: #e5e7eb;
}

.book-info-panel {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-author-large {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.book-meta-large {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* وسوم في تفاصيل الكتاب */
.book-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.book-tag {
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.16);
  color: #c7d2fe;
}

/* العمود الرئيسي */
.book-details-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.book-text-block {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.block-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.block-text {
  font-size: 0.9rem;
  color: #e5e7eb;
  line-height: 1.7;
  margin-bottom: 6px;
}

/* الفيديو والصوت */
.book-video,
.book-audio {
  width: 100%;
  border-radius: 12px;
  margin-top: 8px;
  display: block;
}

.book-video {
  aspect-ratio: 16/9;
  max-height: 400px;
  object-fit: contain;
  background: #000;
}

.book-audio {
  max-width: 100%;
}

/* نقاط */
.bullet-list {
  padding-right: 18px;
  font-size: 0.9rem;
  color: #e5e7eb;
  line-height: 1.7;
}

.bullet-list li {
  margin-bottom: 4px;
}

/* كروت الفيديو والصوت */
.media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.media-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(30, 64, 175, 0.6), #020617);
  border: 1px solid rgba(129, 140, 248, 0.7);
}

.media-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.media-text {
  font-size: 0.86rem;
  color: #e5e7eb;
  line-height: 1.6;
  margin-bottom: 8px;
}

.media-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.media-lang-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-lang-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5f5;
}

.primary-button {
  border: none;
  outline: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #111827;
  font-weight: 700;
  cursor: not-allowed;
  opacity: 0.7;
}

/* تلميح AI */
.ai-hint {
  font-size: 0.85rem;
  color: #cbd5f5;
  padding-top: 4px;
}

/* الفوتر العام */
.footer {
  margin-top: auto;
  padding-top: 8px;
}

.footer {
  width: 100%;
  display: flex;
  justify-content: center;   /* النص بالنص */
  align-items: center;
  margin-top: 40px;
}

.footer-text {
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;        /* يدعم الشاشات الصغيرة */
  width: 100%;
}


/* استجابة تفاصيل الكتاب */
@media (max-width: 900px) {
  .book-details-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .book-cover-large {
    max-width: 260px;
    height: 360px;
  }
}

/* دعم الآيباد */
@media (min-width: 1024px) {
  .app-container {
    padding-inline: 40px;
  }

  .site-title {
    font-size: 2.4rem;
  }
}

/* ================== ADMIN PANEL ================== */

.admin-page {
  min-height: 100vh;
  width: 100%;
  direction: ltr;            /* كان rtl */
  display: flex;
  justify-content: center;
  padding: 48px 0 32px;
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #020617 100%);
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro", sans-serif;
}

.admin-container {
  width: 100%;
  max-width: 980px;
  padding: 0 24px;
}

/* الهيدر */

.admin-header {
  text-align: left;          /* كان right */
  margin-bottom: 24px;
}

.admin-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-subtitle {
  font-size: 14px;
  color: #94a3b8;
}

.admin-note {
  margin-top: 6px;
  font-size: 12px;
  color: #38bdf8;
}

/* البطاقات */

.admin-section {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.15), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.admin-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-section-text {
  font-size: 13px;
  color: #9ca3af;
}

/* رسائل */

.admin-alert {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 13px;
}

.admin-error {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  font-size: 13px;
  color: #fecaca;
}

/* قائمة التصنيفات */

.admin-categories-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-category-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.9);
}

.admin-category-name {
  font-size: 14px;
  font-weight: 600;
}

.admin-category-desc {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.admin-category-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.5);
  color: #a5f3fc;
}

/* النماذج */

.admin-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-label {
  font-size: 13px;
  color: #e5e7eb;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  font-size: 14px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.95);
  padding: 8px 14px;
  outline: none;
}

.admin-textarea {
  border-radius: 16px;
  min-height: 70px;
  resize: vertical;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

/* شبكة عمودين لبعض الحقول */

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* أزرار */

.admin-footer-note {
  margin-top: 10px;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
}

/* موبايل */

@media (max-width: 900px) {
  .admin-page {
    padding-top: 24px;
  }

  .admin-container {
    max-width: 100%;
    padding: 0 12px;
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* زر الحفظ في لوحة التحكم */
.primary-button {
  cursor: pointer;
}

/* لو الزر متعطل فعلًا */
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* شبكة البطاقات (تعديل إضافي) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

/* بطاقة التصنيف (ستايل VIP) */
.category-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: 0.3s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
}

/* شريط عدد الكتب */
.category-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 4px 12px;
  font-size: 13px;
  margin-bottom: 10px;
  width: fit-content;
}

.category-pill-dot {
  width: 8px;
  height: 8px;
  background: #ff4d4d;
  border-radius: 50%;
}

.category-pill-text {
  color: #d0eaff;
}

/* العنوان */
.category-name {
  color: #fff;
  font-size: 20px;
  margin-bottom: 6px;
}

/* الوصف */
.category-description {
  color: #d4d4d4;
  font-size: 15px;
  line-height: 1.5;
  min-height: 40px;
}

/* زر الحذف */
.admin-delete-button {
  margin-top: 14px;
  background: rgba(255, 60, 60, 0.22);
  border: 1px solid rgba(255, 90, 90, 0.45);
  color: #ff9a9a;
  padding: 6px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

.admin-delete-button:hover {
  background: rgba(255, 60, 60, 0.35);
}

/* ===== مشغل صوت VIP ===== */

.vip-audio-player {
  width: 100%;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.65);
}

.vip-audio-player::-webkit-media-controls-panel {
  background: #ffffff;
  border-radius: 999px;
  padding: 4px 10px;
}
.site-title {
  font-size: 1.5rem !important;   /* يتحكم مهما كان قبله */
  text-align: right !important;
}
/* بطاقة الصوت VIP */
.audio-card {
  display: flex;
  flex-direction: column;
  justify-content: center;     /* يخلي كل المحتوى في النص عموديًا */
  align-items: center;         /* في النص أفقيًا */
  text-align: center;
  background: radial-gradient(circle at top, #020617, #020617 45%, #020617);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

/* نحافظ على شكل النص داخل البطاقة */
.audio-card .media-title {
  font-size: 1rem;
  margin-bottom: 4px;
}

.audio-card .media-text {
  max-width: 90%;
  margin-bottom: 10px;
}
/* ===== تأثير 3D عام على البطاقات ===== */
.category-card,
.book-card-horizontal {
  position: relative;
  transform-style: preserve-3d;
  perspective: 1100px;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
  animation: floatCard 12s ease-in-out infinite;
}

/* لمعة خفيفة تمر على البطاقة */
.category-card::before,
.book-card-horizontal::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.16),
    transparent
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* عند الهوفر: ارتفاع + ميلان بسيط + ظل قوي */
.category-card:hover,
.book-card-horizontal:hover {
  transform: translateY(-10px) rotate3d(1, -1, 0, 9deg);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 255, 255, 0.22);
}

/* تفعيل اللمعة على الهوفر */
.category-card:hover::before,
.book-card-horizontal:hover::before {
  opacity: 1;
  transform: translate3d(0, -4px, 40px);
}
/* ===== أزرار شجرة الصفحات (Breadcrumb) ===== */

.breadcrumb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.breadcrumb-chip {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.breadcrumb-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.8);
  transform: translateY(-1px);
}

.breadcrumb-chip-current {
  cursor: default;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.9);
  color: #e0f2fe;
}

.breadcrumb-arrow {
  font-size: 12px;
  color: #9ca3af;
}
.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
/* اتجاه عام حسب اللغة */
.app-container.rtl {
  direction: rtl;
  text-align: right;
}

.app-container.ltr {
  direction: ltr;
  text-align: left;
}

/* ضبط بعض النصوص المهمة في وضع الإنجليزي */
.app-container.ltr .header-title-block,
.app-container.ltr .section-title,
.app-container.ltr .section-description,
.app-container.ltr .book-title-h,
.app-container.ltr .book-author-h,
.app-container.ltr .book-teaser,
.app-container.ltr .book-details-title,
.app-container.ltr .block-title,
.app-container.ltr .block-text,
.app-container.ltr .bullet-list {
  text-align: left;
}

/* التاجز والبادجات في وضع الإنجليزي */
.app-container.ltr .book-tags-row {
  justify-content: flex-start;
}

/* فوتر في الوسط في الحالتين، بس لو حاب يكون LTR في الإنجليزي أكثر دقة */
.app-container.ltr .footer-text {
  text-align: center;
}
.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 11px;
  cursor: pointer;
  transition: 0.18s ease;
}

.lang-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.9);
}

.lang-btn.active {
  background: #2563eb;
  border-color: #93c5fd;
  color: #f9fafb;
}
/* تخلي معلومات الكتاب عمود، والزر ينزل لتحت */
.book-info-h {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* مسافة بسيطة فوق الزر */
.book-actions-h {
  margin-top: 20px;
}

/* (اختياري) توحيد ارتفاع البطاقة عشان الشكل يكون مرتب */
.book-card-horizontal {
  min-height: 260px;
}
/* نخلي البطاقة نفسها تتمدد وكل العناصر بداخلها تمتد */
.book-card-horizontal {
  display: flex;
  align-items: stretch;
  min-height: 260px; /* تقدر تكبرها لو حبيت */
}

/* نخلي جزء المعلومات ياخذ المساحة كاملة بشكل عمودي */
.book-info-h {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* هذا هو البلوك اللي فيه العنوان + المؤلف + الوصف + الميتا */
.book-info-h > div:first-child {
  flex-grow: 1;
}

/* نخلي الزر ينزل تحت على قد ما يقدر */
.book-actions-h {
  margin-top: 16px;
  justify-content: flex-end;
  display: flex;
}

/* عشان نتأكد ما في شيء يشد الزر لفوق */
.book-btn-h {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* جعل العناصر تورّث الخط من html */
body,
button,
input,
textarea,
select {
  font: inherit;
}

/* كل الموقع إنجليزي بشكل افتراضي */
html[lang="en"],
html[lang="en"] body,
html[lang="en"] body * {
  font-family: "MontserratAlternates", system-ui, sans-serif !important;
}

/* كل الموقع عربي */
html[lang="ar"],
html[lang="ar"] body,
html[lang="ar"] body * {
  font-family: "GE_SS_Two", system-ui, sans-serif !important;
}
html[lang="en"] * {
  direction: ltr !important;
  text-align: left !important;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #22c55e; /* نفس الأخضر */
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.category-pill-dot {
  width: 10px;
  height: 10px;
  background-color: #ef4444; /* الأحمر */
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
  animation: redPulse 1.4s ease-in-out infinite;
}

@keyframes redPulse {
  0% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    transform: scale(1.6);
    opacity: 0.7;
    box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.4);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
  }
}
html[lang="ar"] {
  font-variant-numeric: normal;
  unicode-bidi: plaintext;
}

html[lang="ar"] * {
  font-feature-settings: "lnum";
  direction: rtl;
}
/* ===== عناوين الكتب ===== */

/* عنوان الكتاب في بطاقات قائمة الكتب – إطار ثابت والعنوان يتلفف داخله */
.book-title-pill {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px 24px;
  border-radius: 999px;

  background: radial-gradient(circle at top, #111827, #020617);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 0 18px rgba(15, 23, 42, 0.9);

  color: #f9fafb;
  font-weight: 700;
  font-size: clamp(16px, 1.5vw, 20px);
  text-align: center;
  line-height: 1.25;

  /* يسمح بسطر أو سطرين داخل نفس الإطار */
  white-space: normal;
  word-break: break-word;

  margin: 0 auto 8px auto;
}

/* عنوان الكتاب في صفحة التفاصيل – بانر أفقي بسطر واحد مع ... */
.book-title-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 14px 32px;
  border-radius: 16px;

  background: rgba(4, 18, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.35);

  color: #ffffff;
  font-weight: 700;
  text-align: center;

  white-space: nowrap;        /* سطر واحد فقط */
  overflow: hidden;
  text-overflow: ellipsis;    /* يحط ... لو العنوان طويل */

  max-width: 80%;
  font-size: clamp(18px, 2vw, 26px);
  margin: 0 auto 22px auto;
}
/* ترتيب هيدر صفحة تفاصيل الكتاب */
.book-details-section .section-header-row {
  display: flex;
  flex-direction: column;   /* الفتات فوق والعنوان تحت */
  align-items: center;      /* يخلي العنوان بالنص */
  gap: 10px;
}

/* الفتات يبقى على اليمين */
.book-details-section .breadcrumb-row {
  align-self: flex-start;
}
/* تمييز عنوان نبذة عن الكتاب باللون البرتقالي */
.block-title-highlight {
  color: #f97316;      /* نفس لون .accent */
}
