/* Clase genérica para ocultar (para el formulario) */
.hidden {
    display: none !important;
}

#wp-chatbot-ia {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Botón flotante */
#wp-chatbot-ia-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    font-size: 24px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#wp-chatbot-ia-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

/* Ventana del chat */
#wp-chatbot-ia-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-height: 520px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15,23,42,0.45);
    display: flex;          /* importante: cuando se muestra, se ve como flex */
    flex-direction: column;
    overflow: hidden;
}

.wp-chatbot-ia-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}

#wp-chatbot-ia-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* Mensajes */
#wp-chatbot-ia-messages {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    background: #f9fafb;
}

.wp-chatbot-ia-msg {
    padding: 8px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 90%;
    word-wrap: break-word;
}

.wp-chatbot-ia-msg.msg-user {
    background: #2563eb;
    color: #fff;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 2px;
}

.wp-chatbot-ia-msg.msg-bot {
    background: #e5e7eb;
    color: #111827;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

/* Botón toggle del formulario */
#wp-chatbot-ia-lead-toggle-wrapper {
    padding: 6px 10px 0;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

#wp-chatbot-ia-lead-toggle {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

#wp-chatbot-ia-lead-toggle:hover {
    background: #dbeafe;
    box-shadow: 0 4px 10px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}

/* Formulario de lead */
#wp-chatbot-ia-lead-form {
    padding: 8px 10px 4px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.wp-chatbot-ia-lead-field {
    margin-bottom: 6px;
}

.wp-chatbot-ia-lead-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.wp-chatbot-ia-lead-field input,
.wp-chatbot-ia-lead-field textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 6px 8px;
    font-size: 13px;
    box-sizing: border-box;
}

.wp-chatbot-ia-lead-field input:focus,
.wp-chatbot-ia-lead-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.35);
}

#wp-chatbot-ia-lead-send {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: #16a34a;
    color: #fff;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

#wp-chatbot-ia-lead-send:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(22,163,74,0.3);
}

.wp-chatbot-ia-lead-note {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* Input del chat */
.wp-chatbot-ia-input-area {
    border-top: 1px solid #e5e7eb;
    padding: 8px;
    display: flex;
    gap: 6px;
    background: #fff;
}

#wp-chatbot-ia-input {
    flex: 1;
    resize: none;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 6px 8px;
    font-size: 14px;
    min-height: 36px;
    max-height: 80px;
}

#wp-chatbot-ia-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.4);
}

#wp-chatbot-ia-send {
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
}

#wp-chatbot-ia-send:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}
#wp-chatbot-ia-button {
    font-size: 0; /* para que no ocupe espacio texto interno */
}

#wp-chatbot-ia-button .wp-chatbot-ia-button-icon {
    width: 80%;
    height: 80%;
    object-fit: contain;
    pointer-events: none; /* el click sigue siendo del botón, no de la imagen */
}
