/* --- VARIABLES GLOBALES DEL CHAT --- */
:root {
    --chat-header-bg: #1f2c34; 
    --chat-header-text: #e9edef;
}

/* --- GENERAL --- */
.header-btn.chat-btn { position: relative; color: var(--color-texto-claro); }
.header-btn.chat-btn svg { color: var(--color-primario); }

/* --- MODAL PRINCIPAL --- */
#chat-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000000; z-index: 5000;
    display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform 0.3s ease-in-out;
}
#chat-modal.abierto { transform: translateY(0); }

/* --- CABECERA --- */
.chat-header {
    background-color: var(--chat-header-bg); padding: 10px 15px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1); color: var(--chat-header-text);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.chat-titulo { font-weight: 700; font-size: 1rem; color: inherit; }
.chat-subtitulo { font-size: 0.75rem; opacity: 0.8; color: inherit; }
.chat-acciones-header { display: flex; align-items: center; gap: 15px; }
.chat-header-icon-btn {
    background: none; border: none; color: inherit; opacity: 0.8;
    cursor: pointer; padding: 5px; display: flex; align-items: center;
}
.chat-header-icon-btn:hover { opacity: 1; }
.chat-cerrar-btn {
    background: none; border: none; font-size: 1.8rem;
    line-height: 1; color: inherit; cursor: pointer; opacity: 0.8;
}

/* --- MENSAJES --- */
#chat-mensajes {
    flex: 1; padding: 15px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    background-color: #000000;
}
.btn-cargar-mas {
    align-self: center; background-color: #202c33; color: #8696a0;
    border: 1px solid #2a3942; padding: 8px 16px; border-radius: 20px;
    font-size: 0.8rem; cursor: pointer; margin-bottom: 10px;
}
.mensaje {
    max-width: 80%; padding: 6px 10px 8px 10px;
    border-radius: 8px; font-size: 0.95rem; position: relative;
    word-wrap: break-word; color: #e9edef; line-height: 1.4;
    user-select: none; /* Evita seleccionar texto al mantener presionado */
    transition: background-color 0.2s;
}
.mensaje:active { filter: brightness(1.2); } /* Feedback visual al tocar */

.mensaje.otro { align-self: flex-start; background-color: #202c33; border-top-left-radius: 0; }
.mensaje.otro .nombre-usuario { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; display: block; }
.mensaje.propio { align-self: flex-end; background-color: #005c99; border-top-right-radius: 0; }
.mensaje-hora { font-size: 0.65rem; text-align: right; margin-top: 2px; color: rgba(255,255,255,0.6); float: right; margin-left: 10px; }

/* --- VISTAS --- */
.vista-centrada {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 30px;
    text-align: center; background-color: #0b141a; color: #e9edef;
}
.vista-centrada h3 { color: #e9edef; margin-bottom: 1rem; }
.vista-centrada p { color: #8696a0; margin-bottom: 2rem; }
.btn-google {
    background-color: #fff; color: #3c4043; border: none;
    padding: 12px 24px; border-radius: 24px; font-weight: 600;
    display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.input-grande {
    width: 100%; max-width: 300px; padding: 12px;
    font-size: 1.1rem; background-color: #202c33; color: white;
    border: 1px solid #2a3942; border-radius: 12px; text-align: center; outline: none; margin-bottom: 10px;
}
.input-grande:focus { border-color: #0d6efd; }
.btn-primario {
    background-color: #0d6efd; color: white;
    padding: 12px 30px; border: none; border-radius: 24px;
    font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 10px;
}
.btn-secundario {
    background: none; color: #0d6efd;
    border: 1px solid #0d6efd; padding: 10px 20px;
    border-radius: 24px; margin-top: 10px; cursor: pointer;
}
.error-texto { color: #f15c6d; font-size: 0.9rem; margin-top: 10px; height: 20px; }

/* --- INPUT AREA --- */
.chat-input-area { background-color: #1f2c34; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.input-wrapper { display: flex; gap: 10px; align-items: center; }
#chat-input {
    flex: 1; background-color: #2a3942; border: none; border-radius: 8px;
    padding: 10px 15px; color: #e9edef; font-family: inherit; font-size: 1rem; resize: none; height: 45px; max-height: 100px;
}
#chat-input:focus { outline: none; }
#chat-enviar-btn {
    background-color: #0d6efd; color: white; border: none;
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
#chat-enviar-btn:disabled { background-color: #2a3942; color: #8696a0; }
.chat-info-footer { display: flex; justify-content: space-between; font-size: 0.75rem; color: #8696a0; padding: 0 5px; }
.caracteres-count.limite { color: #f15c6d; }

/* --- MODAL TÉRMINOS Y REPORTES --- */
#modal-terminos, #modal-reporte, #menu-acciones {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85); z-index: 6000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
#modal-terminos.hidden, #modal-reporte.hidden, #menu-acciones.hidden { display: none; }

.terminos-content, .reporte-content {
    background-color: #1f2c34; color: #e9edef;
    padding: 25px; border-radius: 15px; width: 90%; max-width: 400px;
    text-align: center; border: 1px solid #2a3942;
}
.terminos-titulo { color: #0d6efd; font-size: 1.3rem; font-weight: 800; margin-bottom: 15px; }
.terminos-texto {
    text-align: left; font-size: 0.9rem; color: #d1d7db;
    max-height: 300px; overflow-y: auto; margin-bottom: 20px; line-height: 1.5;
}
.terminos-texto ul { padding-left: 20px; margin: 10px 0; }
.terminos-texto li { margin-bottom: 8px; }

/* --- MENU DE ACCIONES (BOTTOM SHEET) --- */
#menu-acciones { align-items: flex-end; }
.menu-acciones-content {
    background-color: #1f2c34; width: 100%; border-top-left-radius: 20px; border-top-right-radius: 20px;
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
    animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.accion-btn {
    background: none; border: none; color: #e9edef; padding: 15px;
    font-size: 1.1rem; text-align: left; border-radius: 10px;
    display: flex; align-items: center; gap: 15px;
}
.accion-btn:active { background-color: #2a3942; }
.accion-btn.peligro { color: #f15c6d; }

/* --- TEXTAREA REPORTE --- */
#reporte-motivo {
    width: 100%; background-color: #2a3942; color: white; border: 1px solid #53636d;
    border-radius: 8px; padding: 10px; margin-bottom: 15px; resize: none;
}