/* ============================================================
   BattlEye Filters Guide — stylesheet
   dze.armatools.com/guides/battleye-filters
   ============================================================ */
:root {
  --bg:          #0d0d0d;
  --bg-panel:    #111111;
  --bg-card:     #1c1c1c;
  --bg-card2:    #222222;
  --border:      #2a2a2a;
  --accent:      #4e8a2e;
  --accent-hi:   #62ae3a;
  --accent-dim:  #2e5018;
  --text:        #d0d0d0;
  --text-muted:  #5e5e5e;
  --text-hi:     #eaeaea;
  --danger:      #8b1a1a;
  --danger-hi:   #c0392b;
  --warning-bg:  #1a1400;
  --warning-bd:  #4a3800;
  --warning-txt: #c8a832;
  --tip-bg:      #0e1a09;
  --tip-bd:      #2a4010;
  --tip-txt:     #9abf7a;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,.55);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:        'Consolas', 'Courier New', monospace;
  --max-w:       min(900px, 96vw);
}

/* ============================================================
   LIGHT MODE OVERRIDES
   ============================================================ */
[data-theme="light"] {
  --bg:          #f5f5f4;
  --bg-panel:    #ececea;
  --bg-card:     #ffffff;
  --bg-card2:    #f0f0ee;
  --border:      #cccccc;
  --accent:      #3d7020;
  --accent-hi:   #2e5818;
  --accent-dim:  #cce4b0;
  --text:        #222222;
  --text-muted:  #666666;
  --text-hi:     #111111;
  --warning-bg:  #fffce0;
  --warning-bd:  #d4c060;
  --warning-txt: #7a5a00;
  --tip-bg:      #e8f4de;
  --tip-bd:      #a0c880;
  --tip-txt:     #2e6010;
  --shadow:      0 2px 12px rgba(0,0,0,.10);
}

[data-theme="light"] code {
  background: #eef4e8;
  border-color: #b8d898;
  color: #2e6010;
}

[data-theme="light"] .tool-header {
  background: #e8f2de;
  border-bottom-color: #b8d4a0;
}

[data-theme="light"] .callout-danger {
  background: #fff0f0;
  border-color: #e0a0a0;
  color: #8b2020;
}

[data-theme="light"] .security-section {
  border-color: #e0a0a0;
  background: #fff4f4;
}

[data-theme="light"] .block-code {
  background: #eef4e8;
  color: #2e6010;
}

[data-theme="light"] .code-block {
  background: #f0f4ec;
  color: #2e6010;
}

