/* =========================================
   BlockZen Documentation — docs.css
   ========================================= */

:root {
  --primary:     #6c63ff;
  --secondary:   #00d4aa;
  --dark-bg:     #0d0d1a;
  --dark-card:   #13132b;
  --sidebar-w:   280px;
  --text-light:  #ffffff;
  --text-muted:  #a0a0c0;
  --border:      rgba(255,255,255,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--dark-bg);
  color: var(--text-light);
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.docs-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--dark-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo a {
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-version {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-nav-label {
  padding: 8px 24px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text-light);
  background: rgba(108,99,255,0.08);
  border-left-color: var(--primary);
}

/* ---- Main Content ---- */
.docs-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 96px 60px 48px;
  max-width: 900px;
}

/* ---- Top Bar ---- */
.docs-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 60px;
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px;
  z-index: 99;
}

.docs-search input {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--text-light);
  font-size: 0.85rem;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.docs-search input:focus { border-color: var(--primary); }

.docs-topbar-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 20px;
  transition: color 0.2s;
}

.docs-topbar-links a:hover { color: var(--text-light); }

/* ---- Section Styles ---- */
.docs-section { margin-bottom: 64px; }

.docs-section h1 { font-size: 2.2rem; margin-bottom: 12px; }

.docs-section h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-section h3 {
  font-size: 1.1rem;
  margin: 28px 0 10px;
  color: var(--secondary);
}

.docs-section p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.docs-section ul {
  list-style: disc;
  padding-left: 24px;
  color: var(--text-muted);
  line-height: 2;
}

/* Badge */
.badge-new {
  display: inline-block;
  padding: 2px 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  margin-left: 8px;
  vertical-align: middle;
}

/* Code blocks */
pre {
  background: #0a0a18;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
  font-size: 0.85rem;
  line-height: 1.7;
}

code {
  font-family: 'Fira Code', 'Courier New', monospace;
  color: var(--secondary);
}

pre code { color: #e0e0ff; }

/* Callout boxes */
.callout {
  border-left: 4px solid var(--primary);
  background: rgba(108,99,255,0.08);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--text-muted);
}

.callout.tip  { border-color: var(--secondary); background: rgba(0,212,170,0.08); }
.callout.warn { border-color: #f59e0b;          background: rgba(245,158,11,0.08); }
.callout strong { color: var(--text-light); display: block; margin-bottom: 4px; }

/* Table */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 28px;
  font-size: 0.88rem;
}

.docs-table th {
  background: var(--dark-card);
  color: var(--text-light);
  padding: 10px 16px;
  text-align: left;
  border: 1px solid var(--border);
}

.docs-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.docs-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Prev / Next Navigation */
.docs-nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.docs-nav-footer a {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s;
  min-width: 180px;
}

.docs-nav-footer a:hover { border-color: var(--primary); }

.docs-nav-footer .nav-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.docs-nav-footer .nav-title { font-size: 0.95rem; font-weight: 600; color: var(--text-light); }
.docs-nav-footer .next { text-align: right; }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}

/* ---- Topbar hamburger button (mobile only) ---- */
.docs-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-right: 12px;
  flex-shrink: 0;
}

.docs-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-light);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---- Sidebar overlay backdrop ---- */
.docs-overlay {
  display: none;
  position: fixed;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

.docs-overlay.open { display: block; }

/* ---- Responsive — Tablet & Mobile (<= 991px) ---- */
@media (max-width: 991px) {
  /* Slide sidebar off-screen by default */
  .docs-sidebar {
    transform: translateX(-100%);
    z-index: 101;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  /* Slide in when open */
  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  /* Main content: no sidebar offset */
  .docs-main {
    margin-left: 0;
    padding: 84px 24px 40px;
    max-width: 100%;
  }

  /* Topbar: full width */
  .docs-topbar {
    left: 0;
    padding: 0 16px;
  }

  /* Show hamburger */
  .docs-hamburger { display: flex; }

  /* Hide the old floating toggle */
  .sidebar-toggle { display: none !important; }

  /* Shrink search input */
  .docs-search input { width: 160px; }

  /* Stack prev/next footer on small screens */
  .docs-nav-footer { flex-direction: column; gap: 12px; }
  .docs-nav-footer a { min-width: unset; }
  .docs-nav-footer .next { text-align: left; }
}

/* ---- Small Mobile (<= 600px) ---- */
@media (max-width: 600px) {
  .docs-topbar-links { display: none; }
  .docs-search input  { width: 100%; max-width: 200px; }
  .docs-section h1    { font-size: 1.6rem; }
  .docs-section h2    { font-size: 1.2rem; }
  .docs-table         { font-size: 0.8rem; }
  .docs-table th,
  .docs-table td      { padding: 8px 10px; }
  pre                 { font-size: 0.78rem; padding: 14px 16px; }
}