/* ════════════════════════════════════════════════════════════════════════
   REQUEST HUB — بوابة الطلبات الذكية (موديول مستقل قابل للإزالة بالكامل)
   ────────────────────────────────────────────────────────────────────────
   • لا يُعرّف أي class من poster-* (نعيد استخدامها كما هي من main.css).
   • كل الأنماط هنا مُسبَّقة بـ rh- أو dev-course- فقط.
   • متوافق مع الثيمات الأربعة عبر متغيرات :root.
   • للإزالة: احذف هذا الملف + سطر <link> + مجلد assets/js/request-hub/.
   ════════════════════════════════════════════════════════════════════════ */

#rh-root { position: relative; min-height: 200px; }

/* تخفي عناصر صفحة الطلبات القديمة دون حذفها من DOM */
.rh-legacy-hidden { display: none !important; }

/* ── انتقال الشاشات ─────────────────────────────────────────────── */
.rh-screen { animation: rhScreenIn 0.34s cubic-bezier(0.4, 0, 0.2, 1) both; }
.rh-screen.rh-back { animation: rhScreenInBack 0.34s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes rhScreenIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes rhScreenInBack {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── شريط علوي: رجوع + مسار ─────────────────────────────────────── */
.rh-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.rh-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
}
.rh-back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(3px);
}
.rh-back-btn i { font-size: 0.78rem; }
.rh-topbar .breadcrumb { margin-bottom: 0; }

/* ── Hero ───────────────────────────────────────────────────────── */
.rh-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  min-height: 118px;
  display: flex;
  align-items: center;
}
.rh-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #172554 0%, #0d1f4a 42%, #0a0e17 100%);
  z-index: 0;
}
.rh-hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 28% 50%, rgba(0, 180, 216, 0.20) 0%, transparent 70%);
}
.rh-hero-bg::after {
  content: '';
  position: absolute;
  top: -55%; right: -28%;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.10) 0%, transparent 62%);
}
.rh-hero-content { position: relative; z-index: 1; padding: 26px 24px; }
.rh-hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.rh-hero-desc {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0;
}

/* ── المربعان الكبيران (بوابة الاختيار) ─────────────────────────── */
.rh-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 16px;
}
@media (min-width: 640px) { .rh-choice-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }

.rh-choice-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 26px 22px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  overflow: hidden;
  text-align: right;
  font-family: inherit;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.rh-choice-tile::before {
  content: '';
  position: absolute;
  top: -40%; left: -30%;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.12) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.rh-choice-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(0, 180, 216, 0.22);
  border-color: rgba(0, 180, 216, 0.42);
}
.rh-choice-tile:hover::before { opacity: 1; }
.rh-choice-tile:active { transform: translateY(-1px) scale(0.99); }

.rh-tile-icon {
  width: 72px; height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.rh-tile-icon svg { width: 100%; height: 100%; }
.rh-tile-body { position: relative; z-index: 1; }
.rh-tile-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.rh-tile-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.rh-tile-arrow {
  position: absolute;
  bottom: 20px; left: 22px;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 180, 216, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
  z-index: 1;
  transition: all 0.25s;
}
.rh-choice-tile:hover .rh-tile-arrow {
  background: var(--primary);
  color: #fff;
  transform: translateX(-4px);
}

/* ── شبكة كروت الجامعات / الفهارس ───────────────────────────────── */
.rh-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-bottom: 20px;
}
@media (min-width: 520px) { .rh-card-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 900px) { .rh-card-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.rh-pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px 16px;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.rh-pick-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0, 180, 216, 0.2);
  border-color: rgba(0, 180, 216, 0.4);
}
.rh-pick-card:active { transform: translateY(-1px); }
.rh-pick-icon {
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
}
.rh-pick-icon svg { width: 100%; height: 100%; }
.rh-pick-icon i { font-size: 2.3rem; color: var(--primary); }
.rh-pick-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}
.rh-pick-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.rh-pick-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(0, 180, 216, 0.1);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ── شرائح تصفية الكلية (اختيارية) ──────────────────────────────── */
.rh-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.rh-chip {
  padding: 7px 15px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.rh-chip:hover { border-color: var(--primary); color: var(--primary); }
.rh-chip.rh-chip-active {
  background: linear-gradient(135deg, #004052 0%, #00b4d8 100%);
  border-color: transparent;
  color: #fff;
}

/* ── سكيلتون كروت الاختيار ──────────────────────────────────────── */
.rh-pick-skeleton {
  height: 168px;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── حالة فارغة / معطّلة ────────────────────────────────────────── */
.rh-empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
  animation: rhScreenIn 0.4s ease both;
}
.rh-empty-icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(0, 180, 216, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.rh-empty-icon i { font-size: 2.1rem; color: var(--text-muted); }
.rh-empty h5 {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.rh-empty p { font-size: 0.9rem; margin: 0; }

/* ── إضافات بوستر الدورة التطويرية ──────────────────────────────────
   لا تكسر poster-* — فقط طبقة فوقها. */
.dev-course-card { /* يُستخدم مع poster-card */ }
.dev-course-card .poster-meta { flex-wrap: wrap; row-gap: 5px; }
.dev-course-request-btn { /* يُستخدم مع poster-action-btn */ }

/* الوضع الفاتح: ظلال أنعم */
:root[data-theme="light"] .rh-choice-tile:hover,
:root[data-theme="light"] .rh-pick-card:hover {
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.14), 0 0 0 1px rgba(37, 99, 235, 0.18);
}

/* جوال: حشوة أصغر + ترتيب عمودي للمربعين */
@media (max-width: 480px) {
  .rh-hero-content { padding: 22px 18px; }
  .rh-hero-title { font-size: 1.32rem; }
  .rh-choice-tile { padding: 22px 18px; }
  .rh-tile-arrow { bottom: 16px; left: 18px; }
}
