/* assets/css/chatbot-styles.css */

/* Contenedor principal del chatbot y botón de activación */
.cym-chatbot-container {
    position: fixed !important; /* Forzar posición fija */
    bottom: 20px !important;
    right: 20px !important;
    z-index: 99999 !important; /* Aumentar z-index y forzarlo */
    font-family: Arial, sans-serif;
    width: auto; /* Asegurar que no ocupe todo el ancho por defecto */
    max-width: 350px; /* Coincidir con el ancho de la ventana del chat */
}

.cym-chatbot-toggle-button {
    background-color: #0073aa; 
    color: white;
    border: none;
    border-radius: 50px; 
    padding: 12px 15px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.cym-chatbot-toggle-button:hover {
    background-color: #005a87;
}

.cym-chatbot-toggle-button svg {
    width: 24px;
    height: 24px;
}

/* Ventana del Chat */
.cym-chatbot-window {
    width: 350px;
    max-width: 90vw; 
    height: 450px;
    max-height: 70vh; 
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none; 
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 65px; 
}

.cym-chatbot-window.active {
    display: flex !important; /* Forzar display */
}

/* Cabecera del Chat */
.cym-chatbot-header {
    background-color: #f1f1f1; 
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.cym-chatbot-header h3 {
    margin: 0;
    font-size: 16px; /* Aumentado ligeramente */
    color: #2c3e50; /* Más oscuro */
    font-weight: 600; /* Un poco más de grosor */
}

.cym-chatbot-close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555; /* Ligeramente más oscuro */
}

.cym-chatbot-close-button:hover {
    color: #2c3e50;
}

/* Área de Mensajes */
.cym-chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto; 
    background-color: #f9f9f9; 
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cym-chatbot-message {
    padding: 9px 14px; /* Ligeramente más padding */
    border-radius: 15px;
    max-width: 85%; /* Permitir un poco más de ancho */
    line-height: 1.5; /* Mejorar espaciado de línea */
    font-size: 15px;  /* Aumentado para mejor legibilidad */
    word-wrap: break-word; 
}

.cym-chatbot-message p {
    margin: 0;
    font-weight: 400; /* Asegurar grosor normal */
}

/* Estilos para los enlaces dentro de los mensajes del bot */
.cym-chatbot-message-bot a {
    color: #005a87; /* Un azul más oscuro para enlaces */
    text-decoration: underline;
    font-weight: 500; /* Hacer los enlaces un poco más notorios */
}
.cym-chatbot-message-bot a:hover {
    color: #e07a5f; /* Color de hover de tu tema */
}


.cym-chatbot-message-user {
    background-color: #0073aa; 
    color: white;
    align-self: flex-end; 
    border-bottom-right-radius: 5px;
}
.cym-chatbot-message-user p {
     color: white; /* Asegurar que el texto del usuario sea blanco */
}

.cym-chatbot-message-bot {
    background-color: #e9e9eb; 
    align-self: flex-start; 
    border-bottom-left-radius: 5px;
}
.cym-chatbot-message-bot p {
    color: #2c3e50; /* Texto del bot más oscuro */
}

/* Área de Entrada de Texto */
.cym-chatbot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #f1f1f1;
}

.cym-chatbot-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 15px; /* Aumentado */
    resize: none; 
    font-family: inherit;
    color: #2c3e50; /* Texto del input más oscuro */
}
.cym-chatbot-input::placeholder {
    color: #7f8c8d; /* Placeholder un poco más oscuro */
}


.cym-chatbot-send-button {
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 50%; 
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cym-chatbot-send-button:hover {
    background-color: #005a87;
}

.cym-chatbot-send-button svg {
    width: 20px;
    height: 20px;
}

/* Estilos para cuando el chat está cargando/pensando */
.cym-chatbot-message-bot.thinking p {
    color: #7f8c8d; /* Color del texto "Escribiendo..." */
}
.cym-chatbot-message-bot.thinking p::after {
    content: '...';
    display: inline-block;
    animation: ThinkingAnimation 1s infinite;
}

@keyframes ThinkingAnimation {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

/* Estilos para el contenedor de captura de email */
.cym-chatbot-email-capture {
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    padding: 10px;
}
.cym-chatbot-email-capture p {
    font-size: 0.9em;
    margin-bottom: 8px;
    color: #2c3e50; /* Más oscuro */
}
.cym-chatbot-email-capture input[type="email"] {
    width: calc(100% - 22px); 
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px; /* Ligeramente más grande */
    color: #2c3e50;
}
.cym-chatbot-email-capture input[type="email"]::placeholder {
    color: #7f8c8d;
}
.cym-chatbot-email-capture button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}
.cym-chatbot-email-capture #cym-chatbot-send-email-button {
    background-color: #0073aa;
    color: white;
}
.cym-chatbot-email-capture #cym-chatbot-send-email-button:hover {
    background-color: #005a87;
}
.cym-chatbot-email-capture #cym-chatbot-cancel-email-button {
    background-color: #ccc;
    color: #333;
    margin-left: 5px;
}
.cym-chatbot-email-capture #cym-chatbot-cancel-email-button:hover {
    background-color: #bbb;
}
