/* ========================================
   research.css – مندمج بالكامل مع الهوية الموحدة
   يغطي صفحة القائمة وصفحة التفاصيل
   ======================================== */

/* ---------- هيرو البحوث (لصفحة القائمة) ---------- */
.research-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.research-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 183, 77, 0.16);
  border: 1px solid rgba(255, 183, 77, 0.4);
  color: #fff3cf;
  font-weight: 700;
  margin-bottom: 16px;
}

.research-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.3;
}

.research-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.125rem;
  line-height: 1.9;
  max-width: 760px;
}

/* ---------- سطح المحتوى الرئيسي (لصفحة القائمة) ---------- */
.research-shell {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  padding: 22px;
}

/* شريط التصنيفات الأفقي */
.categories-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 4px 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) var(--border-light);
}

.categories-container::-webkit-scrollbar {
  height: 6px;
}
.categories-container::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: 10px;
}
.categories-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.category-btn {
  flex: 0 0 auto;
  padding: 10px 22px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 60px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.category-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.category-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(1, 87, 155, 0.2);
}

/* شريط المعلومات */
.research-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.results-count {
  font-weight: 800;
  font-size: 1.125rem;
  padding: 10px 16px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 60px;
}

.results-hint {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ---------- بطاقات البحوث (لصفحة القائمة) ---------- */
.research-page .item-card {
  margin-bottom: 16px;
}

.item-header {
  width: 100%;
  border: 0;
  background: linear-gradient(180deg, #fafcff, #fff);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  transition: var(--transition);
}

.item-header:hover {
  background: var(--primary-soft);
}

.expand-icon {
  color: var(--primary);
  font-size: 1.125rem;
  transition: transform 0.25s ease;
}

.item-card:not(.collapsed) .expand-icon {
  transform: rotate(180deg);
}

.item-body {
  padding: 20px;
  background: #fbfdff;
  border-top: 1px solid var(--border-light);
}

.item-section {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border-light);
}

.item-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-dark);
  font-weight: 800;
  margin-bottom: 10px;
}

.item-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 2;
  color: var(--text-main);
  font-size: 1.06rem;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.meta-chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid rgba(1, 111, 174, 0.1);
}

.tag {
  background: rgba(255, 183, 77, 0.12);
  color: #7d5a07;
  border: 1px solid rgba(255, 183, 77, 0.2);
  font-weight: 700;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
}

.action-btn {
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.action-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.action-btn.success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

/* الترقيم */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.page-btn {
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--primary-dark);
  border-radius: 14px;
  padding: 10px 15px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 700;
}

.page-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: var(--primary-soft);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* حالات التحميل والفراغ */
.loading-spinner,
.empty-state,
.error-state {
  text-align: center;
  padding: 34px 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--primary-dark);
}

.empty-state i,
.error-state i {
  font-size: 2.8rem;
  margin-bottom: 14px;
  color: var(--accent);
}

/* ---------- صفحة تفاصيل البحث ---------- */
.research-details-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 46px;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 8px;
  color: #94a3b8;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* بطاقة البحث الكاملة */
.research-full {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}

.research-full-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.research-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.research-category {
  background: var(--primary-soft);
  padding: 5px 15px;
  border-radius: 30px;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.9rem;
}

.research-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.research-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 15px;
  color: var(--primary-dark);
}

.research-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  color: var(--text-main);
  padding-top: 10px;
}

.research-author i {
  color: var(--primary);
}

/* الملخص */
.research-abstract {
  background: var(--primary-soft);
  padding: 20px 25px;
  border-radius: 18px;
  margin: 20px 0;
  font-size: 1.1rem;
  line-height: 1.9;
  border-right: 4px solid var(--primary);
  color: var(--text-main);
}

/* محتوى البحث */
.research-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-main);
}

.research-content h2,
.research-content h3 {
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  font-weight: 700;
  color: var(--primary-dark);
}

.research-content p {
  margin-bottom: 1.5em;
}

/* شريط الأدوات */
.research-toolbar {
  display: flex;
  gap: 15px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.tool-btn {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 40px;
  padding: 10px 20px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.95rem;
}

.tool-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* بحوث مشابهة */
.similar-researches {
  margin: 40px 0 50px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
  color: var(--primary-dark);
  font-weight: 800;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 70px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

/* شبكة بطاقات البحوث المشابهة */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.research-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.res-category {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 30px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.res-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.res-title a {
  text-decoration: none;
  color: inherit;
}

.res-title a:hover {
  color: var(--primary);
}

.res-abstract {
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.res-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-light);
  padding-top: 16px;
  font-size: 0.9rem;
}

.res-date {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-read {
  background: none;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 40px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-read:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- تحسينات الجوال (عامة) ---------- */
@media (max-width: 768px) {
  .research-hero {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .research-shell {
    padding: 16px;
    border-radius: 22px;
  }

  .item-header {
    padding: 14px 14px;
    gap: 10px;
  }

  .item-body {
    padding: 14px;
  }

  .item-section {
    padding: 14px;
  }

  .item-text {
    font-size: 1rem;
  }

  .results-count,
  .results-hint {
    width: 100%;
    text-align: center;
  }

  .research-full {
    padding: 20px;
  }

  .research-title {
    font-size: 1.8rem;
  }

  .research-abstract {
    padding: 16px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .tool-btn {
    flex: 1;
    justify-content: center;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }
}