/* ==========================================================================
   REQ-0014 / REQ-ADM-013 - Widget Chatbot Global
   Autor inicial: Uesly Madrigal Acosta
   Estilos visuales del asistente virtual en su posición original exacta.
   ========================================================================== */

/* Contenedor flotante global en la posición original exacta (inferior izquierda) */
.chatbot-widget {
    position: fixed;
    bottom: 24px;
    left: 5px;
    z-index: 89;
}

/* Botón flotante para abrir/cerrar el chatbot */
.chatbot-widget .chatbot-widget__toggle {
    background: #00b050;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 1.05rem;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chatbot-widget .chatbot-widget__toggle:hover {
    background: #009444;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

/* Ventana principal del chat */
.chatbot-widget .chatbot-widget__panel {
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.20);
    overflow: hidden;
    display: none;
    margin-bottom: 12px;
}

/* Encabezado del chatbot */
.chatbot-widget .chatbot-widget__header {
    background: #00b050;
    color: #ffffff;
    padding: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Acciones del encabezado */
.chatbot-widget .chatbot-widget__header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-widget .chatbot-widget__header-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.chatbot-widget .chatbot-widget__header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Área donde aparecen preguntas y respuestas */
.chatbot-widget .chatbot-widget__messages {
    height: 370px;
    overflow-y: auto;
    padding: 16px;
}

/* Estilo base de los mensajes */
.chatbot-widget .chatbot-widget__message {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
    word-break: break-word;
}

/* Mensajes enviados por usuario */
.chatbot-widget .chatbot-widget__message--user {
    background: #eef7ff;
    color: #0f172a;
    border: 1px solid #dbeafe;
    margin-left: 20px;
}

/* Mensajes generados por chatbot */
.chatbot-widget .chatbot-widget__message--bot {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    margin-right: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chatbot-widget .chatbot-widget__message-heading {
    font-size: 0.93rem;
    font-weight: 700;
    color: #001a70;
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
}

.chatbot-widget .chatbot-widget__message--bot p {
    margin: 0 0 8px 0;
    line-height: 1.55;
}

.chatbot-widget .chatbot-widget__message--bot p:last-child {
    margin-bottom: 0;
}

.chatbot-widget .chatbot-widget__message--bot strong {
    font-weight: 700;
    color: #001a70;
}

.chatbot-widget .chatbot-widget__message--bot em {
    font-style: italic;
    color: #475569;
}

.chatbot-widget .chatbot-widget__message--bot ul,
.chatbot-widget .chatbot-widget__message--bot ol {
    margin: 6px 0 10px 18px;
    padding: 0;
}

.chatbot-widget .chatbot-widget__message--bot ul li {
    list-style-type: disc;
    margin-bottom: 6px;
    line-height: 1.5;
}

.chatbot-widget .chatbot-widget__message--bot ol li {
    list-style-type: decimal;
    margin-bottom: 6px;
    line-height: 1.5;
}

.chatbot-widget .chatbot-widget__message--bot ul li::marker {
    color: #00b74f;
}

/* Zona inferior con input y botón */
.chatbot-widget .chatbot-widget__footer {
    display: flex;
    border-top: 1px solid #ddd;
}

/* Caja de texto para consultas */
.chatbot-widget .chatbot-widget__footer input {
    flex: 1;
    border: none;
    padding: 12px;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
}

/* Botón para enviar mensaje */
.chatbot-widget .chatbot-widget__footer button {
    border: none;
    background: #003366;
    color: #ffffff;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.chatbot-widget .chatbot-widget__footer button:hover {
    background: #002244;
}

/* Adaptación para dispositivos móviles */
@media (max-width: 768px) {
    .chatbot-widget .chatbot-widget__panel {
        width: calc(100vw - 32px);
    }

    .chatbot-widget {
        left: 12px;
        bottom: 12px;
    }
}

/* Handoff WhatsApp / Formulario */
.chatbot-widget__handoff {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-widget__handoff button {
    width: 100%;
    padding: 10px;
    background: #00b050 !important;
    color: #ffffff !important;
    border: 1px solid #009444 !important;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease;
}

.chatbot-widget__handoff button:hover {
    background: #009444 !important;
}