/* ============================================
   Pyrox Docs — style.css
   Dark theme, matches pyrox.xyz design system
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1c2030;
  --sidebar-bg: #141929;
  --card-bg: #1f2536;
  --navbar-bg: #161b29;
  --code-bg: #0d1117;
  --text: #ffffff;
  --text-muted: #95a0ba;
  --category-text: #7f8aa8;
  --accent: #2f8cff;
  --accent-hover: #4da0ff;
  --active-bg: linear-gradient(90deg, rgba(47,140,255,0.2), rgba(47,140,255,0.02));
  --border: rgba(255, 255, 255, 0.06);
  --premium: #f4c84c;
  --navbar-h: 62px;
  --sidebar-w: 260px;
  --content-max: 800px;
  --toc-w: 220px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-pill: 99px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 50% -80px, #2a3148 0%, #1c2030 46%, #1a1e2c 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Sora', sans-serif; font-weight: 700; line-height: 1.3; }

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

::selection { background: rgba(47,140,255,0.35); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* --- Navbar --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.navbar-left { display: flex; align-items: center; gap: 12px; }

.navbar-logo {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover;
}

.navbar-brand {
  font-family: 'Sora', sans-serif;
  font-weight: 800; font-size: 18px; letter-spacing: 1.5px;
  color: var(--text);
}

.navbar-badge {
  background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

.navbar-right { display: flex; align-items: center; gap: 16px; }

.navbar-link {
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  transition: color .15s;
}
.navbar-link:hover { color: var(--text); }

.btn-add {
  background: linear-gradient(135deg, #2f8cff, #1a6fdf);
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 8px 20px; border-radius: var(--radius-pill);
  border: none; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(47,140,255,0.35); color: #fff; }

.hamburger {
  display: none; background: none; border: none;
  color: var(--text); font-size: 22px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.hamburger:hover { background: rgba(255,255,255,0.06); }

/* --- Sidebar --- */
.sidebar {
  position: fixed; top: var(--navbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 0;
  z-index: 900;
  transition: transform .25s ease;
}

.sidebar-search {
  padding: 0 16px; margin-bottom: 12px;
}

.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; padding: 9px 12px 9px 34px;
  outline: none; transition: border-color .15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--category-text); }

.sidebar-search-wrap {
  position: relative;
}
.sidebar-search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--category-text); pointer-events: none;
}

.sidebar-category {
  padding: 16px 16px 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--category-text);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  user-select: none;
}
.sidebar-category:hover { color: var(--text-muted); }
.sidebar-category .chevron {
  transition: transform .2s; font-size: 10px;
}
.sidebar-category.collapsed .chevron { transform: rotate(-90deg); }

.sidebar-items { overflow: hidden; transition: max-height .25s ease; }
.sidebar-category.collapsed + .sidebar-items { max-height: 0 !important; }

.sidebar-item {
  display: block;
  padding: 7px 16px 7px 20px;
  font-size: 14px; color: var(--text-muted);
  cursor: pointer; transition: all .12s;
  border-right: 2px solid transparent;
  position: relative;
}
.sidebar-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar-item.active {
  color: var(--accent);
  background: var(--active-bg);
  border-right-color: var(--accent);
  font-weight: 600;
}
.sidebar-item .premium-dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--premium); border-radius: 50%;
  margin-left: 6px; vertical-align: middle;
}

/* --- Overlay (mobile) --- */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 899;
}
.sidebar-overlay.visible { display: block; }

/* --- Main content area --- */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--navbar-h);
  min-height: 100vh;
}

.content-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 40px 80px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--category-text);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--category-text); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 2px; }

/* --- Page title --- */
.page-title {
  font-size: 32px; margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, #c8d6e5);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc {
  font-size: 16px; color: var(--text-muted); margin-bottom: 32px;
  line-height: 1.7;
}

/* --- Rendered content --- */
.doc-content h2 {
  font-size: 22px; margin: 36px 0 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  position: relative;
}
.doc-content h3 {
  font-size: 18px; margin: 28px 0 10px;
}
.doc-content h2 .anchor-link,
.doc-content h3 .anchor-link {
  opacity: 0; margin-left: 8px; color: var(--accent); font-weight: 400;
  transition: opacity .15s; cursor: pointer; font-size: 0.8em;
}
.doc-content h2:hover .anchor-link,
.doc-content h3:hover .anchor-link { opacity: 1; }

