/* ==========================================================================
   Esal Help Center — Stylesheet
   تصميم احترافي على نمط Google Help / Zendesk، يدعم RTL والعربية.
   ========================================================================== */

:root {
  --hc-primary: #6366F1;
  --hc-primary-dark: #4F46E5;
  --hc-primary-darker: #4338CA;
  --hc-ink: #0F172A;
  --hc-text: #1E293B;
  --hc-muted: #64748B;
  --hc-soft: #94A3B8;
  --hc-line: #E2E8F0;
  --hc-line-soft: #EEF2F7;
  --hc-bg: #F8FAFC;
  --hc-card: #FFFFFF;
  --hc-accent-bg: #EEF2FF;
  --hc-radius: 14px;
  --hc-radius-sm: 10px;
  --hc-shadow: 0 10px 30px rgba(15, 23, 42, .05);
  --hc-shadow-hover: 0 16px 38px rgba(15, 23, 42, .10);
  --hc-maxw: 1180px;
  --hc-header-h: 68px;
}

.hc-body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  color: var(--hc-text);
  background: var(--hc-bg);
  margin: 0;
  line-height: 1.85;
}

.hc-body * { box-sizing: border-box; }

.hc-shell { max-width: var(--hc-maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--hc-primary-dark); }

/* ============================ Hero / Search ============================ */
.hc-hero {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 45%, #4338CA 100%);
  color: #fff;
  padding: calc(var(--hc-header-h) + 56px) 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hc-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(99,102,241,.35), transparent 45%),
              radial-gradient(circle at 85% 0%, rgba(167,139,250,.25), transparent 40%);
  pointer-events: none;
}
.hc-hero-inner { position: relative; max-width: 760px; margin: 0 auto; z-index: 1; }
.hc-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; margin: 0 0 12px; line-height: 1.35; }
.hc-hero p { font-size: 18px; color: #C7D2FE; margin: 0 0 30px; }

.hc-search { position: relative; max-width: 620px; margin: 0 auto; }
.hc-search input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 18px 58px 18px 22px;
  font-size: 16px;
  font-family: inherit;
  color: var(--hc-ink);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
  outline: none;
}
.hc-search .hc-search-icon {
  position: absolute;
  inset-inline-start: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hc-muted);
  pointer-events: none;
}
.hc-search-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 10px);
  background: #fff;
  border-radius: var(--hc-radius-sm);
  box-shadow: 0 20px 48px rgba(15, 23, 42, .25);
  text-align: start;
  overflow: hidden;
  display: none;
  z-index: 20;
  max-height: 60vh;
  overflow-y: auto;
}
.hc-search-results.is-open { display: block; }
.hc-search-results a {
  display: block;
  padding: 13px 20px;
  color: var(--hc-text);
  text-decoration: none;
  border-bottom: 1px solid var(--hc-line-soft);
  font-size: 15px;
}
.hc-search-results a:last-child { border-bottom: 0; }
.hc-search-results a:hover,
.hc-search-results a.is-active { background: var(--hc-accent-bg); color: var(--hc-primary-darker); }
.hc-search-results .hc-sr-cat { display: block; font-size: 12px; color: var(--hc-soft); margin-top: 2px; }
.hc-search-results .hc-sr-empty { padding: 16px 20px; color: var(--hc-muted); font-size: 14px; }

