/* Becor Portal - Estilos globales */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar */
.navbar-brand {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Sidebar conversaciones */
#sidebar {
    background: #1a1a2e !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
}

.conv-item {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.88rem;
    color: #d1d5db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.conv-item.active {
    background: rgba(13,110,253,0.3);
    color: #fff;
}

.conv-item .conv-delete {
    display: none;
    cursor: pointer;
    color: #ef4444;
    flex-shrink: 0;
}

.conv-item:hover .conv-delete {
    display: inline;
}

/* Mensajes del chat */
.message-row {
    display: flex;
    margin-bottom: 24px;
}

.message-row.message-user {
    justify-content: flex-end;
}

.message-row.message-assistant {
    justify-content: flex-start;
    flex-direction: column;
}

.message-bubble {
    padding: 10px 16px;
    line-height: 1.5;
    word-break: break-word;
}

.message-user .message-bubble {
    background: #0d6efd;
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    max-width: 75%;
}

.message-assistant .message-bubble {
    background: #ffffff;
    color: #212529;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    width: fit-content;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 8px;
}

/* Markdown dentro de burbujas */
.message-assistant .message-bubble p:last-child { margin-bottom: 0; }
.message-assistant .message-bubble pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.84em;
    margin: 8px 0;
}
.message-assistant .message-bubble code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.88em;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
}
.message-assistant .message-bubble pre code {
    background: transparent;
    padding: 0;
}
.message-assistant .message-bubble table {
    font-size: 0.82em;
    width: 100%;
    border-collapse: collapse;
}
.message-assistant .message-bubble table th,
.message-assistant .message-bubble table td {
    border: 1px solid #dee2e6;
    padding: 4px 8px;
}
.message-assistant .message-bubble table th {
    background: #f8f9fa;
}

/* Gráficas */
.chart-container img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Tabla de resultados SQL */
.sql-table-container {
    overflow-x: auto;
    margin-top: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.sql-table-container table {
    font-size: 0.8em;
}

/* Drop zone upload */
#drop-zone {
    transition: border-color 0.2s, background 0.2s;
}

#drop-zone.drag-over {
    border-color: #0d6efd !important;
    background: rgba(13,110,253,0.05);
}

/* Scrollbar personalizado */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #adb5bd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6c757d; }

/* Textarea del chat */
#message-input {
    border-radius: 12px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#message-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}
