/* ============================================================
   Qadamchi docs.css (3.2.0) — docs'gina komponentlar
   app.css'dan keyin yuklanadi. Dark mode token override'lari
   app.css'da; bu faylda docs komponentlarining dark variantlari bor.
   ============================================================ */

/* Smooth scroll + heading'lar sticky topbar tagida yashirinmaslik */
html { scroll-behavior: smooth; }
.prose h2, .prose h3 { scroll-margin-top: 80px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1.5px solid var(--border);
    background: var(--primary-light); color: var(--primary);
    border-radius: var(--r-sm); cursor: pointer; transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--primary-hover-bg); border-color: var(--primary-border); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: inline-block; }

/* ---------- Reading progress bar ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 60; pointer-events: none; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); transition: width .08s linear; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb .sep { opacity: .45; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ---------- Docs hero + search ---------- */
.docs-hero { text-align: center; margin-bottom: 6px; }
.docs-hero h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.docs-hero p { color: var(--muted); margin-bottom: 18px; }
.docs-search-wrap { max-width: 460px; margin: 0 auto 8px; position: relative; }
.docs-search { width: 100%; padding: 11px 16px 11px 42px; border-radius: 24px; }
.docs-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--muted); pointer-events: none; }

/* ---------- Category sections ---------- */
.docs-cat { margin: 28px 0 14px; }
.docs-cat-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.docs-cat-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.docs-cat.is-hidden { display: none; }

/* ---------- Doc card (title + desc + badge) ---------- */
.docs-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px; }
.docs-card-top { display: flex; align-items: center; gap: 10px; width: 100%; }
.docs-card-icon { width: 22px; height: 22px; fill: var(--primary); flex-shrink: 0; }
.docs-card-title { color: var(--primary); font-weight: 700; font-size: 15px; }
.docs-card-desc { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.docs-card-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-dark); background: var(--primary-light); padding: 3px 9px; border-radius: 20px; }
.docs-card.is-hidden { display: none; }
.docs-card.no-results { display: none; }
.docs-no-results { text-align: center; color: var(--muted); padding: 30px; display: none; }
.docs-no-results.show { display: block; }

/* ---------- Show layout: 3 ustun (list | prose | toc) ---------- */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 210px; gap: clamp(20px, 3vw, 40px); align-items: start; }
.docs-article-head { margin-bottom: 22px; }
.docs-article-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.docs-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.docs-ver { font-size: 12px; font-weight: 700; color: var(--primary-dark); background: var(--primary-light); padding: 3px 10px; border-radius: 20px; }
.docs-meta .muted { font-size: 13px; }

/* ---------- On-this-page TOC ---------- */
.docs-toc { position: sticky; top: 84px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm); max-height: calc(100vh - 110px); overflow: auto; }
.docs-toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #adb5bd; margin: 0 0 10px; font-weight: 700; }
.docs-toc ul { list-style: none; padding: 0; margin: 0; }
.docs-toc li { margin: 0; }
.docs-toc a { display: block; padding: 5px 10px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; border-radius: 0 var(--r-sm) var(--r-sm) 0; line-height: 1.4; transition: background .15s, color .15s; }
.docs-toc a:hover { color: var(--primary); text-decoration: none; background: var(--primary-light); }
.docs-toc a.active { color: var(--primary-dark); border-left-color: var(--primary); font-weight: 600; background: var(--primary-light); }
.docs-toc .toc-h3 a { padding-left: 24px; font-size: 12.5px; }
.docs-toc-empty { color: var(--muted); font-size: 13px; }

/* ---------- Heading anchor ---------- */
.prose h2, .prose h3 { position: relative; padding-right: 1.4em; }
.anchor { position: absolute; right: 0; top: .1em; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .15s; font-weight: 600; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: .55; }
.anchor:hover { opacity: 1; color: var(--primary); text-decoration: none; }

