/* =====================
   RESET & BASE
===================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --indigo-50:  #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-400: #818cf8;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;

  --bg:          #ffffff;
  --bg-alt:      #f8f8fc;
  --bg-card:     #ffffff;
  --bg-code:     #0f172a;
  --border:      rgba(0,0,0,0.08);
  --border-md:   rgba(0,0,0,0.13);
  --text-1:      #111827;
  --text-2:      #6b7280;
  --text-3:      #9ca3af;
  --radius-md:   8px;
  --radius-lg:   14px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04);
  --navbar-h:    60px;

  --get-bg:    #dcfce7; --get-color:  #15803d;
  --post-bg:   #dbeafe; --post-color: #1d4ed8;
  --put-bg:    #fef9c3; --put-color:  #854d0e;
  --patch-bg:  #fce7f3; --patch-color:#9d174d;
  --delete-bg: #fee2e2; --delete-color:#b91c1c;
}

[data-theme="dark"] {
  --bg:          #0f172a;
  --bg-alt:      #1e293b;
  --bg-card:     #1e293b;
  --bg-code:     #0a0f1e;
  --border:      rgba(255,255,255,0.07);
  --border-md:   rgba(255,255,255,0.12);
  --text-1:      #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4);
  --indigo-50:   #1e1b4b;
  --indigo-100:  #2e2763;
  --indigo-200:  #3730a3;
  --indigo-800:  #a5b4fc;

  --get-bg:    #052e16; --get-color:  #4ade80;
  --post-bg:   #172554; --post-color: #93c5fd;
  --put-bg:    #1c1400; --put-color:  #fde68a;
  --patch-bg:  #2d0a1e; --patch-color:#f9a8d4;
  --delete-bg: #1c0a0a; --delete-color:#fca5a5;
}

html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 16px;
  line-height: 1.6;
  transition: background .25s ease, color .25s ease;
  /* Single scroll context — nothing else scrolls */
  overflow-y: auto;
}

[dir="rtl"] { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
a { text-decoration: none; }

/* =====================
   NAVBAR
===================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
  border-bottom: .5px solid var(--border);
  transition: background .25s, border-color .25s;
}
[data-theme="light"] .navbar {
  background: rgba(255,255,255,0.95);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: var(--navbar-h); display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { display: flex; align-items: center; }
.logo-icon img { height: 42px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 6px 12px; border-radius: var(--radius-md);
  transition: all .18s;
}
.nav-link:hover { color: var(--indigo-600); background: var(--indigo-50); }
.nav-link.active { color: var(--indigo-600); background: var(--indigo-50); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: flex; background: var(--bg-alt);
  border: .5px solid var(--border-md); border-radius: 99px;
  padding: 3px; gap: 2px;
}
.lang-btn {
  background: transparent; border: none; border-radius: 99px;
  padding: 4px 12px; font-size: 12px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: all .18s;
}
.lang-btn.active { background: var(--indigo-600); color: #fff; }

.theme-toggle {
  background: var(--bg-alt); border: .5px solid var(--border-md);
  border-radius: 99px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .18s; color: var(--text-2); flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--indigo-400); color: var(--indigo-600); background: var(--indigo-50); }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* =====================
   HERO
===================== */
.hero { padding: 80px 24px 72px; text-align: center; border-bottom: .5px solid var(--border); }
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-badge {
  display: inline-block; background: var(--indigo-50); color: var(--indigo-800);
  border: .5px solid var(--indigo-200); border-radius: 99px;
  font-size: 12px; font-weight: 500; padding: 5px 16px; margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(28px,5vw,44px); font-weight: 700;
  line-height: 1.18; letter-spacing: -.03em; color: var(--text-1); margin-bottom: 18px;
}
.hero-accent { color: var(--indigo-600); }
.hero-sub { font-size: 17px; color: var(--text-2); line-height: 1.7; margin-bottom: 36px; max-width: 540px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* =====================
   BUTTONS
===================== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--indigo-600); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 11px 22px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: background .18s;
}
.btn-primary:hover { background: var(--indigo-700); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--indigo-600);
  border: 1px solid var(--indigo-400); border-radius: var(--radius-md);
  padding: 11px 22px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .18s;
}
.btn-outline:hover { background: var(--indigo-50); }
.btn-download {
  display: inline-flex; align-items: center; gap: 8px;
  width: fit-content;
  background: var(--indigo-600); color: #fff; border: none;
  border-radius: var(--radius-md); padding: 13px 28px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: background .18s;
}
.btn-download:hover { background: var(--indigo-700); }
.btn-download svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =====================
   SECTIONS (landing)
