/* Botón Flotante */
#mcia-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #0073aa; /* Color primario de WordPress */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 9998;
    transition: transform 0.2s;
}
#mcia-chat-button:hover {
    transform: scale(1.1);
}

/* Ventana de Chat */
#mcia-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

/* Header de la Ventana */
.mcia-header {
    background: #0073aa;
    color: white;
    padding: 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mcia-header h4 {
    margin: 0;
    font-size: 16px;
}
#mcia-close-button {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
}

/* Cuerpo del Chat (Mensajes) */
.mcia-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

/* Footer (Input) */
.mcia-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
#mcia-chat-form {
    display: flex;
}
#mcia-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
}
#mcia-send-button {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
}

/* Clase para ocultar */
.mcia-hidden {
    display: none;
}

/* --- AÑADIR ESTO AL FINAL DE style.css --- */

/* Contenedor de mensajes */
.mcia-message {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Mensaje del Bot (izquierda) */
.mcia-message-bot {
    background-color: #f1f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Mensaje del Usuario (derecha) */
.mcia-message-user {
    background-color: #0073aa;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Re-ajustar el body para alinear mensajes */
.mcia-body {
    display: flex;
    flex-direction: column;
}

/* Indicador de "escribiendo..." */
.mcia-typing-indicator {
    display: none; /* Oculto por defecto */
    align-self: flex-start;
    margin: 0 0 10px 10px;
}
.mcia-typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aaa;
    margin: 0 2px;
    animation: mcia-typing-bounce 1.4s infinite both;
}
.mcia-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.mcia-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes mcia-typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}