Newer
Older
navi-1 / client / style.css
@Eugene Sukhodolskiy Eugene Sukhodolskiy on 8 Apr 7 KB Add web chat client
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 260px;
  --bg: #f0f2f5;
  --sidebar-bg: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-muted: #777;
  --accent: #0066ff;
  --accent-hover: #0052cc;
  --user-bubble: #0066ff;
  --user-text: #ffffff;
  --bot-bubble: #ffffff;
  --bot-text: #1a1a1a;
  --tool-bg: #fffbe6;
  --tool-border: #ffe58f;
  --tool-text: #7d6000;
  --error-bg: #fff1f0;
  --error-border: #ffccc7;
  --error-text: #a8071a;
  --input-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

/* ── Layout ─────────────────────────────────────────── */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-header select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.sidebar-header select:focus { border-color: var(--accent); }

.btn-new {
  width: 100%;
  padding: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-new:hover { background: var(--accent-hover); }
.btn-new:disabled { opacity: 0.5; cursor: not-allowed; }

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.session-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  margin-bottom: 2px;
}
.session-item:hover { background: var(--bg); }
.session-item.active { background: #e8f0ff; }
.session-item .s-profile { font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.session-item .s-preview { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item .s-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.empty-sessions { padding: 20px 12px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ── Main chat area ──────────────────────────────────── */

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.chat-header {
  padding: 14px 20px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-header .profile-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Message bubbles ─────────────────────────────────── */

.msg {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; align-items: flex-start; }

.bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  line-height: 1.55;
  box-shadow: var(--shadow);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg.user .bubble { background: var(--user-bubble); color: var(--user-text); border-bottom-right-radius: 3px; }
.msg.assistant .bubble { background: var(--bot-bubble); color: var(--bot-text); border-bottom-left-radius: 3px; }

.msg-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; padding: 0 2px; }

/* Tool call card */
.tool-card {
  align-self: flex-start;
  max-width: 80%;
  background: var(--tool-bg);
  border: 1px solid var(--tool-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--tool-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tool-card .tool-header { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.tool-card .tool-icon { font-size: 14px; }
.tool-card .tool-result { color: var(--text-muted); font-size: 11px; margin-top: 2px; max-height: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card.error { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }

/* Typing indicator */
.typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: var(--bot-bubble);
  border-radius: var(--radius);
  border-bottom-left-radius: 3px;
  box-shadow: var(--shadow);
}
.typing span { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Cursor while streaming */
.cursor::after { content: "▋"; animation: cursor-blink 0.7s step-start infinite; font-size: 0.9em; margin-left: 1px; }
@keyframes cursor-blink { 50% { opacity: 0; } }

/* Error message */
.msg-error {
  align-self: center;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
}

/* Empty state */
.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
}
.empty-chat .icon { font-size: 40px; }
.empty-chat p { font-size: 15px; }

/* ── Input bar ───────────────────────────────────────── */

.input-bar {
  padding: 16px 20px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-bar textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  resize: none;
  min-height: 44px;
  max-height: 180px;
  overflow-y: auto;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.5;
}
.input-bar textarea:focus { border-color: var(--accent); }
.input-bar textarea:disabled { opacity: 0.5; }

.btn-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-send:hover { background: var(--accent-hover); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 99px; }