/* ================================================================
   NeuroEvidence.ai — Answer Styled Components
   Post-processed answer rendering: trial headers, stat pills,
   bottom-line cards, section cards, trial chips.
   Primary teal: #00a896
   ================================================================ */

/* ── Evidence Provenance Line ───────────────────────────────── */

.answer-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 1.5rem 0.6rem;
    padding: 0.45rem 0.85rem;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.76rem;
    font-weight: 500;
    color: #4a5568;
    background: #f8f9fc;
    border: 1px solid #e8ecf0;
    border-left: 3px solid #00a896;
    border-radius: 0 6px 6px 0;
    letter-spacing: 0.1px;
}

.answer-meta::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00a896;
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.18);
    flex-shrink: 0;
}

.answer-meta.hidden {
    display: none;
}

@media (max-width: 600px) {
    .answer-meta {
        margin: 0 1rem 0.5rem;
        font-size: 0.72rem;
        padding: 0.35rem 0.7rem;
    }
}

/* ── Trial Name Header Bar ──────────────────────────────────── */

.trial-header {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #008f7f 0%, #00a896 100%);
    color: #ffffff;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 0.5rem 1rem 0.5rem 0.85rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 136, 127, 0.18);
}

.trial-header::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

/* ── Bottom Line Card ───────────────────────────────────────── */

.bottom-line-card {
    background: linear-gradient(135deg, #e6f7f5 0%, #d4f1ed 100%);
    border: 1.5px solid #00a896;
    border-left: 4px solid #00a896;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
    color: #0a1628;
    line-height: 1.65;
}

.bottom-line-card .answer-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #008f7f;
    margin-bottom: 0.4rem;
}

/* ── Section Cards ──────────────────────────────────────────── */

.answer-styled-section {
    margin-bottom: 1.1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 0 8px 8px 0;
    line-height: 1.7;
}

.answer-styled-section .answer-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

/* Green — Key Finding, Supporting Evidence */
.answer-styled-section.section-green {
    border-left: 4px solid #16a34a;
    background: #f0fdf4;
}

.answer-styled-section.section-green .answer-section-label {
    color: #15803d;
}

/* Amber — Critical Caveat, Safety, Warning */
.answer-styled-section.section-amber {
    border-left: 4px solid #e5b94e;
    background: #fef9ec;
}

.answer-styled-section.section-amber .answer-section-label {
    color: #92700c;
}

/* Gray — Limitations, Clinical Caveat */
.answer-styled-section.section-gray {
    border-left: 4px solid #a0aab4;
    background: #f1f3f6;
}

.answer-styled-section.section-gray .answer-section-label {
    color: #4a5568;
}

/* Teal — Who Qualifies, Clinical Takeaway */
.answer-styled-section.section-teal {
    border-left: 4px solid #00a896;
    background: #e6f7f5;
}

.answer-styled-section.section-teal .answer-section-label {
    color: #008f7f;
}

/* ── Stat Pills (Key Numbers) ───────────────────────────────── */

.key-numbers-section {
    margin-bottom: 1.1rem;
    padding: 0.75rem 1.1rem;
    background: #f8f9fc;
    border-left: 4px solid #00a896;
    border-radius: 0 8px 8px 0;
}

.key-numbers-section .answer-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #008f7f;
    margin-bottom: 0.55rem;
}

.stat-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.1rem;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #00a896;
    color: #0a1628;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.80rem;
    font-weight: 600;
    padding: 0.28rem 0.75rem;
    border-radius: 50px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 168, 150, 0.10);
    letter-spacing: 0.1px;
}

/* If not a clean single-item pill, show as a list item instead */
.key-numbers-section ul {
    margin: 0.3rem 0 0 1.1rem;
}

.key-numbers-section li {
    margin-bottom: 0.3rem;
    font-size: 0.88rem;
}

/* ── Trials Referenced Chips ────────────────────────────────── */

.trials-referenced-section {
    margin-bottom: 1.1rem;
    padding: 0.75rem 1.1rem 0.85rem;
    background: #f8f9fc;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
}

.trials-referenced-section .answer-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #4a5568;
    margin-bottom: 0.55rem;
}

.trial-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.trial-chip {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    color: #00a896;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    cursor: default;
    transition: background 0.18s, border-color 0.18s;
    letter-spacing: 0.1px;
}

.trial-chip:hover {
    background: #e6f7f5;
    border-color: #00a896;
}

/* ── Responsive tweaks ──────────────────────────────────────── */

@media (max-width: 600px) {
    .trial-header {
        font-size: 0.88rem;
        padding: 0.45rem 0.85rem 0.45rem 0.7rem;
    }

    .stat-pill {
        font-size: 0.75rem;
        padding: 0.22rem 0.6rem;
    }

    .trial-chip {
        font-size: 0.74rem;
        padding: 0.22rem 0.6rem;
    }
}

/* ── Markdown Tables ──────────────────────────────────────── */
.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.88rem;
}
.md-table td {
    padding: 0.45rem 0.7rem;
    border: 1px solid #e2e8f0;
    vertical-align: top;
}
.md-table tr:first-child td {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}
.md-table tr:nth-child(even) {
    background: #f8fafc;
}
