/* BugBI SDK docs — themed to logo (navy #0a2a4a + orange #ff7700) */
:root {
  --navy: #0a2a4a;
  --navy-soft: #143d66;
  --brand: #ff7700;
  --brand-soft: #ff9440;
  --brand-deep: #e06500;
  --brand-muted: rgba(255, 119, 0, 0.14);
  --ink: #0c1624;
  --muted: #5a6a7d;
  --surface: #f2f6fb;
  --card: #ffffff;
  --line: rgba(10, 42, 74, 0.1);
  --shadow: 0 10px 28px rgba(10, 42, 74, 0.1);
  --shadow-soft: 0 18px 44px rgba(10, 42, 74, 0.12);
  --radius: 16px;
  --sidebar: #061525;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Vazirmatn, "Syne", sans-serif;
  background:
    radial-gradient(ellipse 70% 35% at 80% -5%, rgba(255, 119, 0, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(10, 42, 74, 0.06), transparent 50%),
    var(--surface);
  color: var(--ink);
  line-height: 1.85;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand); }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 119, 0, 0.28), transparent 60%),
    linear-gradient(180deg, var(--navy-soft) 0%, var(--sidebar) 45%);
  color: #fff;
  padding: 1.35rem 1rem 2rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.sidebar .brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
}

.sidebar .brand {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  font-family: Syne, Vazirmatn, sans-serif;
}

.sidebar .brand-sub {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  margin-bottom: 1.4rem;
  margin-right: 0.15rem;
}

.sidebar nav a {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar nav a.active {
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  box-shadow: var(--shadow);
  border-color: rgba(255, 119, 0, 0.35);
}

.content {
  padding: 2rem 1.5rem 3.5rem;
  max-width: 920px;
  width: 100%;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--brand-muted);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  border: none;
  box-shadow: 0 8px 20px rgba(255, 119, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 119, 0, 0.35);
  color: #fff !important;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 0.25rem;
}

h1 {
  margin: 0.7rem 0 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: Syne, Vazirmatn, sans-serif;
  color: var(--navy);
}

h2 {
  margin: 0 0 0.85rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
}

.lead {
  color: var(--muted);
  margin: 0 0 1.35rem;
  max-width: 42rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  margin: 1.1rem 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--brand), transparent);
}

.card > *:first-child { margin-top: 0.1rem; }

.card ul {
  margin: 0.4rem 0 0.8rem;
  padding-inline-start: 1.2rem;
}

.card li { margin-bottom: 0.35rem; }

.warn {
  background: #fff6e8;
  color: #c47a12;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(196, 122, 18, 0.2);
}

code, .tech {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: ui-monospace, Consolas, monospace;
  background: #e6edf5;
  padding: 0.12rem 0.42rem;
  border-radius: 7px;
  font-size: 0.86em;
  color: var(--navy);
}

.pre-wrap {
  position: relative;
  margin: 0.85rem 0 0.25rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--sidebar);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(180deg, var(--navy-soft) 0%, var(--navy) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  direction: rtl;
}

.code-toolbar-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  direction: ltr;
}

.copy-btn {
  position: static;
  flex-shrink: 0;
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid rgba(255, 119, 0, 0.45);
  border-radius: 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.38rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.copy-btn:hover {
  background: var(--brand-muted);
}

.copy-btn:active {
  transform: translateY(1px);
}

.copy-btn.is-copied {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

pre {
  direction: ltr;
  text-align: left;
  background: transparent;
  color: #f2f6fb;
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 0;
  overflow: auto;
  position: relative;
  max-width: 100%;
  font-size: 0.84rem;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

th, td {
  text-align: right;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #e6edf5;
  vertical-align: top;
}

th {
  background: #eef3f8;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.crumb {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
}

.footer-note {
  margin-top: 2.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.platform-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.platform-card {
  display: block;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.platform-card:hover {
  border-color: rgba(255, 119, 0, 0.45);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  color: inherit;
}

.platform-card strong {
  display: block;
  color: var(--navy);
  font-size: 1.02rem;
  margin-bottom: 0.25rem;
}

.platform-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.platform-card .dl {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-deep);
}

.method-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0 0.25rem;
}

.method-toc a {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-muted);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(255, 119, 0, 0.25);
}

.method-toc a:hover {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand-deep);
}

.method-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 1rem 1.1rem 1.15rem;
  margin: 0.9rem 0;
  box-shadow: var(--shadow);
}

.method-block h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  color: var(--navy);
  font-weight: 800;
}

.method-block .meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 0.65rem;
  line-height: 1.7;
}

.method-block .params {
  margin: 0.35rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #eef3f8;
  font-size: 0.86rem;
}

.method-block .params strong {
  color: var(--navy);
}

.method-block .endpoint {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  margin: 0.25rem 0 0.7rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  background: #e6edf5;
  color: var(--navy);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}

.verify-hint {
  margin: 0.55rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .sidebar nav a {
    margin-bottom: 0;
    font-size: 0.82rem;
    padding: 0.45rem 0.7rem;
  }
  .content { padding: 1.25rem 1rem 2.5rem; }
}