/* ---------- Code block + syntax highlight ---------- */
.code { margin: 16px 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: #f4f5fb; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: #e9ebf5; border-bottom: 1px solid var(--border); }
.code-lang { font: 600 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.code-copy { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; cursor: pointer; color: var(--muted); font: 600 12px var(--font); padding: 4px 8px; border-radius: 6px; transition: background .15s, color .15s; }
.code-copy:hover { background: var(--primary-light); color: var(--primary); }
.code-copy svg { width: 14px; height: 14px; fill: currentColor; }
.code-copy.copied { color: var(--success); }
.code pre { margin: 0; border: none; border-radius: 0; background: transparent; padding: 14px 16px; }
.code pre code { background: none; color: var(--text); padding: 0; font-size: 13.5px; border-radius: 0; line-height: 1.65; }
/* syntax tokenlar */
.t-kw { color: #9333ea; font-weight: 600; }
.t-str { color: #15803d; }
.t-com { color: #94a3b8; font-style: italic; }
.t-var { color: #2563eb; }
.t-num { color: #c2410c; }
.t-fn  { color: #0d9488; }
.t-key { color: #be185d; }

/* ---------- Callouts ---------- */
.callout { border-left: 4px solid var(--primary); padding: 12px 16px; border-radius: 0 var(--r-md) var(--r-md) 0; margin: 16px 0; background: rgba(59, 91, 219, .08); }
.callout p { margin: 0; }
.callout-label { font-weight: 700; color: var(--primary-dark); }
.callout-note { border-left-color: var(--primary); background: rgba(59, 91, 219, .08); }
.callout-tip { border-left-color: var(--success); background: rgba(43, 138, 62, .10); }
.callout-tip .callout-label { color: var(--success); }
.callout-warn { border-left-color: var(--warn); background: rgba(240, 140, 0, .10); }
.callout-warn .callout-label { color: var(--warn); }
.callout-danger { border-left-color: var(--danger); background: rgba(224, 49, 49, .10); }
.callout-danger .callout-label { color: var(--danger); }

/* ---------- Prev / next ---------- */
.prev-next { display: flex; justify-content: space-between; gap: 14px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); }
.prev-next a { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; color: var(--text); transition: border-color .15s, background .15s; }
.prev-next a:hover { border-color: var(--primary-border); background: var(--primary-light); text-decoration: none; }
.prev-next a.next { text-align: right; align-items: flex-end; }
.prev-next .pn-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.prev-next .pn-title { font-weight: 600; color: var(--primary); font-size: 14px; }
.prev-next .pn-disabled { visibility: hidden; pointer-events: none; }

/* ============================================================
   Responsive — docs layout
   ============================================================ */
@media (max-width: 1100px) {
    .docs-layout { grid-template-columns: 210px minmax(0, 1fr); }
    .docs-toc { display: none; }
}
@media (max-width: 768px) {
    .docs-layout { grid-template-columns: 1fr; gap: 18px; }
    .docs-article-head h1 { font-size: 24px; }
    .prev-next { flex-direction: column; }
    .prev-next a.next { text-align: left; align-items: flex-start; }
}

/* ============================================================
   Dark mode — docs komponentlari
   ============================================================ */
html[data-theme="dark"] .code { background: #14171f; border-color: var(--border); }
html[data-theme="dark"] .code-bar { background: #1b1f2c; border-bottom-color: var(--border); }
html[data-theme="dark"] .code pre code { color: var(--text); }
html[data-theme="dark"] .t-kw { color: #c084fc; }
html[data-theme="dark"] .t-str { color: #4ade80; }
html[data-theme="dark"] .t-com { color: #64748b; }
html[data-theme="dark"] .t-var { color: #7dd3fc; }
html[data-theme="dark"] .t-num { color: #fbbf24; }
html[data-theme="dark"] .t-fn { color: #2dd4bf; }
html[data-theme="dark"] .t-key { color: #f472b6; }
html[data-theme="dark"] .docs-toc,
html[data-theme="dark"] .prev-next a { background: #1b1f2c; border-color: var(--border); }
html[data-theme="dark"] .docs-search { background: #14171f; border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .anchor { color: var(--muted); }