/* Listing360 Docs Portal — custom styles layered on top of Tailwind (CDN utilities) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --brand-blue: #3A5BDB;
  --brand-blue-dark: #2C46AD;
  --brand-slate: #333740;
  --font-en: 'Inter', system-ui, -apple-system, sans-serif;
  --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-family: var(--font-en); }
html[lang="ar"] body { font-family: var(--font-ar); }

/* ---------- RTL layout ---------- */
html[dir="rtl"] .sidebar { right: 0; left: auto; border-left: 1px solid #e5e7eb; border-right: none; }
html[dir="rtl"] .main-content { margin-right: 280px; margin-left: 0; }
html[dir="rtl"] .callout { border-right-width: 4px; border-left-width: 0; }
html[dir="rtl"] .anchor-link { margin-right: 0.4rem; margin-left: 0; }
html[dir="rtl"] table { text-align: right; }
html[dir="rtl"] .mobile-menu-btn { right: auto; left: 1rem; }
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
html[dir="rtl"] .checklist li { padding-right: 1.75rem; padding-left: 0; }
html[dir="rtl"] .checklist li::before { right: 0.3rem; left: auto; }

@media (max-width: 1023px) {
  html[dir="rtl"] .main-content { margin-right: 0; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.main-content { margin-left: 280px; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 30; }
  .sidebar-backdrop.open { display: block; }
}

.nav-link { transition: background-color 0.15s, color 0.15s; }
.nav-link.active { background-color: #EEF1FD; color: var(--brand-blue); font-weight: 600; }

/* ---------- Language switch (link to the sibling-language file) ---------- */
/* No longer a runtime toggle — each page is single-language now, this is a
   plain link to that page's Arabic/English counterpart file. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-blue-dark);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #DCE3FA;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.lang-switch:hover {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(58, 91, 219, 0.5);
}

/* ---------- Callouts / alert boxes ---------- */
.callout {
  border-left-width: 4px;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.callout .callout-icon { flex-shrink: 0; width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; }
.callout-info { background: #EFF6FF; border-color: #3B82F6; color: #1E3A8A; }
.callout-warning { background: #FFFBEB; border-color: #F59E0B; color: #78350F; }
.callout-tip { background: #ECFDF5; border-color: #10B981; color: #064E3B; }
.callout-danger { background: #FEF2F2; border-color: #EF4444; color: #7F1D1D; }

/* ---------- Anchor / deep-link icon ---------- */
.heading-group { display: flex; align-items: center; gap: 0.5rem; scroll-margin-top: 90px; }
.anchor-link {
  opacity: 0;
  color: var(--brand-blue);
  text-decoration: none;
  font-size: 0.85em;
  transition: opacity 0.15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.heading-group:hover .anchor-link,
.anchor-link:focus-visible { opacity: 1; }
.anchor-link svg { width: 0.85em; height: 0.85em; }

.copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brand-slate);
  color: white;
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Cards ---------- */
.role-card { transition: transform 0.2s, box-shadow 0.2s; }
.role-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -12px rgba(58,91,219,0.25); }

/* ---------- Checklist styling ---------- */
.checklist { list-style: none; padding-left: 0; }
.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.6rem;
  line-height: 1.6;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0.65rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--brand-blue);
}

/* ---------- Documentation screenshots ---------- */
.doc-screenshot {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.15);
}

/* ---------- Table wrapper for mobile scroll ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0.75rem; border: 1px solid #e5e7eb; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-wrap th { background: #F8FAFC; font-weight: 700; text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
html[dir="rtl"] .table-wrap th { text-align: right; }
.table-wrap td { padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: #FAFBFF; }

/* ---------- Back to main website ---------- */
.back-to-site-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-blue-dark);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #DCE3FA;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.back-to-site-btn:hover {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(58, 91, 219, 0.5);
}
.back-to-site-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
@media (min-width: 640px) { .back-to-site-btn { padding: 0.5rem 1rem; } }

/* ---------- Page search ---------- */
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #94A3B8;
  pointer-events: none;
}
html[dir="rtl"] .search-wrap svg { left: auto; right: 0.75rem; }
.search-input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.25rem;
  border-radius: 0.75rem;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  font-size: 0.85rem;
  color: #1e293b;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
html[dir="rtl"] .search-input { padding: 0.6rem 2.25rem 0.6rem 0.85rem; }
.search-input:focus {
  outline: none;
  border-color: var(--brand-blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(58, 91, 219, 0.15);
}
.search-input::placeholder { color: #94A3B8; }
.search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: #94A3B8;
  cursor: pointer;
  display: none;
}
html[dir="rtl"] .search-clear { right: auto; left: 0.6rem; }
.search-wrap.has-value .search-clear { display: block; }
.search-wrap.has-value .search-clear:hover { color: #475569; }

mark.search-highlight {
  background: #FDE68A;
  color: #1e293b;
  border-radius: 0.2rem;
  padding: 0 0.1em;
}

.search-empty-msg {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
  color: #64748B;
  border: 1px dashed #CBD5E1;
  border-radius: 1rem;
  background: #F8FAFC;
}
.search-empty-msg.show { display: block; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.badge-blue { background: #EEF1FD; color: var(--brand-blue-dark); }
.badge-slate { background: #F1F5F9; color: #475569; }
.badge-amber { background: #FEF3C7; color: #92400E; }

/* ---------- Misc ---------- */
/* Deliberately no `color` here. `.prose-content p`/`li` (two classes,
   specificity 0,2,0) previously hardcoded a gray that beat every single-class
   Tailwind color utility (0,1,0) applied directly on those same tags — so
   text-white on a colored callout/banner, and text-slate-500 captions
   throughout the site, were silently overridden back to the same gray. Body
   already sets a sensible default via Tailwind's text-slate-800; anything
   that needs a different color carries its own utility class and must be
   allowed to win. */
.prose-content p, .prose-content li { line-height: 1.75; }
code.inline-code { background: #F1F5F9; color: var(--brand-blue-dark); padding: 0.15rem 0.4rem; border-radius: 0.3rem; font-size: 0.88em; font-family: ui-monospace, monospace; }

/* ---------- Block code sample (SVG markup, etc.) ---------- */
.code-block {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: 0.85rem;
  padding: 1.1rem 1.4rem;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.code-block .tag { color: #7DD3FC; }
.code-block .attr { color: #FCD34D; }
.code-block .val { color: #A7F3D0; }
.code-block .comment { color: #64748B; font-style: italic; }

/* ==================================================================
   Infographic components — vertical pipeline timeline, exit-branch
   grid, and feature cards (Leads Management & RevOps page)
   ================================================================== */

/* ---------- Vertical pipeline timeline ---------- */
.v-timeline { position: relative; padding-left: 4.25rem; }
.v-timeline::before {
  content: '';
  position: absolute;
  left: 1.75rem;
  top: 0.75rem;
  bottom: 2.75rem;
  width: 3px;
  background: linear-gradient(to bottom, #93C5FD, #A78BFA, #FCD34D, #6EE7B7);
  border-radius: 999px;
}
html[dir="rtl"] .v-timeline { padding-left: 0; padding-right: 4.25rem; }
html[dir="rtl"] .v-timeline::before { left: auto; right: 1.75rem; }

.v-timeline-item { position: relative; padding-bottom: 1.75rem; }
.v-timeline-item:last-child { padding-bottom: 0; }

.v-timeline-marker {
  position: absolute;
  left: -4.25rem;
  top: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #F8FAFC;
  box-shadow: 0 0 0 3px currentColor;
  transition: transform 0.2s ease;
  z-index: 1;
}
html[dir="rtl"] .v-timeline-marker { left: auto; right: -4.25rem; }
.v-timeline-item:hover .v-timeline-marker { transform: scale(1.1); }
.v-timeline-marker svg { width: 1.6rem; height: 1.6rem; }

.v-timeline-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.1rem 1.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.v-timeline-item:hover .v-timeline-card {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -10px rgba(15, 23, 42, 0.14);
}

.v-timeline-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  margin-inline-end: 0.5rem;
}

/* Stage color variants — applied on .v-timeline-item, inherited by marker/step-num */
.stage-neutral { color: var(--brand-blue); }
.stage-neutral .v-timeline-marker { background: #EEF1FD; }
.stage-neutral .v-timeline-step-num { background: #EEF1FD; color: var(--brand-blue-dark); }

.stage-active { color: #7C3AED; }
.stage-active .v-timeline-marker { background: #EDE9FE; }
.stage-active .v-timeline-step-num { background: #EDE9FE; color: #6D28D9; }

.stage-warn { color: #D97706; }
.stage-warn .v-timeline-marker { background: #FEF3C7; }
.stage-warn .v-timeline-step-num { background: #FEF3C7; color: #B45309; }

.stage-success { color: #059669; }
.stage-success .v-timeline-marker { background: #D1FAE5; }
.stage-success .v-timeline-step-num { background: #D1FAE5; color: #047857; }

.stage-danger { color: #DC2626; }
.stage-danger .v-timeline-marker { background: #FEE2E2; }
.stage-danger .v-timeline-step-num { background: #FEE2E2; color: #B91C1C; }

.stage-hold { color: #EA580C; }
.stage-hold .v-timeline-marker { background: #FFEDD5; }
.stage-hold .v-timeline-step-num { background: #FFEDD5; color: #C2410C; }

.stage-muted { color: #64748B; }
.stage-muted .v-timeline-marker { background: #F1F5F9; }
.stage-muted .v-timeline-step-num { background: #F1F5F9; color: #475569; }

/* ---------- Exit-branch section divider ---------- */
.branch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 1.25rem;
}
.branch-label::before, .branch-label::after { content: ''; flex: 1 1 auto; height: 1px; background: #E2E8F0; }

.branch-card {
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  border-width: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.branch-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -10px rgba(15, 23, 42, 0.12); }
.branch-card .branch-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem;
}

/* ---------- Dashboard-mockup components (Command Center page) ---------- */
.metric-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -10px rgba(15, 23, 42, 0.12); }
.metric-card .metric-value { font-size: 1.9rem; font-weight: 800; color: #0f172a; line-height: 1.15; }
.metric-card .metric-label { font-size: 0.78rem; color: #64748B; font-weight: 600; margin-top: 0.2rem; }

.pillar-bar-row { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.pillar-bar-row:last-child { margin-bottom: 0; }
.pillar-bar-label { width: 9.5rem; flex-shrink: 0; font-size: 0.85rem; font-weight: 700; color: #334155; }
html[dir="rtl"] .pillar-bar-label { text-align: right; }
.pillar-bar-track { flex: 1 1 auto; height: 0.75rem; background: #F1F5F9; border-radius: 999px; overflow: hidden; }
.pillar-bar-fill { height: 100%; border-radius: 999px; }
.pillar-bar-weight { width: 3.5rem; flex-shrink: 0; text-align: right; font-size: 0.8rem; font-weight: 700; color: #94A3B8; }
html[dir="rtl"] .pillar-bar-weight { text-align: left; }

.gap-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid #e5e7eb;
  background: white;
}
.gap-row .gap-icon { flex-shrink: 0; width: 2.25rem; height: 2.25rem; border-radius: 0.65rem; display: flex; align-items: center; justify-content: center; }
.gap-row .gap-icon svg { width: 1.2rem; height: 1.2rem; }

/* ---------- Feature cards ---------- */
.feature-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  padding: 1.75rem;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 44px -14px rgba(58, 91, 219, 0.2);
  border-color: var(--brand-blue);
}
.feature-card-icon {
  width: 3.25rem; height: 3.25rem;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
  transition: transform 0.25s ease;
}
.feature-card:hover .feature-card-icon { transform: scale(1.08) rotate(-3deg); }
