/* === CONTENEDOR DEL CHAT === */
.n8n-chat {
    position: fixed !important;
    bottom: 80px !important;
    right: 20px !important;
    max-width: 380px;
    width: 100%;
    z-index: 2147483645 !important;
    overflow: visible !important; 
}

.chat-close-btn:hover {
    color: #222;
}


/* === CONTENEDOR PRINCIPAL DEL CHAT CON BORDER-RADIUS Y SOMBRA === */
.chat-window {
    border-radius: 14px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
    background: #ffffff !important;
    opacity: 1 !important;
    transform: scaleY(0);
    transform-origin: bottom center;
    transition: transform 0.35s ease;
    display: none;
}

/* === BOTÓN FLOTANTE PERSONALIZADO === */
.chat-window-toggle {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 2147483646 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-window-toggle svg {
    display: none !important;
}

.chat-window-toggle::before {
    content: '¡Matricúlate ya!';
    background-color: #ff9900;
    background-image: url('/wp-content/plugins/ticnology-chat-integration/includes/assets/img/robo.png');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 20px 20px; /* ajusta según el tamaño del ícono */
    color: white;
    padding: 10px 20px 10px 40px; /* espacio a la izquierda para el ícono */
    border-radius: 999px;
    font-weight: 900;
    font-size: 17px;
    white-space: nowrap;
    display: inline-block;
    line-height: 1;
}
.chat-window-toggle:hover::before {
    background-color: #ff9900;
    background-image: url('/wp-content/plugins/ticnology-chat-integration/includes/assets/img/robo.png');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 20px 20px; /* ajusta según el tamaño del ícono */
    font-weight: 900;
    font-size: 18px;
}

/* === CABECERA DEL CHAT === */
.chat-header {
    background: #ffffff !important;
    color: #333333 !important;
    padding: 14px 16px !important;
    font-weight: bold;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    font-size: 16px;
    position: relative;
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}

.chat-header .chat-heading {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
    justify-content: space-between;
}

.chat-header h1 {
    font-size: 14px;
    font-weight: bold;
    color: #333333;
    margin: 0;
    display: flex;
    align-items: center;
}

.chat-header p {
    font-size: 11px;
    font-weight: normal;
    color: #666;
    margin: 0;
    display: flex;
    align-items: center;
}

.chat-header p::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 rgba(76, 175, 80, 0.7);
    animation: chat-pulse 1.5s infinite;
}

@keyframes chat-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* === MENSAJES DEL BOT === */
.chat-message.chat-message-from-bot {
    background-color: #ff9900 !important;
    color: #ffffff !important;
    border-radius: 18px 18px 18px 4px;
    margin: 10px 12px;
    padding: 10px 14px;
    font-size: 15px;
    max-width: 85%;
    align-self: flex-start;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message-from-bot .chat-message-markdown p {
    margin: 0;
}

/* === MENSAJES DEL USUARIO === */
.chat-message.chat-message-from-user {
    background-color: #e0e0e0 !important;
    color: #333 !important;
    border-radius: 18px 18px 4px 18px;
    margin: 10px 12px;
    font-size: 15px;
    max-width: 85%;
    align-self: flex-end;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    padding: 15px;
}

.chat-message-markdown p {
  margin: 0 !important;
}

/* === CONTENEDOR DE INPUT === */
.chat-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #f7f7f7;
    border-top: 1px solid #ddd;
    gap: 10px;
    border-bottom-left-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
}

.chat-inputs textarea,
.chat-footer .chat-input textarea {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ccc !important;
    border-radius: 999px !important;
    font-size: 14px;
    font-family: 'Helvetica Neue', sans-serif;
    resize: none;
    outline: none;
    background-color: #ffffff;
    box-sizing: border-box;
    min-height: 38px;
    height: auto !important;
}

.chat-inputs textarea:focus {
    border-color: #ff9900 !important;
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

/* === CONTROLES === */
.chat-inputs-controls {
    display: flex;
    align-items: center;
}

/* === BOTÓN ENVIAR === */
.chat-input-send-button {
    background-color: #ff9800 !important;
    color: white !important;
    border: none !important;
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-input-send-button:hover {
    background-color: #ff8c00 !important;
}

.chat-input-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-input-send-button svg {
    fill: white;
    width: 20px;
    height: 20px;
}

/* === MENSAJES === */
.chat-body .chat-messages-list {
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
    max-height: 400px;
    flex-grow: 1;
    background-color: #f7f7f7;
    min-height: 200px;
}

/* === LAYOUT GENERAL === */
.chat-layout.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 14px;
}

/* === TIPOGRAFÍA GLOBAL === */
.chat-message-from-bot,
.chat-message-from-user,
.chat-header h1,
.chat-header p,
.chat-input textarea {
    font-family: 'Helvetica Neue', Arial, sans-serif !important;
}

/* === TYPING === */
.chat-message-typing {
    display: flex;
    justify-content: flex-start;
}

.chat-message-typing-body {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #ff9900;
    border-radius: 18px;
    padding: 10px 14px;
    margin: 10px 12px;
}

.chat-message-typing-circle {
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
}

/* === ESTADOS DEL CONTENEDOR === */
.chat-window-wrapper.n8n-chat.chat-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.chat-window-wrapper.n8n-chat.chat-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* === ANIMACIONES DE ENTRADA Y SALIDA (CORTINA) === */
.chat-window.animating-open {
    display: block !important;
    transform-origin: bottom center;
}

.chat-window.chat-visible {
    transform: scaleY(1);
}

.chat-window.animating-close {
    transform: scaleY(0);
}


/* === TYPING ANIMATION === */
        .chat-message-typing {
            display: flex;
            justify-content: flex-start;
        }

        .chat-message-typing-body {
            display: flex;
            align-items: center;
            gap: 6px;
            background-color: #ff9900;
            border-radius: 18px;
            padding: 10px 14px;
            margin: 10px 12px;
        }

        .chat-message-typing-circle {
            width: 8px;
            height: 8px;
            background-color: #fff;
            border-radius: 50%;
            animation: chat-typing-bounce 1.3s infinite ease-in-out;
        }

        .chat-message-typing-circle:nth-child(2) {
            animation-delay: 0.2s;
        }

        .chat-message-typing-circle:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes chat-typing-bounce {
            0%, 80%, 100% {
                transform: scale(0);
                opacity: 0.3;
            }
            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

