/* ═══════════════════════════════════════════════════════════
   MESSAGES AREA
   ═══════════════════════════════════════════════════════════ */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scroll-behavior: smooth;
}

.messages-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 24px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.empty-wolf {
  font-size: 56px;
  margin-bottom: 16px;
  animation: wolfBounce 2s ease infinite;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
  max-width: 400px;
}

.suggested-prompts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 520px;
  width: 100%;
}

.suggested-prompt {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.suggested-prompt:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim-border);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.suggested-prompt .prompt-icon {
  font-size: 18px;
  display: block;
  margin-bottom: 6px;
}

/* Message Bubbles */
.message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: messageSlideIn 0.3s ease;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.message.assistant .message-avatar {
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim-border);
}

.message.user .message-avatar {
  background: #2563eb22;
  border: 1px solid #2563eb44;
  font-size: 14px;
}

.message-content {
  max-width: 75%;
  min-width: 60px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message.user .message-bubble {
  background: var(--bg-bubble-user);
  border: 1px solid rgba(33, 194, 94, 0.15);
  border-top-right-radius: 4px;
  color: var(--text-primary);
}

.message.assistant .message-bubble {
  background: var(--bg-bubble-assistant);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

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

.message.user .message-time {
  text-align: right;
}

/* Markdown Styles inside bubbles */
.message-bubble p { margin-bottom: 10px; }
.message-bubble p:last-child { margin-bottom: 0; }

.message-bubble strong { font-weight: 600; color: var(--text-primary); }
.message-bubble em { font-style: italic; }
.message-bubble a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}
.message-bubble a:hover { border-bottom-color: var(--accent); }

.message-bubble ul, .message-bubble ol {
  margin: 8px 0;
  padding-left: 20px;
}
.message-bubble li { margin-bottom: 4px; }

.message-bubble blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 10px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.message-bubble table {
  border-collapse: collapse;
  margin: 10px 0;
  width: 100%;
  font-size: 13px;
}

.message-bubble th, .message-bubble td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.message-bubble th {
  background: var(--bg-input);
  font-weight: 600;
  color: var(--text-primary);
}

.message-bubble td {
  color: var(--text-secondary);
}

/* Inline code */
.message-bubble code:not(pre code) {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: #f0abfc;
}

/* Code blocks */
.code-block-wrapper {
  position: relative;
  margin: 10px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1117;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: inherit;
}

.code-block-header .lang-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-copy-code {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
}

.btn-copy-code.copied {
  color: var(--accent);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
}

.code-block-wrapper pre code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
}

/* Tool Calls */
.tool-call-card {
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tool);
}

/* Think card — inline reasoning */
.think-card {
  margin: 8px 0;
  padding: 12px 16px;
  border: 1.5px dashed #c084fc;
  border-radius: 8px;
  background: rgba(192, 132, 252, 0.04);
  font-size: 13px;
  line-height: 1.6;
}

.think-label {
  font-size: 11px;
  font-weight: 600;
  color: #c084fc;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-style: italic;
}

.think-content {
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font-style: italic;
}

/* Tool result header (label + copy btn) */
.tool-call-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 4px;
}

.tool-copy-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-copy-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.tool-result-pre {
  max-height: 300px;
  overflow-y: auto;
}

.tool-show-more-btn {
  display: block;
  margin-top: 6px;
  background: none;
  border: 1px solid;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all var(--transition-fast);
}

.tool-show-more-btn:hover {
  background: rgba(255,255,255,0.05);
}

.tool-call-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  font-size: 13px;
}

.tool-call-header:hover {
  background: rgba(255,255,255,0.03);
}

.tool-call-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.tool-call-card.expanded .tool-call-chevron {
  transform: rotate(90deg);
}

.tool-call-icon {
  font-size: 14px;
}

.tool-call-name {
  font-weight: 600;
  color: #c084fc;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}

.tool-call-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.tool-call-status.running {
  color: #fbbf24;
}

.tool-call-status.done {
  color: var(--accent);
}

.tool-call-body {
  font-size: 12px;
}

.tool-call-card.expanded .tool-call-body {
  /* see enhanced CSS in animations.css */
}

.tool-call-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 8px;
}

.tool-call-section-label:first-child {
  margin-top: 0;
}

.tool-call-body pre {
  background: rgba(0,0,0,0.3);
  padding: 8px 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.5;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: messageSlideIn 0.3s ease;
  align-items: flex-start;
}

.typing-indicator .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim-border);
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  background: var(--bg-bubble-assistant);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════
   QUESTION CARD (interactive tool)
   ═══════════════════════════════════════════════════════════ */
.question-card {
  margin: 10px 0;
  padding: 14px 16px;
  border: 1px solid rgba(251,191,36,0.35);
  border-left: 3px solid #fbbf24;
  border-radius: var(--radius-sm);
  background: rgba(251,191,36,0.06);
  animation: messageSlideIn 0.3s ease;
}
.question-card .q-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.question-card .q-options { display: flex; flex-wrap: wrap; gap: 8px; }
.question-card .q-opt-btn {
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.question-card .q-opt-btn:hover {
  border-color: #fbbf24;
  color: var(--text-primary);
  background: rgba(251,191,36,0.1);
}
.question-card .q-free { display: flex; gap: 8px; margin-top: 4px; }
.question-card .q-free input {
  flex: 1; padding: 8px 12px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px;
}
.question-card .q-free input:focus { outline: none; border-color: #fbbf24; }
.question-card .q-free button {
  padding: 8px 14px; background: #fbbf24; color: #000; border: none;
  border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--transition-fast);
}
.question-card .q-free button:hover { background: #f59e0b; }
.question-card.answered {
  opacity: 0.7; pointer-events: none;
  border-color: var(--border); background: var(--bg-tool);
}
.question-card .q-answer {
  margin-top: 8px; font-size: 13px; color: var(--accent); font-weight: 500;
}
