  /* Variables */
  :root {
    --bg-main: #0a0a0c;
    --bg-sidebar: #0f0f12;
    --text-main: #e2e8f0;
    --text-muted: #71717a;
    --accent-blue: #2f79e8;
    --accent-glow: rgba(47, 121, 232, 0.25);
    --border: #1f1f23;
    --code-bg: #1a1a1f;
    --code-border: #2a2a32;
}

  @font-face {
    font-family: 'TargetTone';
    src: url('../fonts/TarrgetHalfToneRegular-gzRY.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
  }

  @font-face {
    font-family: 'TargetRegular';
    src: url('../fonts/TarrgetRegular-WEOz.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
  }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background-color: var(--bg-main); color: var(--text-main); display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* Navbar */
.top-navbar { height: 65px; background-color: var(--bg-sidebar); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 32px; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.brand-logo { 
    color: #3284ff;
text-shadow: 0 0 15px #3284ff9e, 0 0 10px #3284ff9e;
    font-size: 16px; font-weight: 100; display: flex; align-items: center; gap: 12px; letter-spacing: 2px; font-family: "TargetRegular", sans-serif;}
.logo-img { height: 33px; width: auto; object-fit: contain; }

.nav-socials { display: flex; align-items: center; gap: 16px; }
.social-link { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; background: #141417; border: 1px solid var(--border); color: var(--text-main); text-decoration: none; transition: all 0.3s ease; }
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link:hover { color: var(--accent-blue); border-color: var(--accent-blue); background: rgba(47, 121, 232, 0.05); transform: translateY(-2px); }

/* Layout */
.main-layout { display: flex; flex: 1; max-width: 1500px; margin: 0 auto; width: 100%; }

/* Left Sidebar */
.sidebar { width: 260px; flex-shrink: 0; background-color: var(--bg-main); border-right: 1px solid var(--border); height: calc(100vh - 65px); position: sticky; top: 65px; overflow-y: auto; }
.sidebar-content { position: relative; padding: 32px 0; width: 100%; }
.nav-group { margin-bottom: 24px; }
.nav-title { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.1em; padding: 0 28px; margin-bottom: 12px; font-weight: 600; display: flex; flex-direction: row; align-items: center; gap: 10px; }
.nav-list { list-style: none; }

.nav-title img {
  width: 18px;
}

.active-slider { position: absolute; top: 0; left: 0; width: 100%; background: linear-gradient(90deg, rgba(47, 121, 232, 0.1) 0%, rgba(47, 121, 232, 0) 100%); border-left: 3px solid var(--accent-blue); pointer-events: none; z-index: 0; opacity: 0; }

.nav-item { padding: 10px 28px; cursor: pointer; color: #a1a1aa; font-size: 14px; transition: color 0.25s ease, padding-left 0.25s ease; display: flex; align-items: center; position: relative; z-index: 1; margin: 4px 0; }
.nav-item:hover { color: white; padding-left: 32px; }

/* 🔥 BUG FIX: active item ro lock kardam ke padding-left hefz beshe va تکون nakhore */
.nav-item.active { color: var(--accent-blue); font-weight: 500; padding-left: 32px; }

/* Center Content */
.content-wrapper { flex: 1; max-width: 880px; width: 100%; padding: 48px 56px; overflow: hidden; }

.markdown-body { line-height: 1.7; color: #c8c8d0; opacity: 0; overflow-wrap: break-word; word-wrap: break-word; }
.markdown-body h1 { font-size: 32px; margin-bottom: 32px; font-weight: 700; color: white; letter-spacing: -0.5px; }
.markdown-body h2 { font-size: 22px; margin-top: 56px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border); color: white; }
.markdown-body h3 { font-size: 18px; margin-top: 32px; margin-bottom: 16px; color: white; }
.markdown-body p { margin-bottom: 20px; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin-bottom: 24px; }
.markdown-body li { margin-bottom: 8px; color: #a1a1aa; }
.markdown-body p code, .markdown-body li code { font-family: 'Fira Code', monospace; font-size: 13px; background: #17171a; color: #60a5fa; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); word-break: break-all; }

.markdown-body img { max-width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--border); margin: 24px 0; }

/* Right Sidebar (TOC) */
.toc-sidebar { width: 260px; flex-shrink: 0; padding: 48px 24px; height: calc(100vh - 65px); position: sticky; top: 65px; overflow-y: auto; }
.toc-header { font-size: 15px; font-weight: 700; color: white; margin-bottom: 20px; }
.toc-list-container { list-style: none; }

.toc-link { display: block; font-size: 14px; color: #71717a; cursor: pointer; margin-bottom: 12px; transition: all 0.2s ease; line-height: 1.5; word-break: break-word; }
.toc-link:hover { color: white; }
.toc-link.active-toc { color: var(--accent-blue); font-weight: 500; }

.toc-level-2 { margin-top: 16px; font-weight: 500; }
.toc-level-3 { padding-left: 16px; font-size: 13.5px; }

/* Code Blocks */
.code-block-wrapper { position: relative; margin-bottom: 24px; margin-top: 16px; max-width: 100%; width: 100%; }
.code-block-wrapper pre { background: var(--code-bg); padding: 24px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--code-border); margin: 0; width: 100%; }
.code-block-wrapper code { font-family: 'Fira Code', monospace; font-size: 14px; line-height: 1.6; background: transparent !important; white-space: pre; }

.copy-btn { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--code-border); color: var(--text-muted); padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s ease; backdrop-filter: blur(4px); }
.copy-btn svg { width: 14px; height: 14px; fill: currentColor; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; border-color: #3f3f46; }
.copy-btn.copied { background: rgba(67, 214, 117, 0.15); color: #43d675; border-color: rgba(67, 214, 117, 0.3); }

.mobile-toggle { display: none; color: white; background: none; border: none; font-size: 24px; cursor: pointer; }

/* Responsive Media Queries */
@media (max-width: 1100px) {
    .toc-sidebar { display: none; }
    .content-wrapper { padding: 48px 32px; }
}
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .sidebar { position: fixed; left: -280px; background-color: var(--bg-sidebar); transition: left 0.3s ease; z-index: 40; }
    .sidebar.show { left: 0; box-shadow: 10px 0 30px rgba(0,0,0,0.6); }
    .content-wrapper { padding: 24px 16px; width: 100vw; }
    .markdown-body h1 { font-size: 26px; }
    .markdown-body h2 { font-size: 20px; }
    .code-block-wrapper pre { padding: 48px 16px 16px 16px; }
    .copy-btn { top: 8px; right: 8px; }
}