===================== */
.section { padding: 72px 24px; border-top: .5px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-label { font-size: 11px; font-weight: 600; color: var(--indigo-600); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.section-title { font-size: clamp(22px,3vw,30px); font-weight: 700; letter-spacing: -.025em; color: var(--text-1); margin-bottom: 10px; }
.section-sub { font-size: 15px; color: var(--text-2); line-height: 1.65; max-width: 520px; margin-bottom: 40px; }

.cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
@media(max-width:900px){ .cards-grid{ grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:540px){ .cards-grid{ grid-template-columns: 1fr; } }

.int-card {
  background: var(--bg-card); border: .5px solid var(--border-md);
  border-radius: var(--radius-lg); padding: 28px 24px;
  box-shadow: var(--shadow-card); transition: border-color .18s;
  display: flex; flex-direction: column; gap: 14px; cursor: pointer;
}
.int-card:hover { border-color: var(--indigo-400); }
.int-card-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.int-card-icon svg { width: 22px; height: 22px; stroke: var(--indigo-600); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.int-card h3 { font-size: 16px; font-weight: 600; color: var(--text-1); }
.int-card p { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.int-card-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--indigo-600); margin-top: auto; }
.int-card-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .18s; }
.int-card:hover .int-card-link svg { transform: translateX(3px); }
[dir="rtl"] .int-card:hover .int-card-link svg { transform: translateX(-3px); }

/* =====================
   PAGE HERO
===================== */
.page-hero { padding: 52px 24px 44px; border-bottom: .5px solid var(--border); }
.page-hero-inner { max-width: 860px; margin: 0 auto; }
.page-hero h1 { font-size: clamp(24px,4vw,36px); font-weight: 700; letter-spacing: -.03em; color: var(--text-1); margin-bottom: 12px; line-height: 1.2; }
.page-hero p { font-size: 15px; color: var(--text-2); line-height: 1.7; max-width: 560px; }
.version-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-alt); border: .5px solid var(--border-md);
  border-radius: 99px; padding: 4px 14px; font-size: 12px; color: var(--text-2); margin-top: 14px;
}

/* =====================
   TAB NAV — static, no scroll
===================== */
.tab-nav {
  background: var(--bg-alt);
  border-bottom: .5px solid var(--border);
  padding: 0 24px;
  /* NO overflow, NO sticky, NO position — just normal flow */
}
.tab-nav-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  /* Allow wrapping on small screens instead of scrolling */
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 14px 18px; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all .18s; font-family: inherit; margin-bottom: -1px; white-space: nowrap;
}
.tab-btn.active { color: var(--indigo-600); border-bottom-color: var(--indigo-600); }
.tab-btn:hover:not(.active) { color: var(--text-1); }

/* =====================
   DOCS LAYOUT
===================== */
.docs-layout {
  max-width: 860px; margin: 0 auto; padding: 48px 24px 100px;
}
.section-block { display: none; }
.section-block.active { display: block; }