[data-theme="light"] .port-table tr:hover td { background: #f0f0ee; }

[data-theme="light"] .guide-credit {
  background: #e8f4de;
  border-color: #a0c880;
}

[data-theme="light"] summary.filter-entry-header { background: #f0f0ee; }
[data-theme="light"] summary.filter-entry-header:hover { background: #e4eede; }
[data-theme="light"] details.filter-entry { border-color: #cccccc; }
[data-theme="light"] details.filter-entry[open] summary.filter-entry-header { border-bottom-color: #cccccc; }
[data-theme="light"] .filter-entry-body { background: #ffffff; }
[data-theme="light"] dl.filter-meta dt { color: #888; }
[data-theme="light"] dl.filter-meta dd { color: #333; }
[data-theme="light"] .be-note { color: #666; border-top-color: #e0e0de; }

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: var(--text-hi); text-decoration: underline; }
code {
  font-family: var(--mono);
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: .875em;
  color: #98d66e;
}

/* ============================================================
   SITE NAV
   ============================================================ */
.site-nav {
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-hi);
  text-decoration: none;
}
.site-brand:hover { color: var(--accent-hi); }
.site-brand-icon { font-size: 1.25rem; }
.site-brand-dim { color: var(--text-muted); font-weight: 400; }
.site-nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--accent-hi);
  border-bottom-color: var(--accent);
}

/* ============================================================
   TOOL HEADER
   ============================================================ */
.tool-header {
  background: linear-gradient(160deg, #0e1a09 0%, #0d0d0d 60%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
}
.tool-header-inner {
  max-width: min(960px, 96vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.tool-header-title { display: flex; align-items: center; gap: 1rem; }
.tool-header-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--accent));
}
.tool-header-title h1 { font-size: 1.4rem; font-weight: 800; color: var(--text-hi); }
.tool-header-sub { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.tool-header-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-hi);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: .35rem .85rem;
  transition: background .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.tool-header-link:hover { background: var(--accent-dim); color: var(--text-hi); text-decoration: none; }

/* ============================================================
   MAIN
   ============================================================ */
main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ============================================================
   CALLOUTS
   ============================================================ */
.callout {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: .875rem;
  line-height: 1.6;
}
.callout-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-bd);
  color: var(--warning-txt);
}
.callout-warning a { color: #d4a840; text-decoration: underline; }
.callout-danger {
  background: #1a0a0a;
  border: 1px solid #4a1010;
  color: #d08080;
}
.callout-tip {
  background: var(--tip-bg);
  border: 1px solid var(--tip-bd);
  color: var(--tip-txt);
}
.callout-tip a { color: var(--accent-hi); text-decoration: underline; }
.callout-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: .05rem; }
.callout-body { flex: 1; min-width: 0; }
.callout-body strong { color: inherit; }
.callout ul { padding-left: 1.25rem; margin-top: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.callout li::marker { color: currentColor; }

.inline-callout { margin-top: .75rem; }

/* ============================================================
   GUIDE SECTIONS
   ============================================================ */
.guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.security-section {
  border-color: #4a1010;
  background: #130a0a;
}
.guide-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-hi);
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   LISTS
   ============================================================ */
.guide-list {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.guide-list li::marker { color: var(--accent); }

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.block-code {
  display: block;
  font-family: var(--mono);
  font-size: .82rem;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .85rem;
  color: #98d66e;
  margin-top: .5rem;
  word-break: break-all;
}
.code-block {
  font-family: var(--mono);
  font-size: .82rem;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  color: #98d66e;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.7;
}

/* ============================================================
   TABLE (action codes, rate limits)
   ============================================================ */
.port-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.port-table th {
  background: var(--bg-card2);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: .4rem .75rem;
  border: 1px solid var(--border);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.port-table td {
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.port-table tbody td:first-child { font-family: var(--mono); }
.port-table tr:hover td { background: #181818; }

/* ============================================================
   PROSE
   ============================================================ */
.guide-prose {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.guide-credit {
  font-size: .8rem;
  color: var(--text-muted);
  padding: .6rem 1rem;
  border: 1px solid #1e2a10;
  border-radius: var(--radius);
  background: #111a09;
  text-align: center;
}
.guide-credit a { color: var(--accent-hi); text-decoration: underline; }

/* ============================================================
   FILTER ACCORDION
   ============================================================ */
.filter-accordion {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

details.filter-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

summary.filter-entry-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  background: var(--bg-card2);
  cursor: pointer;
  list-style: none;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-hi);
  user-select: none;
  transition: background .15s;
}
summary.filter-entry-header::-webkit-details-marker { display: none; }
summary.filter-entry-header::marker { display: none; }
summary.filter-entry-header:hover { background: #2a3a1a; }

details.filter-entry[open] > summary.filter-entry-header {
  border-bottom: 1px solid var(--border);
}

.filter-entry-filename {
  font-family: var(--mono);
  color: var(--accent-hi);
  font-size: .85rem;
}
.filter-entry-caret {
  margin-left: auto;
  font-size: .65em;
  opacity: .6;
  transition: transform .15s;
  display: inline-block;
  flex-shrink: 0;
}
details.filter-entry[open] .filter-entry-caret { transform: rotate(180deg); }

.filter-entry-body {
  padding: .85rem 1rem;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

dl.filter-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem .85rem;
  font-size: .82rem;
}
dl.filter-meta dt {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .72em;
  letter-spacing: .05em;
  padding-top: .15rem;
  white-space: nowrap;
}
dl.filter-meta dd {
  color: var(--text);
  line-height: 1.6;
}
dl.filter-meta dd code { font-size: .9em; }

.be-note {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: .6rem;
  font-style: italic;
}
.be-note code { font-style: normal; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .tool-header-inner { flex-direction: column; align-items: flex-start; }
  .code-block { font-size: .75rem; }
  .port-table { font-size: .75rem; }
  dl.filter-meta { grid-template-columns: 1fr; gap: .1rem; }
  dl.filter-meta dt { padding-top: .5rem; }
}
