/**
 * Estilos para el Chatbot - AI Chatbot Pro v6.0.1
 */

:root {
    --aicp-color-primary: #0073aa;
    --aicp-color-bot-bg: #ffffff;
    --aicp-color-bot-text: #333333;
    --aicp-color-user-bg: #dcf8c6;
    --aicp-color-user-text: #000000;
}

/* Contenedor y posicionamiento */
#aicp-chatbot-container { position: fixed; z-index: 10000; }
#aicp-chatbot-container.position-br { bottom: 20px; right: 20px; }
#aicp-chatbot-container.position-bl { bottom: 20px; left: 20px; }

/* Botón flotante */
#aicp-chat-toggle-button {
    background-color: var(--aicp-color-primary); color: white; width: 60px; height: 60px;
    border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 12px;
}
#aicp-chat-toggle-button:hover { transform: scale(1.1); }
#aicp-chat-toggle-button .aicp-open-icon, #aicp-chat-toggle-button .aicp-close-icon { width: 100%; height: 100%; transition: opacity 0.3s, transform 0.3s; }
#aicp-chat-toggle-button .aicp-open-icon img { width: 100%; height: 100%; object-fit: contain; }
#aicp-chat-toggle-button .aicp-close-icon { transform: scale(0); position: absolute; }
#aicp-chat-toggle-button.active .aicp-open-icon { transform: scale(0); }
#aicp-chat-toggle-button.active .aicp-close-icon { transform: scale(1); }

/* Ventana del Chat */
#aicp-chat-window {
    width: 370px; max-width: 90vw; height: 70vh; max-height: 600px;
    background: #f0f0f0; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: absolute; bottom: 80px; display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; transform: translateY(20px); transition: opacity 0.3s ease, transform 0.3s ease; visibility: hidden;
}
#aicp-chatbot-container.position-br #aicp-chat-window { right: 0; }
#aicp-chatbot-container.position-bl #aicp-chat-window { left: 0; }
#aicp-chat-window.active { opacity: 1; transform: translateY(0); visibility: visible; }

/* Cabecera */
.aicp-chat-header {
    background: var(--aicp-color-primary); color: white; padding: 10px 15px; display: flex; align-items: center; gap: 12px;
    border-top-left-radius: 15px; border-top-right-radius: 15px; flex-shrink: 0;
}
.aicp-header-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.5); background-color: white; }
.aicp-header-title { font-weight: bold; font-size: 1em; }

/* Cuerpo de Mensajes */
.aicp-chat-body { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.aicp-chat-message { display: flex; gap: 10px; max-width: 85%; align-items: flex-end; }
.aicp-message-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    min-width: 30px !important;
    object-fit: cover;
    background-color: white;
}
.aicp-message-bubble {
    padding: 8px 14px;
    border-radius: 18px;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
    max-height: 340px;
    overflow-y: auto;
}

.aicp-chat-message.bot { align-self: flex-start; }
.aicp-chat-message.bot .aicp-message-bubble { background: var(--aicp-color-bot-bg); color: var(--aicp-color-bot-text); border-bottom-left-radius: 4px; }
.aicp-chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.aicp-chat-message.user .aicp-message-bubble { background: var(--aicp-color-user-bg); color: var(--aicp-color-user-text); border-bottom-right-radius: 4px; }

/* Feedback */
.aicp-feedback-buttons { display: flex; gap: 5px; margin-top: 8px; }
.aicp-feedback-buttons button { background: none; border: none; cursor: pointer; padding: 2px; opacity: 0.5; }
.aicp-feedback-buttons button:hover { opacity: 1; }
.aicp-feedback-buttons button.selected { opacity: 1; transform: scale(1.1); }
.aicp-feedback-buttons button svg { width: 16px; height: 16px; }

/* Indicador "escribiendo..." */
.aicp-bot-thinking .aicp-message-bubble { padding: 12px 15px; }
.aicp-bot-thinking .typing-dot { display: inline-block; width: 7px; height: 7px; background-color: #999; border-radius: 50%; animation: typing-bounce 1.2s infinite ease-in-out; }
.aicp-bot-thinking .typing-dot:nth-child(2) { animation-delay: 0.15s; }
.aicp-bot-thinking .typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

/* Respuestas Rápidas */
.aicp-quick-replies { padding: 0 15px 10px; flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.aicp-quick-reply { background-color: #fff; border: 1px solid #ccc; border-radius: 20px; padding: 6px 12px; font-size: 0.85em; cursor: pointer; transition: background-color 0.2s; }
.aicp-quick-reply:hover { background-color: #e9e9e9; }

/* Pie de página */
.aicp-chat-footer { padding: 10px 15px; background: #fff; border-top: 1px solid #e0e0e0; flex-shrink: 0; }
.aicp-chat-footer form { display: flex; align-items: center; gap: 10px; }
.aicp-chat-footer input { flex-grow: 1; border: 1px solid #ccc; border-radius: 20px; padding: 10px 15px; font-size: 1em; background: #f5f5f5; outline: none; }
.aicp-chat-footer button { background: var(--aicp-color-primary); border: none; color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s; flex-shrink: 0; }
.aicp-chat-footer button:disabled { background-color: #ccc; cursor: not-allowed; }
.aicp-chat-footer button svg { width: 20px; height: 20px; }


/* Formulario de leads */
#aicp-lead-form-overlay { position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.6); display:none; align-items:center; justify-content:center; z-index:10001; }
#aicp-lead-form { background:#fff; padding:20px; border-radius:8px; max-width:400px; width:90%; }
#aicp-lead-form h3 { margin-top:0; }
#aicp-lead-form .aicp-lead-field { margin-bottom:10px; }
#aicp-lead-form-btn { margin-top:10px; width:100%; background: var(--aicp-color-primary); color:#fff; border:none; padding:10px; border-radius:4px; cursor:pointer; }