/* ============================================================
   BLITZ — Documentation Dark Theme
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #06060f;
  --bg-secondary: #0a0a1a;
  --bg-card: rgba(17, 17, 40, 0.6);
  --bg-card-solid: #111128;
  --bg-card-hover: rgba(24, 24, 64, 0.7);
  --bg-sidebar: #09091a;
  --accent: #7c8aff;
  --accent-glow: rgba(124, 138, 255, 0.35);
  --accent-light: #a0abff;
  --accent2: #22d3ee;
  --accent2-glow: rgba(34, 211, 238, 0.25);
  --accent-gradient: linear-gradient(135deg, #7c8aff 0%, #22d3ee 100%);
  --text-primary: #f0f0f8;
  --text-secondary: #9999b8;
  --text-muted: #6a6a8a;
  --border: rgba(124, 138, 255, 0.1);
  --border-hover: rgba(124, 138, 255, 0.28);
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --sidebar-w: 280px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(124, 138, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }

/* --- Top Navbar --- */
.doc-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(6, 6, 15, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.doc-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.doc-topbar .logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-topbar .logo img {
  width: 24px;
  height: 24px;
}

.doc-topbar .logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.doc-topbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.doc-topbar-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition);
}

.doc-topbar-links a:hover {
  color: var(--text-primary);
}

.doc-topbar-links .btn-back {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--accent);
}

.doc-topbar-links .btn-back:hover {
  border-color: var(--accent);
  background: rgba(124, 138, 255, 0.06);
}

/* --- Mobile toggle --- */
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.2rem;
}

/* --- Sidebar --- */
.doc-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 90;
}

.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-track { background: transparent; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
  margin-bottom: 24px;
  padding: 0 20px;
}

.sidebar-section-title {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li {
  margin-bottom: 2px;
}

.sidebar-links a {
  display: block;
  padding: 7px 12px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all var(--transition);
  font-weight: 450;
}

.sidebar-links a:hover {
  color: var(--text-primary);
  background: rgba(124, 138, 255, 0.06);
}

.sidebar-links a.active {
  color: var(--accent);
  background: rgba(124, 138, 255, 0.1);
  font-weight: 600;
}

/* --- Main Content --- */
.doc-main {
  margin-left: var(--sidebar-w);
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1;
}

.doc-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.breadcrumb .current {
  color: var(--text-secondary);
}

/* --- Typography --- */
.doc-content h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.doc-content .doc-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

.doc-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.doc-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.doc-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.doc-content ul, .doc-content ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
  font-size: 0.95rem;
}

.doc-content li {
  margin-bottom: 8px;
}

.doc-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Gradient text --- */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Info / Tip / Warning boxes --- */
.doc-box {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  border-left: 3px solid;
}

.doc-box p { margin-bottom: 0; }

.doc-box.tip {
  background: rgba(34, 211, 238, 0.06);
  border-color: var(--accent2);
  color: var(--accent2);
}

.doc-box.info {
  background: rgba(124, 138, 255, 0.06);
  border-color: var(--accent);
  color: var(--accent-light);
}

.doc-box.warning {
  background: rgba(251, 191, 36, 0.06);
  border-color: var(--warning);
  color: var(--warning);
}

.doc-box .box-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

/* --- Code blocks --- */
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: rgba(124, 138, 255, 0.08);
  color: var(--accent-light);
  padding: 2px 7px;
  border-radius: 5px;
}

pre {
  background: #0c0c20;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0 24px;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Step list --- */
.step-list {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}

.step-list li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 48px;
  margin-bottom: 24px;
}

.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: rgba(124, 138, 255, 0.12);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

/* --- Feature card (for doc hub) --- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: all var(--transition);
}

.doc-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.doc-card h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.doc-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* --- Search bar --- */
.doc-search-wrapper {
  margin-bottom: 40px;
}

.doc-search {
  width: 100%;
  padding: 14px 20px 14px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition);
}

.doc-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.doc-search::placeholder {
  color: var(--text-muted);
}

.doc-search-wrapper {
  position: relative;
}

.doc-search-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* --- Table --- */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.9rem;
}

.doc-table th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(124, 138, 255, 0.06);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.doc-table td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

/* --- Page navigation (prev / next) --- */
.doc-pagination {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.doc-pagination a {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-width: 180px;
  flex: 1;
}

.doc-pagination a:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.doc-pagination .prev { text-align: left; }
.doc-pagination .next { text-align: right; }

.doc-pagination .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.doc-pagination .title {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .doc-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 95;
    width: 280px;
  }

  .doc-sidebar.open {
    transform: translateX(0);
  }

  .doc-main {
    margin-left: 0;
  }

  .doc-content {
    padding: 32px 20px 60px;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .doc-topbar-links {
    gap: 12px;
  }

  .doc-pagination {
    flex-direction: column;
  }

  .doc-pagination a {
    min-width: 0;
  }
}

@media (max-width: 500px) {
  .doc-content h1 {
    font-size: 1.6rem;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Sidebar overlay for mobile --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 60px;
  background: rgba(0,0,0,0.5);
  z-index: 94;
}

.sidebar-overlay.active {
  display: block;
}
