/* assets/css/chat-style.css
   ——————————————————————————————————————————————————————————————
   Estilos “Melissa” con globos WhatsApp y typing inline
   (VERSIÓN ESTABLE con fondo corregido)
   —————————————————————————————————————————————————————————————— */

/* BURBUJA FLOTANTE CON IMAGEN */
#chat-clinica-molina-bubble,
#chat-clinica-molina-bubble-close {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

    /* Imagen de fondo */
    background-image: url('https://clinicadrmolina.es/wp-content/uploads/WhatsApp.png');
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;

    /* Eliminar color y texto previos */
    background-color: transparent;
    color: transparent;
    font-size: 0;
    line-height: 0;
    text-align: center;
}

#chat-clinica-molina-bubble-close {
    transform: scale(0.9);
    opacity: 0.8;
}

/* VENTANA DEL CHAT */
#chat-clinica-molina-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 600px;
    max-width: 90%;
    max-height: 500px;
    background: #ECE5DD;   /* beige ventana */
    border-radius: 10px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 10000;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

/* CABECERA */
#chat-clinica-molina-header {
    background: #1fc05b;
    color: white;
    padding: 12px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* CONTENEDOR DE MENSAJES */
#chat-clinica-molina-messages {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    background: #ECE5DD;   /* gris claro de mensajes */
}

/* GLOBOS DE TEXTO */
.message-user, .message-bot {
    display: inline-block;
    max-width: 75%;
    margin: 5px 0;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.message-user {
    background: #DCF8C6;
    align-self: flex-end;
    margin-left: auto;
    text-align: left;
}

.message-bot {
    background: #FFFFFF;
    align-self: flex-start;
    margin-right: auto;
    text-align: left;
}

/* INDICADOR “ESCRIBIENDO…” INLINE */
#chat-clinica-molina-typing {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #ECE5DD;    /* ¡ahora igual que fondo de mensajes! */
    font-style: italic;
    color: #777;
    font-size: 14px;
}

/* TEXTO FIJO ANTES DE LOS PUNTOS */
.typing-text {
    white-space: nowrap;
    margin-right: 4px;
}

/* PUNTOS ANIMADOS EN LÍNEA */
.typing-dots {
    display: flex;
}

.typing-dots span {
    animation: blink 1.4s infinite both;
    font-size: 14px;
    margin-right: 2px;
    color: #777;
}

@keyframes blink {
    0%   { opacity: .2; }
    20%  { opacity: 1; }
    100% { opacity: .2; }
}

/* ZONA DE INPUT */
#chat-clinica-molina-input {
    display: flex;
    border-top: 1px solid #ccc;
    background: #f0f0f0;
    padding: 8px;
}

#chat-clinica-molina-input input,
#chat-clinica-molina-input-field {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#chat-clinica-molina-input button,
#chat-clinica-molina-send {
    background: #25D366;
    color: white;
    border: none;
    padding: 0 15px;
    margin-left: 8px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ADAPTACIÓN MÓVIL */
@media (max-width: 768px) {
    #chat-clinica-molina-window {
        width: 90%;
        right: 5%;
        bottom: 80px;
    }
}

/* GLOBOS DE TEXTO (refuerzo con selector de contenedor y !important) */
#chat-clinica-molina-messages .message-user,
#chat-clinica-molina-messages .message-bot {
    display: inline-block !important;
    max-width: 75% !important;
    margin: 5px 0 !important;
    padding: 8px 12px !important;
    border-radius: 18px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
    background-clip: padding-box !important; /* borde redondeado correcto */
}

/* Fondo y alineación */
#chat-clinica-molina-messages .message-user {
    background: #DCF8C6 !important;
    margin-left: auto !important;
}
#chat-clinica-molina-messages .message-bot {
    background: #FFFFFF !important;
    margin-right: auto !important;
}