/* =============================================
   RABTWA DOCS — Arabic RTL Documentation Site
   ============================================= */

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

:root {
  --primary: #25D366;
  --primary-dark: #128C7E;
  --primary-light: #dcfce7;
  --accent: #075E54;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --bg-sidebar: #0f172a;
  --border: #e5e7eb;
  --border-light: #f1f5f9;
  --sidebar-width: 280px;
  --topbar-height: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  min-height: 100vh;
}

/* =============================================
   LAYOUT
   ============================================= */

.layout {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-right var(--transition);
}

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.05);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.sidebar-close:hover { color: white; }

.sidebar-search {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-search svg {
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.sidebar-search input {
  flex: 1;
  background: none;
  border: none;
  color: white;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  direction: rtl;
  min-width: 0;
}

.sidebar-search input::placeholder {
  color: rgba(255,255,255,0.3);
}

.sidebar-nav {
  padding: 12px 0 24px;
  flex: 1;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-title {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 12px 20px 6px;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link:hover {
  color: white;
  background: rgba(255,255,255,0.06);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(37, 211, 102, 0.1);
  font-weight: 600;
}

.nav-link.active svg {
  opacity: 1;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 2px 0 0 2px;
}

/* =============================================
   TOPBAR
   ============================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.menu-toggle:hover {
  background: var(--border-light);
  color: var(--text);
}

.topbar-logo-link {
  display: flex;
  align-items: center;
}

.topbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  padding-right: 12px;
  margin-right: 4px;
}

.btn-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.btn-platform:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* =============================================
   MAIN CONTENT
   ============================================= */

.main-content {
  flex: 1;
  padding: 0;
}

.doc-section {
  display: none;
  padding: 32px 40px 48px;
  max-width: 860px;
  animation: fadeIn 0.25s ease;
}

.doc-section.active-section {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   SECTION HERO (Intro)
   ============================================= */

.section-hero {
  margin-bottom: 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.section-hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 14px;
}

.section-hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
}

/* =============================================
   PAGE HEADER
   ============================================= */

.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.breadcrumb span:first-child {
  cursor: pointer;
  color: var(--primary-dark);
}
.breadcrumb span:first-child:hover { text-decoration: underline; }

.breadcrumb .current {
  color: var(--text-muted);
  cursor: default;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.page-desc {
  font-size: 15px;
  color: var(--text-muted);
}

/* =============================================
   CONTENT BLOCKS
   ============================================= */

.content-block {
  margin-bottom: 32px;
}

.content-block h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-block h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.content-block p {
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* =============================================
   CODE BLOCKS
   ============================================= */

.code-block {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 12px 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
}

.code-block.small {
  padding: 10px 14px;
  margin: 8px 0;
}

.code-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(37, 211, 102, 0.7);
  white-space: nowrap;
  flex-shrink: 0;
}

.code-block code {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
  color: #e2e8f0;
  direction: ltr;
  text-align: left;
}

.code-block.small code {
  font-size: 12px;
}

/* =============================================
   STEPS LIST
   ============================================= */

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.steps-list::before {
  content: '';
  position: absolute;
  right: 19px;
  top: 36px;
  bottom: 36px;
  width: 2px;
  background: var(--border);
}

.steps-list.compact::before {
  right: 19px;
}

.step-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  position: relative;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--bg);
}

.step-content {
  flex: 1;
  padding-top: 8px;
}

.step-content strong {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 14.5px;
}

.step-content p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* =============================================
   FEATURE CARDS (Intro Grid)
   ============================================= */

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.feature-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon.green { background: #dcfce7; color: #16a34a; }
.card-icon.blue { background: #dbeafe; color: #2563eb; }
.card-icon.purple { background: #ede9fe; color: #7c3aed; }
.card-icon.orange { background: #ffedd5; color: #ea580c; }

.card-body { flex: 1; min-width: 0; }

.card-body h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-body p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-arrow {
  color: var(--text-light);
  flex-shrink: 0;
}

/* =============================================
   INFO / WARNING BOXES
   ============================================= */

.info-box {
  display: flex;
  gap: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #1e40af;
}

.info-box a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}
.info-box a:hover { text-decoration: underline; }

.info-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-box {
  display: flex;
  gap: 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #92400e;
}

.warning-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #d97706;
}

/* =============================================
   METHODS GRID
   ============================================= */

.methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}

.method-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.method-icon {
  font-size: 22px;
  line-height: 1;
}

.method-card strong {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.method-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* =============================================
   PATH GUIDE
   ============================================= */

.path-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-wrap: wrap;
}

.path-guide svg {
  color: var(--text-light);
  flex-shrink: 0;
}

/* =============================================
   FEATURES TABLE
   ============================================= */

.features-table {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0;
}

.feature-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.feature-row:last-child { border-bottom: none; }
.feature-row:hover { background: var(--bg); }

.feature-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  min-width: 160px;
  flex-shrink: 0;
}

.feature-desc {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* =============================================
   CONFIG TABLE
   ============================================= */

.config-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0;
}

.config-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
  align-items: center;
  transition: background var(--transition);
}

.config-row:last-child { border-bottom: none; }
.config-row:hover:not(.header) { background: var(--bg); }

.config-row.header {
  background: var(--bg);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-row code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary-dark);
}

/* =============================================
   FEATURE HIGHLIGHTS
   ============================================= */

.feature-highlight {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: all var(--transition);
}

.feature-highlight:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.highlight-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.highlight-icon.blue { background: #dbeafe; color: #2563eb; }
.highlight-icon.green { background: #dcfce7; color: #16a34a; }
.highlight-icon.orange { background: #ffedd5; color: #ea580c; }

.feature-highlight h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.feature-highlight p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}

/* =============================================
   OPTION BLOCKS (Bulk Sent)
   ============================================= */

.option-block {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
}

.option-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.option-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.option-badge.alt {
  background: #7c3aed;
}

.option-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

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

.method-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-muted);
}

.method-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* =============================================
   NAV BUTTONS
   ============================================= */

.nav-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.btn-prev, .btn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-prev {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-prev:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-light);
}

