/*
 * markdown.css - Estilos para Markdown Renderizado
 * ==================================================
 * PORQUÊ: O agente Athena (via N8N) retorna respostas formatadas
 * em markdown - especialmente tabelas do BigQuery. Estes estilos
 * garantem que o output fica premium dentro das bubbles de chat.
 */

/* ── Tabelas ── */
.md-table-wrap {
 overflow-x: auto;
 margin: 8px 0;
 border-radius: 8px;
}

.md-table {
 border-collapse: collapse;
 width: 100%;
 font-size: 13px;
 line-height: 1.5;
}

.md-table th {
 background: rgba(196, 30, 30, 0.12);
 color: var(--red);
 padding: 8px 12px;
 border-bottom: 2px solid rgba(196, 30, 30, 0.25);
 text-align: left;
 font-weight: 600;
 text-transform: uppercase;
 font-size: 11px;
 letter-spacing: 0.05em;
 white-space: nowrap;
}

.md-table td {
 padding: 6px 12px;
 border-bottom: 1px solid var(--border);
 color: var(--muted-light);
}

.md-table tr:hover td {
 background: rgba(196, 30, 30, 0.04);
}

.md-table tr:last-child td {
 border-bottom: none;
}

/* ── Code ── */
.md-code {
 background: rgba(196, 30, 30, 0.08);
 color: var(--red);
 padding: 2px 6px;
 border-radius: 4px;
 font-size: 0.88em;
 font-family: 'Consolas', 'Monaco', monospace;
}

.md-code-block {
 background: #0a0a0a;
 border: 1px solid var(--border);
 border-radius: 8px;
 padding: 12px 16px;
 overflow-x: auto;
 margin: 8px 0;
 font-size: 13px;
 line-height: 1.6;
 font-family: 'Consolas', 'Monaco', monospace;
 color: var(--muted-light);
}

html.light .md-code-block {
 background: #f5f5f5;
 border-color: #ddd;
}

/* ── Headings ── */
.md-h1, .md-h2, .md-h3 {
 color: var(--white);
 font-family: 'Montserrat', sans-serif;
 margin: 10px 0 6px;
 line-height: 1.3;
}

.md-h1 { font-size: 18px; }
.md-h2 { font-size: 16px; }
.md-h3 { font-size: 14px; color: var(--red); }

/* ── Lists ── */
.md-list {
 padding-left: 20px;
 margin: 6px 0;
}

.md-list li {
 margin-bottom: 4px;
 line-height: 1.6;
}

/* ── Blockquotes ── */
.md-quote {
 border-left: 3px solid var(--red);
 padding-left: 12px;
 margin: 8px 0;
 color: var(--muted-light);
 font-style: italic;
 opacity: 0.85;
}

/* ── Paragraphs ── */
.md-p {
 margin: 2px 0;
 line-height: 1.72;
}

/* ── Bold/Italic inside bubbles ── */
.msg-bubble.athena strong {
 color: var(--white);
 font-weight: 600;
}

.msg-bubble.athena em {
 color: #c8b89a;
}

/* ── Links & Browser Auto-linking escapes ── */
.msg-bubble a {
 color: var(--red);
 text-decoration: underline;
 text-underline-offset: 3px;
}

.md-table a {
 color: inherit !important;
 text-decoration: none !important;
 cursor: text;
 pointer-events: none;
}
