/**
 * =========================================================================
 * iDigitales - Estilos del Widget del Chatbot (my-chatbot.css)
 * Configuración visual del botón flotante, ventana, mensajes y enlaces.
 * =========================================================================
 */

/* 1. Contenedor Principal del Widget Flotante (Esquina inferior derecha) */
#chatbot-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 2. Botón Circular Flotante */
#chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #000000;
    border: 2px solid #ff7b00;
    color: #ff7b00;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    outline: none;
}

#chatbot-toggle-btn:hover {
    transform: scale(1.08);
    background-color: #111111;
    border-color: #E1121A;
    color: #E1121A;
}

/* 3. Ventana del Chat */
#chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    max-width: 90vw;
    height: 480px;
    max-height: 80vh;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

/* Estado Oculto de la Ventana */
.chatbot-window-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

/* 4. Cabecera del Chat */
.chat-header {
    background-color: #000000;
    color: #ffffff;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #E1121A;
}

.chat-header button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    outline: none;
    transition: color 0.2s ease;
}

.chat-header button:hover {
    color: #E1121A;
}

/* 5. Área de Mensajes */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Globos de Mensajes */
.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: #000000;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.bot-message {
    align-self: flex-start;
    background-color: #eef2f5;
    color: #222222;
    border-bottom-left-radius: 2px;
    border: 1px solid #e1e6eb;
}

.bot-message ul {
    margin: 8px 0 0 0;
    padding-left: 18px;
}

.bot-message li {
    margin-bottom: 6px;
}

/* 6. Estilos Estrictos para Enlaces dentro del Chatbot (Sin Hover Amarillo) */
.chat-messages a,
.bot-message a {
    color: #0056b3 !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
}

/* Corrección del Hover: Cambia a Rojo iDigitales en lugar de Amarillo */
.chat-messages a:hover,
.bot-message a:hover {
    color: #E1121A !important;
    text-decoration: none !important;
}

.chat-messages img {
    vertical-align: middle;
    width: 16px;
    height: 16px;
}

/* 7. Área de Input y Botón de Envío */
.chat-input {
    display: flex;
    padding: 10px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input input:focus {
    border-color: #000000;
}

.chat-input button {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-input button:hover {
    background-color: #E1121A;
}