:root {
  --sidebar-width: 280px;
  --primary-color: #0d6efd;
  --bs-green: #88ce02;
  --sidebar-bg: #2c343b;
  --code-bg: #1e1e1e;
}

/* ===== Base ===== */
body {
  background-color: #eef2f5;
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif !important;
  direction: rtl;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 1000;
  box-shadow: -3px 0 15px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-header .brand-icon {
  width: 38px; height: 38px;
  background: var(--bs-green);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #1a1a1a; flex-shrink: 0;
}
.sidebar-header .brand-text { font-size: 16px; font-weight: 700; color: #fff; }
.sidebar-header .brand-text span { display: block; font-size: 11px; font-weight: 400; color: rgba(224,224,224,.6); margin-top: 2px; }

.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(224,224,224,.4);
  padding: 10px 20px 5px;
}

.sidebar .category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(224,224,224,.8);
  text-decoration: none;
  font-size: 13px;
  transition: all .2s;
  border-right: 3px solid transparent;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.sidebar .category-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  border-right-color: var(--bs-green);
  text-decoration: none;
}
.sidebar .category-item.active {
  background: rgba(13,110,253,.15);
  color: #fff;
  border-right-color: var(--primary-color);
  font-weight: 600;
}
.nav-num {
  width: 22px; height: 22px;
  background: rgba(13,110,253,.2);
  border-radius: 5px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #6ea8fe; flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.btn-back-sb {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 7px;
  text-decoration: none; font-size: 13px;
  margin-bottom: 8px; transition: all .2s;
  background: rgba(255,255,255,.08); color: #e0e0e0;
}
.btn-back-sb:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.btn-dl-sb {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 7px;
  text-decoration: none; font-size: 13px;
  font-weight: 700; background: var(--bs-green); color: #1a1a1a;
  transition: all .2s; margin-bottom: 5px;
}
.btn-dl-sb:hover { background: #9de003; text-decoration: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-right: var(--sidebar-width);
  padding: 36px 48px 60px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 36px;
}
.page-header h1 {
  font-size: 28px; font-weight: 800; color: #1a1a1a; margin-bottom: 8px;
}
.page-header h1 .hl { color: var(--primary-color); }
.page-header p { color: #666; font-size: 14.5px; }

section {
  margin-bottom: 40px;
  scroll-margin-top: 24px;
}

h2.section-title {
  font-size: 21px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}
h2.section-title .s-icon {
  width: 36px; height: 36px;
  background: rgba(13,110,253,.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

/* ===== DEMO BOX ===== */
.demo-box {
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e8e8;
}
.demo-box h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 20px 0 10px;
  padding-right: 12px;
  border-right: 3px solid var(--primary-color);
}
.demo-preview {
  padding: 24px;
  border-bottom: 1px solid #eee;
}
.demo-code {
  position: relative;
  background: var(--code-bg);
  direction: ltr;
  text-align: left;
}
.demo-code pre {
  margin: 0;
  padding: 20px;
  color: #abb2bf;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13.5px;
  overflow-x: auto;
  line-height: 1.7;
}
.demo-code code .tag  { color: #e06c75; }
.demo-code code .attr { color: #d19a66; }
.demo-code code .val  { color: #98c379; }
.demo-code code .cm   { color: #5c6370; }

/* ===== COPY BUTTON ===== */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 4px 10px;
  background: #495057;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: .2s;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.copy-btn:hover { background: #6c757d; }
.copy-btn.copied { background: #198754; }

/* ===== INFO BOXES ===== */
.info-bs {
  background: rgba(13,110,253,.07);
  border-right: 4px solid #0d6efd;
  border-radius: 0 8px 8px 0;
  padding: 13px 16px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: #0a2a6b;
}
.tip-bs {
  background: rgba(136,206,2,.1);
  border-right: 4px solid #88ce02;
  border-radius: 0 8px 8px 0;
  padding: 13px 16px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: #2a4a00;
}
.warn-bs {
  background: rgba(255,165,0,.1);
  border-right: 4px solid #ff9500;
  border-radius: 0 8px 8px 0;
  padding: 13px 16px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: #5a3a00;
}

/* ===== GRID DEMO ===== */
.grid-demo .col-demo {
  background: rgba(13,110,253,.1);
  border: 1px solid rgba(13,110,253,.25);
  border-radius: 6px;
  padding: 12px 8px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #0d3b8e;
  margin-bottom: 10px;
}
.grid-demo .col-demo.dark {
  background: rgba(13,110,253,.22);
}

/* ===== UTILITY DEMO ===== */
.util-box {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 16px;
  margin: 10px 0;
  border: 1px solid #e8e8e8;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--sidebar-bg);
  color: #e0e0e0;
  padding: 28px 40px;
  border-radius: 10px;
  margin-top: 8px;
  text-align: center;
}
.site-footer .divider { width: 60px; height: 3px; background: var(--bs-green); margin: 12px auto; border-radius: 3px; }
.site-footer p { font-size: 14px; color: rgba(224,224,224,.7); margin: 0 0 6px; }
.site-footer a { color: var(--bs-green); text-decoration: none; font-weight: 600; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .sidebar { position: relative; width: 100%; height: auto; box-shadow: none; }
  .main-content { margin-right: 0; padding: 20px; }
}
