/* ═══════════════════════════════════════════
   Bouflix Documentation — Premium Dark Theme
   ═══════════════════════════════════════════ */
:root {
  --bg: #0d1117; --bg2: #161b22; --bg3: #1c2333;
  --surface: #21262d; --surface2: #2d333b;
  --border: #30363d; --border2: #444c56;
  --text: #e6edf3; --text2: #8b949e; --text3: #6e7681;
  --accent: #58a6ff; --accent2: #1f6feb;
  --green: #3fb950; --red: #f85149; --yellow: #d29922; --purple: #bc8cff;
  --sidebar-w: 280px;
  --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.7; font-size: 15px;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 100; padding-bottom: 2rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar-header {
  padding: 1.5rem 1.25rem 1rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg2); z-index: 1;
}
.logo { font-size: 1.3rem; font-weight: 700; }
.logo span { background: linear-gradient(135deg, var(--accent), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.version { font-size: .75rem; color: var(--text3); margin-top: .25rem; }
.sidebar nav { padding: .75rem 0; }
.sidebar nav ul { list-style: none; }
.sidebar nav > ul > li { margin: .125rem 0; }
.sidebar nav > ul > li > a,
.sidebar nav .nav-group { display: block; padding: .5rem 1.25rem; color: var(--text2); text-decoration: none; font-size: .875rem; border-radius: var(--radius); transition: .15s; }
.sidebar nav > ul > li > a:hover { color: var(--text); background: var(--surface); }
.sidebar nav > ul > li > a.active { color: var(--accent); background: rgba(88,166,255,.08); font-weight: 600; border-left: 3px solid var(--accent); }
.nav-group { font-weight: 600; color: var(--text)!important; font-size: .8rem!important; text-transform: uppercase; letter-spacing: .05em; margin-top: .75rem!important; cursor: default; }
.nav-group ul { margin-top: .25rem; }
.nav-group ul li a { display: block; padding: .35rem 1.25rem .35rem 2rem; color: var(--text2); text-decoration: none; font-size: .82rem; border-radius: var(--radius); transition: .15s; }
.nav-group ul li a:hover { color: var(--text); background: var(--surface); }
.nav-group ul li a.active { color: var(--accent); background: rgba(88,166,255,.08); }

/* ── TOPBAR (mobile) ── */
.topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 1rem; align-items: center; gap: .75rem; z-index: 99;
}
.menu-btn { background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.topbar-title { font-weight: 600; font-size: 1rem; }

/* ── MAIN CONTENT ── */
.content { margin-left: var(--sidebar-w); padding: 2.5rem 3rem 4rem; max-width: 900px; }
section { margin-bottom: 3.5rem; padding-top: 1rem; }
h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: .5rem; }
h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); color: var(--text); }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 .75rem; color: var(--text); }
h4 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
p { margin-bottom: .75rem; color: var(--text2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: .5rem 0 1rem 1.5rem; color: var(--text2); }
li { margin: .3rem 0; }
code { font-family: 'JetBrains Mono', monospace; font-size: .85em; background: var(--surface); color: var(--green); padding: .15em .4em; border-radius: 4px; }
pre { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; overflow-x: auto; margin: .75rem 0 1rem; position: relative; }
pre code { background: none; padding: 0; color: var(--text); font-size: .82rem; line-height: 1.6; }
.copy-btn { position: absolute; top: .5rem; right: .5rem; background: var(--surface2); color: var(--text2); border: 1px solid var(--border); border-radius: 4px; padding: .2rem .6rem; font-size: .72rem; cursor: pointer; font-family: 'Inter', sans-serif; transition: .15s; }
.copy-btn:hover { background: var(--accent2); color: #fff; border-color: var(--accent); }

/* ── HERO ── */
.hero { text-align: center; padding: 2rem 0 2.5rem; }
.hero-sub { font-size: 1.1rem; color: var(--text2); max-width: 600px; margin: .5rem auto 1.25rem; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.badge { background: var(--surface); border: 1px solid var(--border); padding: .3rem .75rem; border-radius: 20px; font-size: .78rem; font-weight: 500; color: var(--accent); }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; transition: .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(88,166,255,.08); }
.card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: .9rem; }

/* ── GRIDS ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin: 1rem 0; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem 1rem; font-size: .88rem; font-weight: 500; transition: .15s; }
.feature:hover { border-color: var(--accent); background: rgba(88,166,255,.05); }

/* ── TABLES ── */
table { width: 100%; border-collapse: collapse; margin: .75rem 0 1.25rem; font-size: .88rem; }
th, td { padding: .6rem .85rem; text-align: left; border: 1px solid var(--border); }
th { background: var(--surface); font-weight: 600; color: var(--text); white-space: nowrap; }
td { color: var(--text2); }
tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* ── STEPS ── */
.steps { margin: 1rem 0 1.5rem; }
.step { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.step-num { flex-shrink: 0; width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent2), var(--purple)); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; margin-top: .1rem; }
.step-content { flex: 1; }
.step-content h4 { color: var(--text); margin-bottom: .3rem; }
.step-content p { font-size: .9rem; }

/* ── SCREENSHOTS ── */
.screenshot { margin: .75rem 0 .25rem; }
.screenshot img { width: 100%; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,.3); }

/* ── ALERTS ── */
.alert { border-radius: var(--radius); padding: .85rem 1rem; margin: .75rem 0; font-size: .88rem; border-left: 4px solid; }
.alert.info { background: rgba(88,166,255,.08); border-color: var(--accent); color: #79c0ff; }
.alert.warning { background: rgba(210,153,34,.08); border-color: var(--yellow); color: #e3b341; }
.alert.tip { background: rgba(63,185,80,.08); border-color: var(--green); color: #56d364; }
.alert.danger { background: rgba(248,81,73,.08); border-color: var(--red); color: #f97583; }
.alert code { background: rgba(255,255,255,.1); }
.alert pre { border-color: rgba(255,255,255,.1); background: rgba(0,0,0,.2); margin: .5rem 0 0; }

/* ── FAQ ── */
.faq-item { margin-bottom: .5rem; }
.faq-item details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-item summary { padding: .85rem 1rem; cursor: pointer; font-weight: 500; font-size: .92rem; color: var(--text); list-style: none; }
.faq-item summary::before { content: '▸ '; color: var(--accent); }
.faq-item details[open] summary::before { content: '▾ '; }
.faq-item details[open] summary { border-bottom: 1px solid var(--border); }
.faq-item details p { padding: .85rem 1rem; margin: 0; font-size: .88rem; }

/* ── CHANGELOG ── */
.changelog-entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.changelog-entry h3 { margin: 0 0 .75rem; color: var(--accent); }

/* ── FOOTER ── */
footer { text-align: center; padding: 2rem 0; border-top: 1px solid var(--border); margin-top: 2rem; }
footer p { color: var(--text3); font-size: .85rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: .25s ease; width: 280px; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.5); }
  .topbar { display: flex; }
  .content { margin-left: 0; padding: 72px 1.25rem 3rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  table { font-size: .8rem; }
  th, td { padding: .4rem .5rem; }
}
