/* Bad Boy Diner(TM) chat -- dark/red diner aesthetic, matches badboydiner.com/assets/style.css tokens */
:root {
  --bg: #0c0c0e;
  --bg-raised: #161618;
  --bg-raised-2: #1d1d20;
  --red: #ff2b3d;
  --red-dim: #b3121f;
  --neon-pink: #ff5ea8;
  --cream: #f6ecd9;
  --muted: #9a9aa0;
  --radius: 10px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chat-shell {
  display: flex;
  height: 100vh;
}

/* --- Channel rail (sidebar) --- */
.channel-rail {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-raised);
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
}

.channel-rail-header {
  font-family: "Arial Black", Impact, sans-serif;
  padding: var(--space-2);
  border-bottom: 1px solid #000;
}
.channel-rail-header span { color: var(--red); }

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-1) 0;
}

.channel-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px var(--space-2);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.channel-item::before { content: "#"; margin-right: 4px; color: var(--muted); }
.channel-item:hover { background: var(--bg-raised-2); color: var(--cream); }
.channel-item.is-active {
  background: var(--bg-raised-2);
  color: var(--cream);
  border-left: 3px solid var(--red);
}

.channel-rail-footer {
  padding: var(--space-2);
  border-top: 1px solid #000;
  font-size: 12px;
}
.channel-rail-footer a { color: var(--neon-pink); text-decoration: none; }
.channel-rail-footer a:hover { text-decoration: underline; }

/* --- Main chat column --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-bottom: 1px solid #000;
  background: var(--bg-raised);
}
.channel-indicator {
  font-family: "Arial Black", Impact, sans-serif;
  color: var(--red);
  font-size: 18px;
}
.channel-sub {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}
.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
  background: var(--bg-raised-2);
  border: 1px solid #000;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.lang-btn.is-active { background: var(--red); color: var(--cream); border-color: var(--red); }

.backend-banner {
  background: var(--red-dim);
  color: var(--cream);
  font-size: 13px;
  padding: 8px var(--space-2);
  text-align: center;
  font-weight: bold;
  letter-spacing: 0.02em;
}

/* --- IRC-style topic line --- */
.topic-line {
  background: var(--bg-raised-2);
  color: var(--muted);
  font-size: 12px;
  padding: 6px var(--space-2);
  border-bottom: 1px solid #000;
}
.topic-line strong { color: var(--neon-pink); }

/* --- Body: message log + nick list, side by side like a classic IRC client --- */
.chat-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}

/* IRC log lines: <nick> message, left-aligned, no bubbles */
.message {
  max-width: 100%;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-system {
  color: var(--muted);
  font-style: italic;
}
.message-user .nick { color: var(--red); font-weight: bold; }
.message-user .nick::before,
.message-agent .nick::before { content: "<"; color: var(--muted); font-weight: normal; }
.message-user .nick::after,
.message-agent .nick::after { content: ">"; color: var(--muted); font-weight: normal; }
.message-user { color: var(--cream); }
.message-agent { color: var(--cream); }
.message-agent.persona-eddie-marsh .nick { color: #ffd27f; font-weight: bold; }
.message-agent.persona-kenji-sato .nick { color: #7fd7ff; font-weight: bold; }
.message-agent.persona-nora-tanaka .nick { color: var(--neon-pink); font-weight: bold; }
.message-command {
  color: var(--muted);
  font-style: italic;
}
.message-command .cmd-echo { color: var(--neon-pink); }
.message-meta {
  font-size: 10px;
  color: var(--muted);
  margin-left: 6px;
}
.message:hover { background: var(--bg-raised); }

/* --- Nick list (who's in the channel) --- */
.nick-list {
  width: 168px;
  flex-shrink: 0;
  border-left: 1px solid #000;
  background: var(--bg-raised);
  overflow-y: auto;
  font-size: 12px;
}
.nick-list-header {
  padding: var(--space-1) var(--space-2);
  color: var(--muted);
  border-bottom: 1px solid #000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.nick-list ul { list-style: none; margin: 0; padding: 4px 0; }
.nick-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px var(--space-2);
  cursor: default;
}
.nick-list .presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nick-list .presence-dot.is-here { background: #55e07a; }
.nick-list .presence-dot.is-away { background: var(--muted); }
.nick-list .nick-name { color: var(--cream); font-weight: bold; }
.nick-list .nick-role { display: block; color: var(--muted); font-size: 10px; }
.nick-list li.persona-eddie-marsh .nick-name { color: #ffd27f; }
.nick-list li.persona-kenji-sato .nick-name { color: #7fd7ff; }
.nick-list li.persona-nora-tanaka .nick-name { color: var(--neon-pink); }
.nick-list li.persona-you .nick-name { color: var(--red); }

.composer {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border-top: 1px solid #000;
  background: var(--bg-raised);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.composer-prompt {
  color: var(--neon-pink);
  font-weight: bold;
  font-size: 15px;
}
.composer input {
  flex: 1;
  background: var(--bg);
  border: 1px solid #000;
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--cream);
  font-size: 13px;
  font-family: inherit;
}
.composer input:focus { outline: 2px solid var(--red); }
.composer button {
  background: var(--red);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  padding: 0 20px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}
.composer button:hover { background: var(--red-dim); }

@media (max-width: 640px) {
  .channel-rail { width: 72px; }
  .channel-rail-header { font-size: 11px; padding: var(--space-1); }
  .channel-item span { display: none; }
  .chat-header { flex-wrap: wrap; }
  .nick-list { display: none; }
}
