/* ========== STILI CHAT - VERSIONE ARCHITRAVE (come minisiti Python) ========== */

.chat-content {
    margin-bottom: 3rem;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0; /* Rimuovo gap perché uso margin-bottom sui messaggi */
}

/* Singolo messaggio - IDENTICO al generatore Python */
.chat-message {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Etichette GC / AI - STILE LORA (non monospace) */
.message-label {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-family: 'Lora', Georgia, serif;
    text-transform: none; /* Rimuovo uppercase del vecchio CSS */
}

.message-label.gc {
    color: var(--accent, #c9a87b);
}

.message-label.ai {
    color: var(--accent-muted, #7b9ac9);
}

/* Contenuto del messaggio - ESATTAMENTE come Python */
.message-content {
    line-height: 1.7;
    margin-left: 0.5rem;      /* ← Questa è la differenza chiave */
    border-left: 2px solid #333;
    padding-left: 1.2rem;      /* ← Questa è la differenza chiave */
    font-family: 'Lora', Georgia, serif;
}

.message-content p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* ========== HEADINGS (esattamente come nel minisito) ========== */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    color: var(--accent, #c9a87b);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    display: block;
}

.message-content h1 { font-size: 1.8rem; border-bottom: 1px solid var(--border, #222); padding-bottom: 0.5rem; }
.message-content h2 { font-size: 1.6rem; }
.message-content h3 { font-size: 1.4rem; }
.message-content h4 { font-size: 1.2rem; }
.message-content h5,
.message-content h6 { font-size: 1.1rem; }

/* ========== LISTE (compattate stile Architrave) ========== */
.message-content ul,
.message-content ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding-left: 0;
}

.message-content li {
    margin-bottom: 0.5rem;
}

/* Fix: paragrafi dentro le liste */
.message-content li p {
    margin: 0;
    padding: 0;
    display: inline;
}

/* ========== GRASSETTO E CORSIVO ========== */
.message-content strong {
    color: #fff;
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

/* ========== TABELLE MARKDOWN (come nel minisito) ========== */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-align: left;
}

.message-content th {
    background-color: #1a1a1a;
    color: var(--accent, #c9a87b);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--border, #222);
}

.message-content td {
    padding: 1rem;
    border-bottom: 1px solid var(--border, #222);
    color: #ccc;
}

.message-content tr:hover td {
    background-color: #141414;
}

/* ========== ALTRI ELEMENTI MARKDOWN ========== */
.message-content hr {
    border: 0;
    height: 1px;
    background: var(--border, #222);
    margin: 2.5rem 0;
}

.message-content blockquote {
    margin: 0.75rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent, #c9a87b);
    color: #aaa;
    font-style: italic;
}

.message-content code {
    background: #1a1a1a;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: monospace;
    color: var(--accent, #c9a87b);
}

.message-content pre {
    background: #1a1a1a;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Link nella chat (stile Architrave) */
.message-content a {
    color: var(--accent, #c9a87b);
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 168, 123, 0.3);
    transition: all 0.2s ease;
}

.message-content a:hover {
    color: #fff;
    border-bottom-color: var(--accent, #c9a87b);
}

/* Messaggio vuoto / errore */
.no-chat {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-style: italic;
}

.message-content .fake-heading {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    margin: 1em 0 0.5em;
    font-family: inherit;
    color: inherit;
}