@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

/* General */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
}

/* Botón flotante */
#chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #052E66;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex; /* Asegura que esté visible */
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#chat-toggle-btn:hover {
    background-color: #5C0C74;
}

/* Contenedor del chat */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Ocultar el chat por defecto */
#chatbot-container.hidden {
    display: none;
}

/* Cuando el chat está visible */
#chatbot-container:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

/* Header */
#chat-header {
    background: linear-gradient(90deg, #052E66, #5C0C74);
    color: white;
    padding: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-header img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* Botón cerrar */
#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* Eliminamos la rayita minimizar */
#minimize-chat {
    display: none;
}

/* Cuerpo del chat */
#chat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    max-height: calc(100% - 60px - 60px); /* header + footer */
    scroll-behavior: smooth;
}

/* Mensajes */
.message {
    max-width: 80%;
    padding: 10px 14px;
    margin: 5px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user {
    background-color: #052E66;
    color: white;
    align-self: flex-end;
    text-align: right;
}

.bot {
    background-color: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border: 1px solid #5C0C74;
}

/* Footer (input y botón) */
#chat-footer {
    display: flex;
    padding: 8px;
    background-color: #ffffff;
    border-top: 1px solid #ddd;
    gap: 8px;
    box-sizing: border-box;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

#send-btn {
    background-color: #5C0C74;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

#send-btn:hover {
    background-color: #972333;
}

/* Ocultar al principio */
.hidden {
    display: none;
}

/* Si quisieras minimizar en el futuro (opcional, ahora no lo usamos) */
.minimized {
    height: 50px;
    overflow: hidden;
}
