/* === Prolog Buzz — Dark Overrides v1 === */
/* Load this AFTER swish-min.css */

/* Theme tokens */
:root {
  --bg-0: #06080C;  /* page background */
  --bg-1: #0b0f14;  /* panels */
  --bg-2: #12161a;  /* headers, subtle stripes */
  --bg-3: #0f1318;  /* editor/console blocks */
  --fg-0: #dddddd;
  --fg-dim: #b8c0cc;
  --brand: #00cc00;
  --brand-strong: #00ff00;
  --line-1: #1c222a;
  --line-2: #223;
}

/* Global base (Bootstrap + SWISH force white) */
html, body { background: var(--bg-0) !important; color: var(--fg-0) !important; }
a { color: #7cff7c !important; }
a:hover, a:focus { color: var(--brand-strong) !important; text-decoration: none; }

/* Layout shells that come in white by default */
#content,
.pane-container,
.pane-wrapper,
.splittable,
div.tabbed,
div.tab-content { background: var(--bg-0) !important; color: var(--fg-0) !important; }

/* Navbar */
nav.navbar, .navbar-default {
  background: #1a1a1a !important; border-bottom: 1px solid var(--line-1) !important;
}
.navbar-brand, .navbar a { color: var(--fg-dim) !important; }
.navbar input[type="text"], .navbar .form-control {
  background: #111 !important; color: #eee !important; border: 1px solid var(--brand) !important;
}
.navbar .form-control:focus { border-color: var(--brand-strong) !important; box-shadow: 0 0 0 2px #00ff0040 !important; }

/* Splitters */
.splitter_panel .vsplitter, .splitter_panel .hsplitter { background: var(--brand) !important; }
.splitter_panel .vsplitter:hover, .splitter_panel .hsplitter:hover { box-shadow: inset 0 0 0 2px #00ff0040; }

/* CodeMirror editor (white by default) */
.CodeMirror { background: var(--bg-3) !important; color: var(--fg-0) !important; }
.cm-s-default .CodeMirror-gutters { background: var(--bg-1) !important; border-right: 1px solid var(--line-2) !important; }
.cm-s-default .CodeMirror-linenumber { color: #7f8b99 !important; }
.CodeMirror-cursor { border-left: 2px solid var(--brand-strong) !important; }
.CodeMirror-selected { background: #00ff0026 !important; }
.cm-searching { background: #00ff0030 !important; }
div.CodeMirror span.CodeMirror-matchingbracket { background: var(--brand-strong) !important; color: #000 !important; }
.CodeMirror-hints { background: var(--bg-1) !important; border: 1px solid var(--brand) !important; }
.CodeMirror-hint { color: var(--fg-0) !important; }
li.CodeMirror-hint-active { background: var(--brand) !important; color: #000 !important; }

/* Docs/Notebook panes */
div.query, div.notebook, div.examples, div.history, div.pengine-history { background: var(--bg-0) !important; color: var(--fg-0) !important; }
div.notebook p, div.notebook li { color: var(--fg-dim) !important; }

/* Inline code & preformatted in docs (Bootstrap sets light) */
code { background: #111 !important; color: #7cff7c !important; border: 1px solid var(--brand) !important; border-radius: 3px; }
pre, .pengine-output pre, pre.console { background: var(--bg-3) !important; color: #eee !important; border: 1px solid var(--line-2) !important; }

/* Runner / output regions (odd/even rows are light) */
div.prolog-runners { background: var(--bg-1) !important; }
div.runner-results { background: var(--bg-1) !important; }
div.answer.even { background: #0e141a !important; }
div.answer.odd  { background: #0b0f14 !important; }
span.prolog-true  { color: #7cff7c !important; }
span.prolog-false { color: #ff6b6b !important; }

/* Tables used for answers/renderers (light by default) */
table.prolog-answers, .render-table, .table {
  background: transparent !important; color: var(--fg-0) !important;
  border-color: var(--line-2) !important;
}
table.prolog-answers td, table.prolog-answers th,
.render-table td, .render-table th,
.table > tbody > tr > td, .table > thead > tr > th { border-color: var(--line-2) !important; }
table.prolog-answers tr:nth-child(odd),
.render-table tr:nth-child(odd) { background: #0e141a !important; }
table.prolog-answers tr:nth-child(2n),
.render-table tr:nth-child(2n) { background: #0b0f14 !important; }

/* Forms & controls */
.form-control, input, select, textarea {
  background: #111 !important; color: #eee !important; border: 1px solid var(--brand) !important;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--brand-strong) !important; box-shadow: 0 0 0 2px #00ff0040 !important; outline: none !important;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }

/* Buttons (including bottom Examples/History/Solutions/Run) */
.btn, .btn-default, .btn-primary, .pengine-buttons .btn, #run-buttons .btn {
  background: #1a1a1a !important; color: #eee !important; border: 1px solid var(--brand) !important;
}
.btn:hover, .btn:focus, .pengine-buttons .btn:hover, #run-buttons .btn:hover {
  background: var(--brand-strong) !important; color: #000 !important; box-shadow: 0 0 6px #00ff0055 !important;
}

/* Dropdowns & menus */
.dropdown-menu { background: #0f1318 !important; border: 1px solid var(--brand) !important; }
.dropdown-menu > li > a { color: #ddd !important; }
.dropdown-menu > li > a:hover, .dropdown-menu > .active > a { background: var(--brand) !important; color: #000 !important; }
/* Submenus had white side borders */
.dropdown-menu .sub-menu { border-left-color: var(--line-2) !important; }

/* Panels/cards/wells */
.panel, .well, .card { background: var(--bg-1) !important; color: var(--fg-0) !important; border: 1px solid var(--line-2) !important; }
.panel-heading, .panel-footer { background: var(--bg-2) !important; border-color: var(--line-2) !important; }

/* Tooltips/Popovers/Dialogs */
.tooltip-inner, .popover { background: #0f1318 !important; color: var(--fg-0) !important; border: 1px solid var(--line-2) !important; }
div.CodeMirror-dialog { background: var(--bg-1) !important; border: 1px solid var(--line-2) !important; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-track { background: #111; }
html { scrollbar-color: #333 #111; scrollbar-width: thin; }

/* Focus ring & selection */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: #00ff0033; }
