﻿/*
 * Chat messages, history, memory, and related conversation surfaces.
 * Extracted from public/styles.css lines 983-1221.
 */

/* =========================
   CHAT MESSAGES
========================= */

.msg {
  display: flex;
  margin: 10px 0;
}

.msg.user {
  justify-content: flex-end;
}

.msg.assistant {
  justify-content: flex-start;
}

.bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 70%;
  font-size: 14px;
  line-height: 1.4;
}

.bubble.user {
  background: #1e3a5f;
  color: #e5e7eb;
}

.bubble.assistant {
  background: #1f2937;
  color: #e5e7eb;
}

.bubble.user .history-label     { color: #93c5fd; }
.bubble.assistant .history-label { color: #86efac; }

.typing-indicator {
  color: #6b7280;
  font-style: italic;
  animation: typing-pulse 1.4s ease-in-out infinite;
}

@keyframes typing-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 1;    }
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: #111;
}

/* =========================
   HISTORY
========================= */

.history-item {
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 80%;
  margin-bottom: 10px;
}

.history-item.user {
  background: #1e3a5f;
  align-self: flex-end;
}

.history-item.assistant {
  background: #1f2937;
  align-self: flex-start;
}

/* meta row: label Â· time Â· delete */
.history-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.history-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.history-item.user .history-label {
  color: #93c5fd;
}

.history-item.assistant .history-label {
  color: #86efac;
}

.history-time {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-right: auto;
}

.history-meta .danger {
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 13px;
  padding: 0;
}

.history-item:hover .history-meta .danger {
  opacity: 0.6;
}

.history-item:hover .history-meta .danger:hover {
  opacity: 1;
}

.history-content {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #e5e7eb;
}

.history-content.streaming-content:empty::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1em;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  vertical-align: -0.12em;
  animation: typing-pulse 1.2s ease-in-out infinite;
}

/* =========================
   MEMORY UI
========================= */

.memory-block {
  margin-bottom: 28px;
  overflow: visible;
}

.memory-block h3 {
  margin-bottom: 12px;
  color: #8ab4f8;
}

.memory-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  background: #161a22;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 6px 10px;
  transition: all 0.2s ease;
}

.memory-item:hover {
  border-color: #3b82f6;
  background: #1c2230;
}

.mem-text {
  flex: 1;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 14px;
  padding: 2px 0;
}

.mem-text:focus {
  outline: none;
}

.mem-score {
  width: 60px;
  text-align: center;
  background: #1e293b;
  border: none;
  color: #93c5fd;
  font-size: 13px;
  padding: 2px;
}

.btn-danger {
  background: transparent;
  border: 1px solid #7f1d1d;
  color: #f87171;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  opacity: 1;
}

.key-status {
  font-size: 11px;
  margin-left: 6px;
  font-weight: normal;
}

.key-connected { color: #4ade80; }
.key-missing   { color: #6b7280; }

.danger {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.danger:hover {
  opacity: 1;
  transform: scale(1.1);
}

.empty {
  color: #666;
  font-size: 13px;
  padding: 8px 0;
}

