/* BungeeWeb Logs: "modern console" look. Dark by default, light if the OS asks. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-latin-wght-normal.a147f99cd533.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-latin-ext-wght-normal.4841e590e2a9.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-mono-latin-wght-normal.a15f9d568fb0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-mono-latin-ext-wght-normal.693cf932fe6b.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0e1015;
  --surface: #151821;
  --surface-2: #1f2533;
  --panel: #0a0c10;
  --border: #1d212b;
  --border-strong: #2c3240;
  --text: #e4e7ee;
  --muted: #8a93a6;
  --faint: #6e7789;
  --accent: #9db4ff;
  --accent-text: #0e1015;
  --row-line: #14171e;
  --row-hover: #151b29;
  --focus-row: #2a2614;
  --mark: #4a3d12;
  --live: #7ee2a8;
  --live-bg: #12261b;
  --live-border: #1f5137;
  --chat: #9db4ff;
  --command: #f0b65e;
  --command-text: #f3d9ad;
  --join: #7ee2a8;
  --quit: #8a93a6;
  --kick: #ff7b7b;
  --kick-row: #22131a;
  --switch: #c49bff;
  --danger: #ff7b7b;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f3;
    --surface: #ffffff;
    --surface-2: #eef0f5;
    --panel: #ffffff;
    --border: #e4e4df;
    --border-strong: #d4d5d0;
    --text: #1b1c20;
    --muted: #5d6070;
    --faint: #737684;
    --accent: #2f5bd3;
    --accent-text: #ffffff;
    --row-line: #f0f0ec;
    --row-hover: #f1f4fb;
    --focus-row: #fff4cc;
    --mark: #ffe58a;
    --live: #157a43;
    --live-bg: #e3f4ea;
    --live-border: #a8d8bb;
    --chat: #2f5bd3;
    --command: #9a5600;
    --command-text: #6e3d00;
    --join: #157a43;
    --quit: #5d6070;
    --kick: #b42323;
    --kick-row: #fdf0f0;
    --switch: #6b35b8;
    --danger: #b42323;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.grow { flex-grow: 1; }
.muted { color: var(--muted); }

/* ---- buttons & inputs ---- */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.button:hover { text-decoration: none; }
.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.ghost:hover { background: var(--surface-2); }
.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.discord { background: #5865f2; border-color: #5865f2; color: #fff; }

input[type="text"], input[type="datetime-local"] {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- top bar ---- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand svg { color: var(--accent); }
.brand:hover { text-decoration: none; }
.user { display: flex; align-items: center; gap: 16px; }
.user form { margin: 0; }
.me { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.me img, .avatar { width: 28px; height: 28px; border-radius: 50%; }
.avatar { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); font-weight: 600; }

.searchbar {
  flex: 1 1 420px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px 8px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--muted);
}
.searchbar:focus-within { border-color: var(--accent); }
.searchbar input {
  flex: 1 1 200px;
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  outline: none;
}
.searchbar input:focus-visible { outline: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 4px 2px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}
.chip .key { color: var(--muted); }
.chip a { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; color: var(--muted); font-size: 16px; }
.chip a:hover { background: var(--border-strong); color: var(--text); text-decoration: none; }
kbd {
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font: 12px var(--mono);
  color: var(--muted);
}

.flashes { padding: 12px 20px 0; }
.flash { margin: 0 0 8px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.flash.error, .flash.warning { border-color: var(--danger); }

/* ---- app shell: sidebar + main ---- */

body.app { display: flex; flex-direction: column; height: 100vh; }
.shell { flex: 1; display: flex; min-height: 0; }

.sidebar {
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  font-size: 13px;
}
.sidebar form { display: flex; flex-direction: column; gap: 22px; }
.sidebar section { display: flex; flex-direction: column; gap: 6px; }
.sidebar h2 { margin: 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.segmented { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 3px; background: var(--surface); border-radius: 8px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 30px; border-radius: 6px; color: var(--muted); }
.segmented input:checked + span,
.segmented:not(:has(input:checked)) label:first-child span { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.custom-range summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.custom-range label { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; color: var(--muted); }

.check { display: flex; align-items: center; gap: 10px; min-height: 30px; cursor: pointer; }
.check input { accent-color: var(--accent); margin: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); }
.toggle input:checked + span { color: var(--tc, var(--accent)); border-color: var(--tc, var(--accent)); background: var(--surface); font-weight: 600; }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.filters-toggle > summary { display: none; }
.filters-toggle { display: flex; flex-direction: column; }
.access { margin: auto 0 0; padding: 12px; background: var(--surface); border-radius: 10px; color: var(--muted); font-size: 12px; }
.access strong { color: var(--text); font-weight: 500; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.main.single { height: calc(100vh - 63px); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status { color: var(--muted); font-size: 13px; }
.status strong { color: var(--text); font-weight: 500; }

.live { background: var(--surface); color: var(--muted); border-color: var(--border-strong); border-radius: 999px; font-weight: 600; min-height: 34px; }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live[aria-pressed="true"] { background: var(--live-bg); color: var(--live); border-color: var(--live-border); }
.live[aria-pressed="true"] .pulse { background: var(--live); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.new-lines { min-height: 30px; border-radius: 999px; font-size: 13px; }

/* ---- log panel ---- */

.log-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.log { margin: 0; padding: 0; list-style: none; font: 13px/1.5 var(--mono); }
.empty { margin: 0; padding: 32px; text-align: center; color: var(--muted); }
.log:has(.row) + .empty { display: none; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 7.6rem 6.4rem 7rem 9.5rem minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 5px 14px;
  border-bottom: 1px solid var(--row-line);
}
.row:hover, .row:focus-within { background: var(--row-hover); }
.row.t5 { background: var(--kick-row); }
.row.focus { background: var(--focus-row); scroll-margin-top: 35vh; }
.row.new { animation: arrive 2.5s ease-out; }
@keyframes arrive { from { background: var(--live-bg); } }

.time { color: var(--faint); white-space: nowrap; }
.time:hover { color: var(--text); }
.type { font: 600 11px/1.9 "Geist", sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.msg mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* colors per event type (ids as BungeeWeb stores them) */
.t1 { --tc: var(--chat); }
.t2 { --tc: var(--command); }
.t3 { --tc: var(--join); }
.t4 { --tc: var(--quit); }
.t5 { --tc: var(--kick); }
.t6 { --tc: var(--switch); }
.row .type { color: var(--tc, var(--muted)); }
.row.t1 .msg { color: var(--text); }
.row.t2 .msg { color: var(--command-text); }

.actions {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: none;
  gap: 6px;
  padding-left: 24px;
  background: linear-gradient(to right, transparent, var(--row-hover) 20px);
  font: 12px "Geist", sans-serif;
}
.row:hover .actions, .row:focus-within .actions { display: flex; }
.actions a, .actions button {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.actions a:hover { text-decoration: none; background: var(--border-strong); }

.more { display: flex; justify-content: center; padding: 14px; }

/* ---- simple pages (login etc.) ---- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.narrow { max-width: 420px; margin: 72px auto; }
.card h1 { margin: 0 0 8px; font-size: 22px; }
.card .button { margin-top: 12px; }

/* ---- small screens: sidebar on top, page scrolls normally ---- */

@media (max-width: 860px) {
  body.app { height: auto; }
  .shell { flex-direction: column; }
  .sidebar { flex: none; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .filters-toggle > summary { display: list-item; cursor: pointer; color: var(--muted); font-weight: 600; }
  .filters-toggle[open] > summary { margin-bottom: 12px; }
  .sidebar form { gap: 12px; }
  .sidebar section:nth-of-type(2) { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .sidebar section:nth-of-type(2) h2 { flex-basis: 100%; }
  .access { margin: 0; }
  .main { padding: 12px; }
  .main.single { height: auto; }
  .log-panel { overflow: visible; }
  .row { display: flex; flex-wrap: wrap; gap: 0 10px; }
  .msg { flex-basis: 100%; }
  .row:hover .actions, .row:focus-within .actions { display: none; }
  .me .name, kbd { display: none; }
}