/* ============================ Breadcrumb ============================ */
.hc-breadcrumb {
  font-size: 13.5px;
  color: var(--hc-muted);
  padding: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.hc-breadcrumb a { color: var(--hc-muted); text-decoration: none; }
.hc-breadcrumb a:hover { color: var(--hc-primary-dark); }
.hc-breadcrumb .sep { color: var(--hc-soft); }
.hc-breadcrumb .current { color: var(--hc-ink); font-weight: 700; }

/* ============================ Category grid (home) ============================ */
.hc-section-head { margin: 48px 0 20px; }
.hc-section-head h2 { font-size: 24px; font-weight: 900; color: var(--hc-ink); margin: 0; }
.hc-section-head p { color: var(--hc-muted); margin: 6px 0 0; }

.hc-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 8px;
}
.hc-cat-card {
  background: var(--hc-card);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius);
  padding: 26px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--hc-shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.hc-cat-card:hover { transform: translateY(-4px); border-color: #A5B4FC; box-shadow: var(--hc-shadow-hover); }
.hc-cat-ico {
  width: 52px; height: 52px;
  border-radius: 13px;
  background: var(--hc-accent-bg);
  display: grid; place-items: center;
  font-size: 26px;
  margin-bottom: 16px;
}
.hc-cat-card h3 { font-size: 19px; font-weight: 800; color: var(--hc-ink); margin: 0 0 8px; }
.hc-cat-card .hc-cat-desc { color: var(--hc-muted); font-size: 14.5px; margin: 0 0 16px; flex: 1; }
.hc-cat-links { list-style: none; padding: 0; margin: 0; }
.hc-cat-links li { margin: 0; }
.hc-cat-links a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0;
  color: var(--hc-text);
  text-decoration: none;
  font-size: 14.5px;
  border-top: 1px solid var(--hc-line-soft);
  transition: color .15s ease, padding .15s ease;
}
.hc-cat-links a:hover { color: var(--hc-primary-dark); padding-inline-start: 4px; }
.hc-cat-links a::before { content: "›"; color: var(--hc-soft); font-weight: 700; }
.hc-cat-more { display: inline-block; margin-top: 12px; color: var(--hc-primary-dark); font-weight: 800; font-size: 14px; text-decoration: none; }

/* ============================ Article layout ============================ */
.hc-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  gap: 36px;
  align-items: start;
  padding: 6px 0 80px;
}

/* Sidebar */
.hc-sidebar {
  position: sticky;
  top: calc(var(--hc-header-h) + 16px);
  max-height: calc(100vh - var(--hc-header-h) - 32px);
  overflow-y: auto;
  padding-inline-end: 8px;
}
.hc-sidebar-block { margin-bottom: 22px; }
.hc-sidebar-title {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--hc-soft); text-transform: uppercase;
  margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
}
.hc-sidebar-links { list-style: none; padding: 0; margin: 0; }
.hc-sidebar-links a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--hc-text);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.hc-sidebar-links a:hover { background: var(--hc-line-soft); color: var(--hc-ink); }
.hc-sidebar-links a.is-current { background: var(--hc-accent-bg); color: var(--hc-primary-darker); font-weight: 800; }

/* Main article */
.hc-article {
  background: var(--hc-card);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius);
  padding: 40px 44px;
  box-shadow: var(--hc-shadow);
  min-width: 0;
}
.hc-article .hc-h1 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 900;
  color: var(--hc-ink);
  margin: 0 0 8px;
  line-height: 1.4;
}
.hc-article-meta {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  color: var(--hc-muted); font-size: 13.5px;
  padding-bottom: 20px; margin-bottom: 24px;
  border-bottom: 1px solid var(--hc-line);
}
.hc-article-meta .hc-chip {
  background: var(--hc-accent-bg); color: var(--hc-primary-darker);
  padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 12.5px;
}

.hc-content { font-size: 16px; }
.hc-content .hc-h2 {
  font-size: 23px; font-weight: 800; color: var(--hc-ink);
  margin: 38px 0 14px; padding-top: 8px; scroll-margin-top: calc(var(--hc-header-h) + 20px);
}
.hc-content .hc-h3 {
  font-size: 19px; font-weight: 800; color: #1E293B;
  margin: 26px 0 10px; scroll-margin-top: calc(var(--hc-header-h) + 20px);
}
.hc-content .hc-h4 { font-size: 16.5px; font-weight: 800; color: #334155; margin: 20px 0 8px; }
.hc-content p { margin: 0 0 16px; }
.hc-content ul.hc-list, .hc-content ol.hc-list { margin: 0 0 18px; padding-inline-start: 26px; }
.hc-content ul.hc-list li, .hc-content ol.hc-list li { margin: 6px 0; }
.hc-content a { color: var(--hc-primary-dark); text-decoration: none; border-bottom: 1px solid rgba(99,102,241,.3); }
.hc-content a:hover { border-bottom-color: var(--hc-primary-dark); }
.hc-content strong { color: var(--hc-ink); font-weight: 800; }

.hc-content .hc-hr { border: 0; border-top: 1px solid var(--hc-line); margin: 30px 0; }

.hc-content blockquote.hc-quote {
  margin: 18px 0;
  padding: 14px 18px;
  background: #FFFBEB;
  border-inline-start: 4px solid #F59E0B;
  border-radius: 8px;
  color: #78350F;
}
.hc-content blockquote.hc-quote p:last-child { margin-bottom: 0; }

.hc-inline-code {
  background: var(--hc-line-soft);
  color: #BE185D;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .9em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.hc-code {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.7;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.hc-code code { white-space: pre; font-family: inherit; }

.hc-img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--hc-line); margin: 8px 0; }

