/* ============================================================
   NjConsole Docs — Dark Theme
   Colors matched to the NjConsole in-game UI
   ============================================================ */

:root {
  --bg:           #1a1b22;   /* main window bg */
  --bg-panel:     #22232e;   /* panel / card bg */
  --bg-raised:    #282935;   /* buttons, hover rows */
  --bg-code:      #15161e;   /* terminal / code bg */
  --sidebar-bg:   #15161d;   /* sidebar — slightly darker than panels */
  --sidebar-w:    260px;

  --border:       #2e2f3a;
  --border-light: #3a3b4a;

  --text:         #b8bac8;   /* normal log text */
  --text-dim:     #62647a;   /* dimmed labels */
  --text-head:    #dddff0;
  --text-white:   #f0f1f8;

  --accent:       #8b75d7;   /* purple — Channels tab colour */
  --accent-dim:   rgba(139,117,215,0.13);
  --accent-hover: #a08de0;

  --warn:         #e8883a;   /* orange — warning logs in console */
  --error:        #d95858;   /* red — error logs in console */
  --info:         #6b9fd4;   /* muted blue — info */

  --radius:       6px;
  --radius-lg:    10px;
  --mono:         'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

/* ============================================================
   Layout
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  z-index: 100;
}

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

.sidebar-header {
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}
.logo:hover { text-decoration: none !important; }

.logo-icon {
  font-size: 26px;
  line-height: 1;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 6px 8px;
}

.logo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 14px 18px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none !important;
  border-left: 2px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  line-height: 1.4;
}

.nav-link:hover {
  background: var(--bg-raised);
  color: var(--text-white);
  text-decoration: none !important;
  border-left-color: var(--border-light);
}

.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-link.external .nav-icon::after {
  content: '';
}

.nav-icon {
  font-size: 14px;
  line-height: 1;
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.version-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(139,117,215,0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--mono);
}

.made-by {
  font-size: 11px;
  color: var(--text-dim);
}

/* ---- Mobile header (hidden on desktop) ---- */
.mobile-header {
  display: none;
}

/* ---- Content area ---- */
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-inner {
  flex: 1;
  padding: 44px 52px 52px;
  max-width: 860px;
  width: 100%;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-head);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: 2rem;
  margin-top: 2.5em;
}

.content-inner > h1:first-child {
  margin-top: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-white);
}

h2 {
  font-size: 1.4rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-top: 2.4em;
}

h3 { font-size: 1.15rem; }

h4 { font-size: 1rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

p { margin: 0 0 1em; }

ul, ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}

li { margin-bottom: 0.3em; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

strong { color: var(--text-white); font-weight: 600; }

/* ============================================================
   Code
   ============================================================ */
code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--bg-raised);
  color: #c9bff5;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 1.2em 0;
  position: relative;
  max-width: 100%;
  word-wrap: normal;
}


pre code {
  font-size: 0.875em;
  background: none;
  color: var(--text);
  padding: 0;
  border: none;
  border-radius: 0;
  line-height: 1.65;
}

/* Highlight.js overrides */
.hljs {
  background: var(--bg-code) !important;
  color: var(--text) !important;
}

/* ============================================================
   Blockquote (used for tips/notes)
   ============================================================ */
blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  background: var(--bg-panel);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}

blockquote > p {
  margin: 0;
  padding: 3px 0;
}

blockquote strong { color: var(--accent); }

/* ============================================================
   Tables
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.92em;
}

th {
  background: var(--bg-raised);
  color: var(--text-white);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  font-size: 0.88em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}

tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:hover td { background: var(--bg-raised); }

/* ============================================================
   Images
   ============================================================ */
img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: block;
  margin: 1.2em 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ============================================================
   Log-level colors (for inline badges / styled spans)
   ============================================================ */
.log-debug  { color: var(--text-dim); }
.log-info   { color: var(--info); }
.log-warn   { color: var(--warn); }
.log-error  { color: var(--error); }

/* ============================================================
   Page footer
   ============================================================ */
.page-footer {
  padding: 18px 52px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  align-items: center;
}

.page-footer a { color: var(--text-dim); }
.page-footer a:hover { color: var(--accent); }
.page-footer .sep { opacity: 0.4; }

/* ============================================================
   TOC — On this page
   ============================================================ */
.toc-container {
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 4px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
}

.toc-link {
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 4px 18px;
  text-decoration: none !important;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-link:hover {
  color: var(--text);
  text-decoration: none !important;
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-h2 { padding-left: 18px; }
.toc-h3 { padding-left: 30px; font-size: 12px; }

/* ============================================================
   Responsive / Mobile
   ============================================================ */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .content {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }

  .content-inner {
    max-width: 100%;
    overflow-x: hidden;
  }

  pre {
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    transition: left 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 99;
  }

  .menu-toggle {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    line-height: 1;
  }

  .mobile-logo {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-white);
    text-decoration: none;
  }

  .content-inner {
    padding: 24px 20px 40px;
  }

  .page-footer {
    padding: 16px 20px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
}