.btn-next {
  background: var(--primary);
  color: white;
  margin-right: auto;
}
.btn-next:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  flex-shrink: 0;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.footer-content a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}
.footer-content a:hover { text-decoration: underline; }

/* =============================================
   SIDEBAR OVERLAY
   ============================================= */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .layout {
    margin-right: 0;
  }

  .sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .sidebar-close {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-title {
    display: none;
  }

  .doc-section {
    padding: 24px 20px 40px;
  }

  .section-hero h1 {
    font-size: 24px;
  }

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

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

  .config-row {
    grid-template-columns: 1fr 1fr;
  }

  .config-row > *:last-child {
    grid-column: span 2;
  }

  .features-table .feature-name {
    min-width: 120px;
  }

  .btn-platform span { display: none; }
}

@media (max-width: 480px) {
  .doc-section {
    padding: 20px 16px 36px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .nav-buttons {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .btn-next, .btn-prev {
    justify-content: center;
    width: 100%;
  }

  .btn-next {
    margin-right: 0;
  }

  .steps-list::before {
    display: none;
  }

  .step-item {
    flex-direction: column;
    gap: 8px;
  }

  .step-num {
    align-self: flex-start;
  }

  .config-row {
    grid-template-columns: 1fr;
  }

  .config-row > *:last-child {
    grid-column: auto;
  }
}

/* =============================================
   SCREENSHOTS
   ============================================= */

.screenshot-wrap {
  margin: 20px 0 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: #f1f5f9;
  position: relative;
}

.screenshot-wrap::before {
  content: '';
  display: block;
  height: 32px;
  background: #e2e8f0;
  border-bottom: 1px solid var(--border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32'%3E%3Ccircle cx='16' cy='16' r='5' fill='%23fc605c'/%3E%3Ccircle cx='30' cy='16' r='5' fill='%23fdbc40'/%3E%3Ccircle cx='44' cy='16' r='5' fill='%2334c749'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  flex-shrink: 0;
}

.screenshot-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  object-position: top center;
}

.screenshot-caption {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  padding: 8px;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
}

/* =============================================
   SEARCH FILTER
   ============================================= */

.nav-link.hidden {
  display: none;
}
