/* MegaBot Pro — Documentation */
:root {
  --bg: #0a0a0f; --bg2: #0e0e15; --card: #16161f; --card2: #1c1c28;
  --border: rgba(255,255,255,.07); --border2: rgba(255,255,255,.12);
  --blue: #3b82f6; --purple: #8b5cf6; --green: #10b981; --red: #ef4444;
  --amber: #f59e0b; --cyan: #06b6d4;
  --text: #f1f5f9; --text2: #94a3b8; --text3: #64748b;
  --sidebar-w: 270px; --topbar-h: 60px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', -apple-system, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
code { font-family: 'JetBrains Mono', monospace; font-size: .86em; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: #c7d2fe; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* TOP BAR */
.topbar { position: fixed; top: 0; inset-inline: 0; height: var(--topbar-h); z-index: 50; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: rgba(10,10,15,.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 26px; height: 26px; border-radius: 7px; }
.brand em { color: var(--text3); font-style: normal; font-weight: 600; }
.topbar-search { flex: 1; max-width: 420px; }
.topbar-search input { width: 100%; height: 38px; padding: 0 14px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: .9rem; outline: none; transition: border-color .2s; }
.topbar-search input:focus { border-color: var(--blue); }
.topbar-search input::placeholder { color: var(--text3); }
.topbar-links { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.topbar-links a { color: var(--text2); font-size: .9rem; font-weight: 500; }
.topbar-links a:hover { color: var(--text); text-decoration: none; }
.tb-cta { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff !important; padding: 8px 18px; border-radius: 9px; font-weight: 600; }
.tb-cta:hover { box-shadow: 0 0 20px rgba(59,130,246,.35); }
.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* LAYOUT */
.layout { display: flex; padding-top: var(--topbar-h); }
.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; width: var(--sidebar-w); overflow-y: auto; border-right: 1px solid var(--border); padding: 24px 16px 60px; background: var(--bg2); }
.sidebar::-webkit-scrollbar { width: 5px; } .sidebar::-webkit-scrollbar-thumb { background: #2a2a38; border-radius: 3px; }
.nav-group { margin-bottom: 22px; }
.nav-group-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); padding: 0 12px; margin-bottom: 8px; }
.nav-link { display: block; padding: 7px 12px; border-radius: 8px; color: var(--text2); font-size: .88rem; font-weight: 500; transition: all .18s; border-left: 2px solid transparent; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.03); text-decoration: none; }
.nav-link.active { color: #fff; background: rgba(59,130,246,.1); border-left-color: var(--blue); }
.sidebar-overlay { display: none; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(0,0,0,.6); z-index: 39; }

/* CONTENT */
.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; padding: 48px 56px 120px; }
article { max-width: 820px; margin: 0 auto; }
.doc-section { padding-top: 28px; margin-bottom: 28px; scroll-margin-top: 80px; }
.doc-section + .doc-section { border-top: 1px solid var(--border); }
.kicker { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.2); padding: 4px 11px; border-radius: 6px; margin-bottom: 14px; }
h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; }
h2 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 24px 0 10px; }
p { color: var(--text2); line-height: 1.75; margin-bottom: 14px; }
.lead { font-size: 1.12rem; color: #cbd5e1; line-height: 1.7; }

.feature-bullets { list-style: none; margin: 6px 0 16px; }
.feature-bullets li { position: relative; padding: 6px 0 6px 26px; color: var(--text2); line-height: 1.6; }
.feature-bullets li::before { content: '✓'; position: absolute; left: 0; top: 6px; color: var(--green); font-weight: 700; font-size: .85rem; }
.steps { margin: 6px 0 16px; padding-left: 22px; }
.steps li { color: var(--text2); line-height: 1.6; padding: 6px 0 6px 6px; }
.steps li::marker { color: var(--blue); font-weight: 700; }

/* CALLOUTS */
.callout { border-radius: 12px; padding: 14px 18px; margin: 18px 0; font-size: .92rem; line-height: 1.65; border: 1px solid var(--border); }
.callout.info { background: rgba(59,130,246,.07); border-color: rgba(59,130,246,.25); color: #bfdbfe; }
.callout.warn { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.25); color: #fcd9a0; }
.callout.danger { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.25); color: #fca5a5; }
.callout strong { color: #fff; }

/* TABLE */
.doc-table { width: 100%; border-collapse: collapse; margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.doc-table th, .doc-table td { text-align: left; padding: 11px 16px; font-size: .9rem; border-bottom: 1px solid var(--border); }
.doc-table th { background: rgba(255,255,255,.03); color: var(--text3); text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; }
.doc-table td { color: var(--text2); }
.doc-table tr:last-child td { border-bottom: none; }

/* CHAIN CARDS */
.chain-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; margin: 18px 0; }
.chain-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: rgba(22,22,31,.6); border: 1px solid var(--border); transition: all .2s; }
.chain-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.chain-card .cg { position: relative; width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--c) 22%, #0a0a0c) 0%, #08080a 62%); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 0 16px -3px var(--c), 0 6px 18px -8px var(--c); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.chain-card .cg::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.16), transparent 46%); pointer-events: none; }
.chain-card .cg img { position: relative; width: 56%; height: 56%; object-fit: contain; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--c) 70%, transparent)); }
.chain-card:hover .cg { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 24px -2px var(--c), 0 10px 24px -8px var(--c); }
.chain-card strong { display: block; font-size: .98rem; }
.chain-card em { font-style: normal; font-size: .78rem; color: var(--text3); }