/* =====================
   ARTICLE
===================== */
.article h2 {
  font-size: 19px; font-weight: 700; color: var(--text-1);
  letter-spacing: -.02em; margin: 44px 0 12px;
  border-bottom: .5px solid var(--border); padding-bottom: 10px;
}
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 15px; font-weight: 600; color: var(--text-1); margin: 24px 0 8px; }
.article p { font-size: 15px; color: var(--text-2); line-height: 1.75; margin-bottom: 14px; }
.article ul { padding-left: 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
[dir="rtl"] .article ul { padding-left: 0; padding-right: 20px; }
.article ul li { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.article a { color: #fff }
.article a:hover { text-decoration: underline; }

.info-box {
  background: var(--indigo-50); border: .5px solid var(--indigo-200);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 20px;
}
.info-box p { color: var(--indigo-800); font-size: 14px; margin-bottom: 0; }

/* =====================
   ENDPOINT BLOCK
===================== */
.endpoint-block {
  background: var(--bg-card); border: .5px solid var(--border-md);
  border-radius: var(--radius-lg); margin-bottom: 28px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.endpoint-header {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: .5px solid var(--border); flex-wrap: wrap;
}
.method-badge {
  font-size: 11px; font-weight: 700; border-radius: 5px;
  padding: 3px 9px; letter-spacing: .05em; font-family: monospace; white-space: nowrap;
}
.method-badge.GET    { background: var(--get-bg);    color: var(--get-color); }
.method-badge.POST   { background: var(--post-bg);   color: var(--post-color); }
.method-badge.PUT    { background: var(--put-bg);    color: var(--put-color); }
.method-badge.PATCH  { background: var(--patch-bg);  color: var(--patch-color); }
.method-badge.DELETE { background: var(--delete-bg); color: var(--delete-color); }

.endpoint-url {
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px;
  color: var(--text-1); background: var(--bg-alt); border: .5px solid var(--border-md);
  border-radius: var(--radius-md); padding: 5px 12px; flex: 1; word-break: break-all;
}
.endpoint-desc { padding: 16px 20px; font-size: 14px; color: var(--text-2); line-height: 1.65; }
.endpoint-body { padding: 0 20px 20px; }

/* =====================
   PARAMS TABLE
===================== */
.params-title { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.params-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
.params-table th { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; border-bottom: .5px solid var(--border); }
[dir="rtl"] .params-table th { text-align: right; }
.params-table td { padding: 9px 10px; color: var(--text-2); border-bottom: .5px solid var(--border); vertical-align: top; }
.params-table tr:last-child td { border-bottom: none; }
.param-name { font-family: monospace; font-size: 12px; color: var(--indigo-600); background: var(--indigo-50); border-radius: 4px; padding: 1px 6px; }
.param-type { font-family: monospace; font-size: 11px; color: var(--text-3); }
.param-req { font-size: 11px; color: #dc2626; font-weight: 500; }
.param-opt { font-size: 11px; color: var(--text-3); }

/* =====================
   CODE BLOCK
===================== */
.code-block { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; border: .5px solid var(--border-md); }
.code-tabs { display: flex; background: #1e293b; border-bottom: .5px solid rgba(255,255,255,.08); }
.code-tab {
  background: transparent; border: none; padding: 8px 16px; font-size: 12px;
  font-weight: 500; color: #94a3b8; cursor: pointer; font-family: inherit; transition: all .15s;
}
.code-tab.active { color: #fff; border-bottom: 2px solid var(--indigo-400); }
.code-tab:hover:not(.active) { color: #cbd5e1; }
.code-panel { display: none; position: relative; }
.code-panel.active { display: block; }
.code-copy {
  position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.1);
  border: .5px solid rgba(255,255,255,.15); border-radius: 6px; padding: 5px 10px;
  font-size: 11px; color: #94a3b8; cursor: pointer; font-family: inherit; transition: all .15s;
}
[dir="rtl"] .code-copy { right: auto; left: 10px; }
.code-copy:hover { background: rgba(255,255,255,.18); color: #fff; }
.code-copy.copied { color: #4ade80; border-color: #4ade80; }
pre {
  background: var(--bg-code); color: #e2e8f0;
  padding: 18px 20px; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px; line-height: 1.65; overflow-x: auto; margin: 0;
}
.c-comment { color: #64748b; }
.c-key     { color: #7dd3fc; }
.c-str     { color: #86efac; }
.c-num     { color: #fda4af; }
.c-kw      { color: #c4b5fd; }
.c-fn      { color: #fbbf24; }

/* =====================
   RESPONSE BLOCK
===================== */
.response-block { border-radius: var(--radius-md); overflow: hidden; border: .5px solid var(--border-md); margin-top: 16px; }
.response-header { display: flex; align-items: center; justify-content: space-between; background: #1e293b; padding: 8px 16px; }
.response-label { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .07em; }
.response-status { font-size: 11px; font-weight: 600; color: #4ade80; font-family: monospace; }

/* =====================
   STEP LIST
===================== */
.step-list { display: flex; flex-direction: column; gap: 0; }
.step-item { display: flex; gap: 20px; padding: 24px 0; border-bottom: .5px solid var(--border); }
.step-item:last-child { border-bottom: none; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--indigo-600);
  color: #fff; font-size: 14px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.step-content { flex: 1; }
.step-content h3 { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.step-content p { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 0; }
.step-content code { font-family: monospace; font-size: 12px; background: var(--bg-alt); border: .5px solid var(--border-md); border-radius: 4px; padding: 1px 6px; color: var(--indigo-600); }

/* =====================
   FEATURE TAGS
===================== */
.tags-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.feat-tag {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: .5px solid var(--border-md);
  border-radius: var(--radius-md); padding: 10px 16px;
  font-size: 13px; color: var(--text-2); box-shadow: var(--shadow-card);
}
.feat-tag svg { width: 15px; height: 15px; stroke: var(--indigo-600); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* =====================
   OAUTH FLOW
===================== */
.oauth-steps { display: flex; flex-direction: column; }
.oauth-step { display: flex; gap: 16px; padding: 16px 0; }
.oauth-step-dot { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.oauth-dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--indigo-100);
  border: 2px solid var(--indigo-400); display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700; color: var(--indigo-600);
}
.oauth-line { width: 2px; flex: 1; background: var(--border-md); min-height: 20px; margin: 4px auto 0; }
.oauth-step:last-child .oauth-line { display: none; }
.oauth-content { flex: 1; padding-bottom: 8px; }
.oauth-content h4 { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.oauth-content p { font-size: 13px; color: var(--text-2); line-height: 1.65; margin: 0; }

/* =====================
   INSTALL URL CARD
===================== */
.install-card { background: var(--bg-alt); border: .5px solid var(--border-md); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 24px; }
.install-card-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.install-url { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.install-url code { flex: 1; font-family: monospace; font-size: 13px; color: var(--indigo-600); background: var(--bg-card); border: .5px solid var(--border-md); border-radius: var(--radius-md); padding: 10px 14px; word-break: break-all; }
.btn-copy-url { background: var(--indigo-600); color: #fff; border: none; border-radius: var(--radius-md); padding: 10px 16px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; white-space: nowrap; transition: background .18s; }
.btn-copy-url:hover { background: var(--indigo-700); }
.btn-copy-url.copied { background: #15803d; }

/* =====================
   BASE URL BANNER
===================== */
.base-url-banner {
  background: var(--indigo-50); border: .5px solid var(--indigo-200);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.base-url-banner span { font-size: 13px; color: var(--indigo-800); font-weight: 500; white-space: nowrap; }
.base-url-banner code { font-family: monospace; font-size: 13px; color: var(--indigo-700); flex: 1; }

/* =====================
   AUTH KEY
===================== */
.auth-key-example {
  background: var(--bg-code); border-radius: var(--radius-md);
  padding: 14px 18px; font-family: monospace; font-size: 13px;
  color: #e2e8f0; margin-bottom: 16px; border: .5px solid var(--border-md);
}

/* =====================
   DOWNLOAD CARD
===================== */
.download-card {
  background: var(--bg-card); border: 2px solid var(--indigo-400);
  border-radius: var(--radius-lg); padding: 28px 24px; margin-bottom: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  box-shadow: 0 4px 24px rgba(79,70,229,.1);
}
.download-card-info h3 { font-size: 17px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.download-card-info p { font-size: 14px; color: var(--text-2); margin: 0; }
.download-meta { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.download-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.download-meta-item svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }

/* =====================
   FOOTER
===================== */
.footer { border-top: .5px solid var(--border); padding: 28px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 13px; color: var(--text-3); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-3); transition: color .15s; }
.footer-links a:hover { color: var(--indigo-600); }

/* =====================
   RESPONSIVE
===================== */
@media(max-width:768px){
  .nav-links { display: none; }
  .download-card { flex-direction: column; align-items: flex-start; }
}
@media(max-width:600px){
  .nav-inner { padding: 0 16px; }
  .hero { padding: 52px 16px 48px; }
  .docs-layout { padding: 32px 16px 60px; }
  .endpoint-header { flex-direction: column; align-items: flex-start; }
  .tab-btn { padding: 12px 12px; font-size: 12px; }
}