.doc-content p { margin: 0 0 16px; color: var(--text-muted); }
.doc-content strong { color: var(--text); font-weight: 600; }
.doc-content ul, .doc-content ol {
  margin: 0 0 16px; padding-left: 24px; color: var(--text-muted);
}
.doc-content li { margin-bottom: 6px; }
.doc-content li code, .doc-content p code {
  background: var(--code-bg); padding: 2px 7px;
  border-radius: 4px; font-size: 13px; color: #e6edf3;
  font-family: 'Fira Code', 'Consolas', monospace;
}

/* --- Code blocks --- */
.code-block {
  position: relative; background: var(--code-bg);
  border-radius: var(--radius-sm); margin: 0 0 20px;
  border: 1px solid var(--border); overflow: hidden;
}
.code-block pre {
  padding: 16px 20px; overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 13px; line-height: 1.6; color: #e6edf3;
  margin: 0;
}
.code-block .copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px;
  padding: 4px 10px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.code-block .copy-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }

/* --- Command block --- */
.command-block {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px;
  margin: 0 0 16px;
}
.command-block .cmd-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.command-block .cmd-name {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 15px; font-weight: 700; color: var(--accent);
}
.command-block .cmd-premium {
  background: rgba(244,200,76,0.15); color: var(--premium);
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--radius-pill); letter-spacing: 0.3px;
}
.command-block .cmd-syntax {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 13px; color: #e6edf3;
  background: var(--code-bg); padding: 8px 14px;
  border-radius: 6px; margin-bottom: 8px;
  display: block;
}
.command-block .cmd-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }
.command-block .cmd-perm {
  font-size: 12px; color: var(--category-text);
}
.command-block .cmd-perm strong { color: var(--text-muted); }

/* --- Tables --- */
.doc-content table {
  width: 100%; border-collapse: collapse; margin: 0 0 20px;
  font-size: 14px;
}
.doc-content table th {
  text-align: left; padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.doc-content table td {
  padding: 10px 14px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.doc-content table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* --- Callout boxes --- */
.callout {
  border-radius: var(--radius-sm); padding: 16px 20px;
  margin: 0 0 20px; display: flex; gap: 12px;
  border-left: 3px solid;
}
.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout-body { font-size: 14px; color: var(--text-muted); }
.callout-body strong { color: var(--text); }

.callout.info  { background: rgba(47,140,255,0.08); border-color: var(--accent); }
.callout.info .callout-icon { color: var(--accent); }
.callout.tip   { background: rgba(34,197,94,0.08); border-color: #22c55e; }
.callout.tip .callout-icon { color: #22c55e; }
.callout.warn  { background: rgba(250,204,21,0.08); border-color: #facc15; }
.callout.warn .callout-icon { color: #facc15; }
.callout.premium { background: rgba(244,200,76,0.08); border-color: var(--premium); }
.callout.premium .callout-icon { color: var(--premium); }

/* --- TOC (right side) --- */
.toc {
  position: fixed; top: calc(var(--navbar-h) + 32px);
  right: 32px; width: var(--toc-w);
  max-height: calc(100vh - var(--navbar-h) - 64px);
  overflow-y: auto;
}
.toc-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--category-text);
  margin-bottom: 10px;
}
.toc-item {
  display: block; font-size: 13px; color: var(--text-muted);
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border);
  cursor: pointer; transition: all .12s;
}
.toc-item:hover { color: var(--text); }
.toc-item.active { color: var(--accent); border-left-color: var(--accent); }
.toc-item.depth-3 { padding-left: 24px; font-size: 12px; }

/* --- Responsive --- */
@media (max-width: 1400px) {
  .toc { display: none; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content-wrapper { padding: 24px 20px 60px; }
  .hamburger { display: block; }
  .navbar-link { display: none; }
  .page-title { font-size: 26px; }
}

@media (max-width: 480px) {
  .btn-add { padding: 6px 14px; font-size: 13px; }
  .navbar { padding: 0 14px; }
}

/* --- Utility --- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