/* FAQ */
.faq { background: rgba(22,22,31,.5); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.faq summary { padding: 15px 18px; font-weight: 600; font-size: .95rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; color: var(--text3); }
.faq[open] summary::after { content: '−'; color: var(--blue); }
.faq p { padding: 0 18px 16px; margin: 0; }

/* SUPPORT */
.support-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.support-btn { padding: 12px 24px; border-radius: 11px; font-weight: 600; font-size: .92rem; border: 1px solid var(--border2); color: var(--text); }
.support-btn:hover { text-decoration: none; background: rgba(255,255,255,.04); }
.support-btn.primary { background: linear-gradient(135deg, var(--blue), var(--purple)); border-color: transparent; color: #fff; }
.support-btn.primary:hover { box-shadow: 0 6px 24px rgba(59,130,246,.35); }
.foot-note { margin-top: 30px; font-size: .82rem; color: var(--text3); }

/* SEARCH HIDE */
.nav-link.hidden { display: none; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .content { padding: 40px 32px 100px; }
}
@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .topbar-search { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .3s cubic-bezier(.16,1,.3,1); z-index: 40; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .content { margin-left: 0; padding: 32px 20px 80px; }
  h1 { font-size: 1.8rem; }
  .topbar-links a:not(.tb-cta) { display: none; }
}

/* ===== Screenshot figures + lightbox ===== */
.shot { margin: 20px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg2); cursor: zoom-in; transition: border-color .2s, transform .2s, box-shadow .2s; }
.shot:hover { border-color: rgba(59,130,246,.4); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a2a32; display: inline-block; }
.shot-bar i:first-child { background: #ff5f5780; } .shot-bar i:nth-child(2){ background: #febc2e80; } .shot-bar i:nth-child(3){ background: #28c84080; }
.shot-bar span { display: none; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 9px 14px; font-size: .8rem; color: var(--text3); border-top: 1px solid var(--border); background: rgba(255,255,255,.015); }
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); backdrop-filter: blur(6px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 28px; cursor: zoom-out; }
#lightbox.open { display: flex; animation: lb-in .18s ease; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
#lightbox img { max-width: 95%; max-height: 92%; border-radius: 10px; border: 1px solid var(--border2); box-shadow: 0 30px 90px rgba(0,0,0,.7); }
#lightbox .lb-close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 2rem; line-height: 1; opacity: .7; }

/* ===== Language dropdown ===== */
.lang-dd { position: relative; }
.lang-dd-toggle { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: .74rem; font-weight: 700; letter-spacing: .04em; padding: 7px 11px; background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--border2); border-radius: 8px; cursor: pointer; transition: border-color .18s; }
.lang-dd-toggle:hover { border-color: var(--blue); }
.lang-caret { font-size: .58rem; color: var(--text3); transition: transform .2s; }
.lang-dd.open .lang-caret { transform: rotate(180deg); }
.lang-dd-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 148px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px; padding: 5px; display: none; flex-direction: column; gap: 2px; box-shadow: 0 18px 44px rgba(0,0,0,.55); z-index: 60; }
.lang-dd.open .lang-dd-menu { display: flex; }
.lang-dd-menu button { display: flex; align-items: center; justify-content: space-between; font-size: .86rem; padding: 9px 12px; background: transparent; color: var(--text2); border: none; border-radius: 7px; cursor: pointer; text-align: left; transition: all .15s; }
.lang-dd-menu button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.lang-dd-menu button.active { color: var(--blue); }
.lang-dd-menu button.active::after { content: '✓'; font-size: .8rem; }