/* Tables */
.hc-table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--hc-line); border-radius: 12px; }
.hc-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.hc-table th, .hc-table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--hc-line); vertical-align: top; }
.hc-table thead th { background: #F1F5F9; color: var(--hc-ink); font-weight: 800; white-space: nowrap; }
.hc-table tbody tr:nth-child(even) { background: #FAFBFC; }
.hc-table tbody tr:hover { background: var(--hc-accent-bg); }
.hc-table tbody tr:last-child td { border-bottom: 0; }

/* Table of contents (right rail) */
.hc-toc { position: sticky; top: calc(var(--hc-header-h) + 16px); font-size: 13.5px; }
.hc-toc-title { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--hc-soft); text-transform: uppercase; margin: 0 0 10px; }
.hc-toc ul { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--hc-line); }
.hc-toc li a {
  display: block; padding: 5px 14px; color: var(--hc-muted); text-decoration: none;
  border-inline-start: 2px solid transparent; margin-inline-start: -2px; transition: color .15s ease, border-color .15s ease;
}
.hc-toc li.lvl-3 a { padding-inline-start: 26px; font-size: 13px; }
.hc-toc li a:hover { color: var(--hc-primary-dark); }
.hc-toc li a.is-active { color: var(--hc-primary-darker); border-inline-start-color: var(--hc-primary); font-weight: 800; }

/* Feedback + related */
.hc-feedback {
  margin-top: 36px; padding: 22px 24px;
  background: var(--hc-bg); border: 1px solid var(--hc-line);
  border-radius: 12px; display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
}
.hc-feedback h4 { margin: 0; font-size: 16px; color: var(--hc-ink); }
.hc-feedback .hc-fb-btns { display: flex; gap: 10px; }
.hc-fb-btn {
  border: 1px solid var(--hc-line); background: #fff; color: var(--hc-text);
  border-radius: 8px; padding: 9px 18px; font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s ease; display: inline-flex; align-items: center; gap: 6px;
}
.hc-fb-btn:hover { border-color: var(--hc-primary); color: var(--hc-primary-dark); }
.hc-fb-btn.is-selected { background: var(--hc-accent-bg); border-color: var(--hc-primary); color: var(--hc-primary-darker); }
.hc-fb-thanks { color: #059669; font-weight: 700; }

.hc-prevnext { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.hc-prevnext a {
  flex: 1 1 220px; text-decoration: none; color: inherit;
  border: 1px solid var(--hc-line); border-radius: 12px; padding: 16px 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hc-prevnext a:hover { border-color: #A5B4FC; box-shadow: var(--hc-shadow); }
.hc-prevnext .lbl { font-size: 12px; color: var(--hc-soft); display: block; margin-bottom: 4px; }
.hc-prevnext .ttl { font-weight: 800; color: var(--hc-ink); }

/* CTA */
.hc-cta {
  margin: 40px 0 0; background: #111827; color: #fff; border-radius: var(--hc-radius);
  padding: 30px; display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.hc-cta h3 { margin: 0 0 6px; font-size: 22px; }
.hc-cta p { margin: 0; color: #CBD5E1; }
.hc-cta a {
  flex: 0 0 auto; background: #fff; color: var(--hc-primary-darker);
  text-decoration: none; border-radius: 10px; padding: 13px 24px; font-weight: 900;
}

/* ============================ Responsive ============================ */
@media (max-width: 1024px) {
  .hc-layout { grid-template-columns: minmax(0, 1fr); }
  .hc-sidebar, .hc-toc { position: static; max-height: none; }
  .hc-sidebar {
    order: 2; border: 1px solid var(--hc-line); border-radius: 12px;
    background: #fff; padding: 18px; margin-top: 28px;
  }
  .hc-toc { display: none; }
  .hc-article { order: 1; }
}
@media (max-width: 640px) {
  .hc-shell { padding: 0 16px; }
  .hc-article { padding: 26px 20px; }
  .hc-hero { padding: calc(var(--hc-header-h) + 32px) 16px 48px; }
  .hc-cta { flex-direction: column; align-items: flex-start; }
  .hc-cta a { width: 100%; text-align: center; }
}
