/* ==========================================================================
   Coding Interview Fight Club — Night Owl theme for mdBook
   Palette: the VS Code "Night Owl" color scheme (Sarah Drasner)
   bg #011627 · fg #d6deeb · blue #82aaff · cyan #7fdbca · purple #c792ea
   orange #f78c6c · yellow #ecc48d · green #addb67 · red #ff5874 · comment #637777
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ---- Force every built-in mdBook theme to be Night Owl (dark only) ---- */
html.light, html.rust, html.coal, html.navy, html.ayu {
  --bg: #011627;
  --fg: #d6deeb;
  --sidebar-bg: #01111d;
  --sidebar-fg: #7e93a8;
  --sidebar-active: #e0e9f2;
  --sidebar-spacer: #1d3b53;
  --scrollbar: #1d3b53;
  --icons: #5f7e97;
  --icons-hover: #82aaff;
  --link: #82aaff;
  --link-active: #7fdbca;
  --inline-code-color: #7fdbca;
  --theme-popup-bg: #01111d;
  --theme-popup-border: #1d3b53;
  --theme-hover: #0b2942;
  --quote-bg: #0b2942;
  --quote-border: #7fdbca;
  --table-border-color: #1d3b53;
  --table-header-bg: #0b2942;
  --table-alternate-bg: #081f33;
  --searchbar-border-color: #1d3b53;
  --searchbar-bg: #01111d;
  --searchbar-fg: #d6deeb;
  --searchbar-shadow-color: transparent;
  --searchbar-border-radius: 8px;
  --button-hover-bg: #0b2942;
  --button-hover-border: #1d3b53;
  --footer-fg: #5f7e97;
  --code-bg: #0b1d2e;
  --code-fg: #d6deeb;
  --toc-bg: #01111d;
  --toc-border: #1d3b53;
}

/* ---- Typography ---- */
body, .sidebar, .page-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
pre, code, .hljs {
  font-family: 'JetBrains Mono', "SF Mono", Menlo, Consolas, monospace;
}
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { color: #7fdbca; }
h2 { color: #82aaff; border-bottom: 1px solid #1d3b53; padding-bottom: .3em; }
h3 { color: #c792ea; }
h4 { color: #ecc48d; }
a { color: var(--link); }
a:hover { color: var(--link-active); }

/* ---- Code blocks: Night Owl panel ---- */
pre, .hljs {
  background: #0b1d2e !important;
  color: #d6deeb;
  border: 1px solid #16324b;
  border-radius: 8px;
  font-size: 0.82em;
  line-height: 1.55;
}
pre code {
  background: transparent !important;
}
code {
  background: #0b2942;
  border-radius: 4px;
  padding: 0.12em 0.35em;
  font-size: 0.88em;
}

/* ---- Night Owl syntax highlighting (highlight.js classes) ---- */
.hljs-comment, .hljs-quote { color: #637777; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-title { color: #c792ea; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #ecc48d; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: #f78c6c; }
.hljs-built_in, .hljs-builtin-name, .hljs-type, .hljs-class .hljs-title { color: #ffcb8b; }
.hljs-function .hljs-title, .hljs-title.function_ { color: #82aaff; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-params { color: #d6deeb; }
.hljs-name, .hljs-tag, .hljs-selector-pseudo, .hljs-section, .hljs-meta { color: #7fdbca; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; color: #addb67; }
.hljs-deletion { color: #ff5874; }

/* ---- Language tabs ---- */
.code-tabs {
  margin: 1.2em 0;
  border: 1px solid #16324b;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1d2e;
}
.code-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px 0;
  background: #01111d;
  border-bottom: 1px solid #16324b;
}
.code-tab-btn {
  background: transparent;
  color: #5f7e97;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 5px 12px;
  font-size: 0.78em;
  font-weight: 600;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.code-tab-btn:hover { color: #82aaff; background: #0b2942; }
.code-tab-btn.active {
  color: #7fdbca;
  background: #0b1d2e;
  border-color: #16324b;
}
.code-tabs-body pre {
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* ---- Copy button ---- */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  background: #0b2942;
  color: #7fdbca;
  border: 1px solid #1d3b53;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.72em;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
  font-family: 'JetBrains Mono', monospace;
}
.code-block-wrap:hover .copy-btn, .code-tabs:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: #12395c; color: #ecc48d; }
.code-block-wrap { position: relative; }
.code-tabs-body { position: relative; }

/* ---- Tables ---- */
table {
  border-collapse: collapse;
  margin: 1em 0;
}
th { background: var(--table-header-bg); color: #82aaff; font-weight: 600; }
th, td { padding: 8px 14px; border: 1px solid var(--table-border-color); }
tbody tr:nth-child(2n) { background: var(--table-alternate-bg); }

/* ---- Blockquotes: the "coach" voice ---- */
blockquote {
  background: #0b2942;
  border-left: 4px solid #7fdbca;
  border-radius: 0 8px 8px 0;
  padding: 0.6em 1.2em;
  color: #a8c1d9;
}

/* ---- Sidebar polish ---- */
.sidebar .sidebar-scrollbox { padding: 1em 0.6em; }
.sidebar li.chapter-item { line-height: 1.6; }
.sidebar li a { font-size: 0.95em; }
.sidebar li a.active { color: #7fdbca; font-weight: 600; }

/* ---- Content area ---- */
.content main { max-width: 860px; }
.content .header-line { color: #5f7e97; }

/* ---- Callout-ish emphasis for dry runs ---- */
.dryrun {
  background: #081525;
  border: 1px dashed #1d3b53;
  border-radius: 8px;
  padding: 0.8em 1.2em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  white-space: pre;
  overflow-x: auto;
  color: #d6deeb;
  line-height: 1.6;
  margin: 1em 0;
}
