/* =========================================================
   CHAT SECTION — Container & Layout
   ========================================================= */
.chat-section {
  border: 1px solid rgb(var(--color-grey));
  border-radius: 20px;
  padding: 30px;
  margin-top: 40px;
}
.chat-section__title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}
.chat-section__subtitle {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  margin-top: 4px;
}

/* =========================================================
   CHAT CHIPS — Quick-action buttons
   ========================================================= */
.chat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  font-family: Poppins, sans-serif;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgb(var(--color-blue-primary));
  background: #fff;
  color: rgb(var(--color-blue-primary));
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover {
  background: rgb(var(--color-blue-primary));
  color: #fff;
}
.chip--active {
  background: rgb(var(--color-blue-primary));
  color: #fff;
}
.chip--active:hover {
  background: #fff;
  color: rgb(var(--color-blue-primary));
}

/* =========================================================
   CHAT MESSAGES — Content container
   ========================================================= */
.chat-messages {
  position: relative;
  border: 1px solid rgb(var(--color-grey));
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  overflow-y: auto;
  background: #ffffff;
}
.chat-messages--collapsed {
  max-height: 200px;
}
.chat-messages--expanded {
  max-height: 60vh;
}

/* =========================================================
   CHAT CONTROLS — Expand/collapse, loading, placeholder
   ========================================================= */
.chat-expand-btn {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgb(var(--color-grey));
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  color: #666;
  line-height: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.chat-expand-btn:hover {
  color: rgb(var(--color-blue-primary));
  border-color: rgb(var(--color-blue-primary));
}
.chat-placeholder {
  color: rgb(var(--color-grey-placeholder));
  font-size: 14px;
}
.chat-loading-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  margin-bottom: 16px;
  border: 1px solid rgb(var(--color-grey));
  border-radius: 12px;
  background: #f8f9fa;
  font-size: 14px;
  color: #555;
}
.chat-loading__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgb(var(--color-grey));
  border-top-color: rgb(var(--color-blue-primary));
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* =========================================================
   CHAT BOTTOM ACTION — Start analyse button
   ========================================================= */
.chat-bottom-action {
  display: flex;
  justify-content: flex-end;
}
.chat-notice {
  font-size: 14px;
  color: rgb(var(--color-grey-placeholder));
  margin-top: 8px;
}

/* =========================================================
   PROSE — Markdown content rendering (Claude-stijl)
   Alle styling voor door de LLM gegenereerde content.
   Strak, compact, sans-serif — geïnspireerd op Claude.ai
   ========================================================= */

/* --- Base typography --- */
.prose {
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a18;
  max-width: 720px;
  overflow-wrap: break-word;
}

/* --- Paragraphs --- */
.prose p {
  margin: 0 0 12px 0;
}
.prose p:last-child {
  margin-bottom: 0;
}

/* --- Headers — compact sans-serif, geen kleuraccent --- */
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: 'Poppins', sans-serif;
  color: #1a1a18;
  line-height: 1.3;
}

.prose h1 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 8px;
}
.prose h2 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 8px;
}
.prose h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 6px;
}
.prose h4 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 4px;
}

/* Eerste header: geen extra top-margin */
.prose > h1:first-child,
.prose > h2:first-child,
.prose > h3:first-child,
.prose > h4:first-child {
  margin-top: 0;
}

/* Header direct na header: minimale tussenruimte */
.prose h1 + h2,
.prose h1 + h3,
.prose h2 + h3,
.prose h2 + h4,
.prose h3 + h4 {
  margin-top: 4px;
}

/* --- Lists --- */
.prose ul,
.prose ol {
  margin: 0 0 12px 0;
  padding-left: 24px;
}
.prose li {
  margin-bottom: 4px;
  line-height: 1.6;
}
.prose li:last-child {
  margin-bottom: 0;
}
/* Geneste lijsten */
.prose li ul,
.prose li ol {
  margin-top: 4px;
  margin-bottom: 4px;
}

/* --- Bold & Italic --- */
.prose strong {
  font-weight: 700;
  color: #1a1a18;
}
.prose em {
  font-style: italic;
}

/* --- Links --- */
.prose a {
  color: rgb(var(--color-blue-primary));
  text-decoration: underline;
  text-decoration-color: rgba(var(--color-blue-primary), 0.3);
}
.prose a:hover {
  text-decoration-color: rgb(var(--color-blue-primary));
}

/* --- Horizontal rules — subtiel, meer ademruimte --- */
.prose hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 28px 0;
}

/* --- Tables --- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.prose thead th {
  background: #f5f5f5;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
  font-size: 13px;
  color: #333;
}
.prose tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
/* Zebra striping */
.prose tbody tr:nth-child(even) {
  background: #fafafa;
}
.prose tbody tr:hover {
  background: #f0f4ff;
}

/* --- Blockquotes --- */
.prose blockquote {
  border-left: 3px solid rgb(var(--color-blue-primary));
  margin: 16px 0;
  padding: 10px 18px;
  background: #f8f9fa;
  color: #555;
}
.prose blockquote p {
  margin: 0;
}

/* --- Code (inline) --- */
.prose code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* --- Code blocks --- */
.prose pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.5;
}
.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
