/* ELIMINACIÓN DE CENTRADO Y AÑADIDO DE FLOTANTE */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    /* ELIMINAMOS: display: flex; justify-content: center; align-items: center; min-height: 100vh; */
}

/* NUEVO: Estilo para el botón flotante */
#chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; 
    background-color: #b8bfec;
    color: rgb(2, 2, 66);
    border: none;
    padding: 12px 18px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 1em;
}

/* MODIFICACIÓN: #chat-container se vuelve fijo y flotante */
#chat-container {
    width: 400px;
    height: 500px;
    background-color: #e3e4ee;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* Propiedades clave para hacerlo flotante */
    position: fixed;
    bottom: 90px; /* Separado del borde y sobre el botón */
    right: 20px;
    z-index: 9999;
}


/* ESTILOS ORIGINALES DEL CHAT (Mantenidos) */

#chat-header {
    background-color: #b8bfec;
    color: rgb(2, 2, 66);
    padding: 10px;
    text-align: left;    
}

.bot-name {
    margin: 0;
    font-size: 1.3em;
}

#chat-log {
    flex-grow: 1;
    padding: 10px;
    overflow-y: scroll;
    display: flex;
    flex-direction: column;
}

.message-container {
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;
    max-width: 80%;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-text {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 100%;
    word-wrap: break-word;
    font-size: 0.9em;
}

.bot-message .message-text {
    background-color: #b8bfec;
    color: rgb(2, 2, 66);
    border-bottom-left-radius: 2px;
}

.user-message .message-text {
    background-color: #4cae4c;
    color: white;
    border-bottom-right-radius: 2px;
}

.bot-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid #b8bfec;
    flex-shrink: 0;
}

#input-container {
    display: flex;
    padding: 10px;
    background-color: #e3e4ee;
    border-top: 1px solid #ccc;
}

#user-input {
    flex-grow: 1;
    margin-right: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 18px;
}

#send-button {
    background-color: #b8bfec;
    color: rgb(2, 2, 66);
    border: none;
    padding: 8px 12px;
    border-radius: 18px;
    cursor: pointer;
}

#send-button:hover {
    background-color: #b8bfec;
}

#chat-log::-webkit-scrollbar {
    width: 8px;
}

#chat-log::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 10px;
}

#chat-log::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
}

#chat-log::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

@media screen and (max-width: 480px) {
    #chat-container {
        width: 90%;
        height: 80vh;
    }
}

.message-text ul, .message-text ol {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 20px;
}

.response-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.response-button {
    background-color: #8d98d8;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    text-align: left;
}

.response-button:hover {
    background-color: #6a76c0;
}