/* Container*/
/* ================================================================================================================== */
.n8n-chat-widget 
{
    /* font-family: sans-serif; */
}

.n8n-chat-widget .chat-container 
{
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 9999999999;
    display: flex;
    width: 380px;
    height: 500px;
    background: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 8px 32px #000;
    border: 1px solid #d5d5d5;
    overflow: hidden;
    opacity: 0;
    transition-duration: 0.5s;
    transform: translateX(380px);
}

.n8n-chat-widget .chat-container.open 
{
    display: flex;
    width: 380px;
    height: 500px;
    flex-direction: column;
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
    transform: translateX(0);
}

@media (max-width: 1300px) and (min-width: 992px) 
{
    .n8n-chat-widget .chat-container 
    {
        width: 350px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .n8n-chat-widget .chat-container 
    {
        position: fixed;
        inset: 0; 
        width: 100%;
        height: 100dvh;
        max-width: 100%;
        max-height: 100dvh;
        border-radius: 0;
        z-index: 999999;
        box-shadow: none;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .n8n-chat-widget .chat-container.open 
    {
        width: 100% !important;
        height: 100dvh !important;
        max-width: 100% !important;
        max-height: 78dvh !important;
        transform: translateX(0) !important;
        display: flex !important;
        flex-direction: column !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }
}

/* Header */
/* ================================================================================================================== */

.n8n-chat-widget .brand-header 
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-bottom: 1px solid #d5d5d5;
    background: #F4F4F4;
    z-index: 3;
}

.n8n-chat-widget .brand-info 
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-right: 10px;
}

.n8n-chat-widget .bot-icon 
{
    width: 60px;
    height: 60px;
    color: #ccc;
}

.n8n-chat-widget .bot-name 
{
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 14px;
}

.n8n-chat-widget .bot-name p 
{
    margin: 0;
}

.n8n-chat-widget .bot-name span {
    font-weight: bold;
}

.n8n-chat-widget .close-button 
{
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    background-color: transparent;
}

.n8n-chat-widget .brand-header img 
{
    height: 38px;
    padding-left: 5px;
}

.n8n-chat-widget .status-container 
{
    display: flex;
    align-items: center;
    gap: 10px;
}

.n8n-chat-widget .status-light 
{
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.n8n-chat-widget .status-light.online
{
    background: #00ff00;
} 

.n8n-chat-widget .status-light.offline
{
    background: #ff0000;
} 

.n8n-chat-widget .status-text 
{
    font-size: 10px;
}

@media (max-width: 768px) 
{
    .n8n-chat-widget .close-button 
    {
        display: none;
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #000;
        cursor: pointer;
        font-size: 20px;
        opacity: 0.6;
        transition: opacity 0.2s;
    }

    .n8n-chat-widget .close-button:hover 
    {
        opacity: 1;
    }

    .n8n-chat-widget .brand-header 
    {
        padding: 12px;
    }

    .n8n-chat-widget .brand-header img 
    {
        height: 30px;
    }
}

/* Chat Interface And Messages */
/* ================================================================================================================== */

.n8n-chat-widget .new-conversation 
{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.n8n-chat-widget .chat-interface 
{
    display: flex;
    flex-direction: column;
    height: 100%;
}

.n8n-chat-widget .chat-interface.active 
{
    display: flex;
}

.n8n-chat-widget .loading-overlay 
{
    position: fixed;
    bottom: 0;   
    left: 0;
    width: 100%;
    height: 100%;
    background: white; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2; /* Make sure it's on top of the messages */
}

.n8n-chat-widget .loading-spinner 
{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px;
}

.n8n-chat-widget .spinner 
{
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #1A2B4D;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin 
{
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.n8n-chat-widget .chat-messages 
{
    flex: 1;
    overflow-y: auto; 
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative; 
    z-index: 1; 
}

.n8n-chat-widget .chat-message 
{
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 5px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    transition-duration: 0.5s;
}

.n8n-chat-widget .chat-message.user 
{
    background: linear-gradient(135deg, #BEBEBE 0%, #BEBEBE 100%);
    color: #fff;
    align-self: flex-end;
    border: none;
}

.n8n-chat-widget .chat-message.bot 
{
    background: #1A2B4D;
    color: #fff;
    align-self: flex-start;
}

.n8n-chat-widget .typing-indicator 
{
    background: #1A2B4D;
    color: #fff;
    align-self: flex-start;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 5px;
    max-width: 80%;
    display: flex;
    align-items: center;
}

.n8n-chat-widget .typing-indicator span 
{
    height: 8px;
    width: 8px;
    margin: 0 1px;
    background-color: #fff;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
}

.n8n-chat-widget .typing-indicator span:nth-of-type(1) 
{
    animation: 1s blink infinite 0.3333s;
}

.n8n-chat-widget .typing-indicator span:nth-of-type(2) 
{
    animation: 1s blink infinite 0.6666s;
}

.n8n-chat-widget .typing-indicator span:nth-of-type(3) 
{
    animation: 1s blink infinite 0.9999s;
}

@keyframes blink 
{
    50% {
        opacity: 1;
    }
}

.n8n-chat-widget .chat-input 
{
    padding: 16px;
    background: #fff;
    border-top: 1px solid #d5d5d5;
    display: flex;
    gap: 8px;
    z-index: 3;
}

.n8n-chat-widget .chat-input textarea 
{
    flex: 1;
    padding: 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    background: #fff;
    color: #000;
    resize: none;
    font-size: 14px;
}

.disabled {
    background: #ddd !important;
}

.n8n-chat-widget .chat-input.disabled textarea::placeholder 
{
    color: #aaa !important;
}

.n8n-chat-widget .chat-input textarea::placeholder 
{
    color: #000;
    opacity: 0.6;
}

.n8n-chat-widget .chat-input button 
{
    background: linear-gradient(135deg, #F4F4F4 0%, #F4F4F4 100%);
    color: black;
    border: none;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.n8n-chat-widget .chat-input button svg 
{
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
}

.n8n-chat-widget .chat-input button:hover 
{
    transform: scale(1.05);
}

@media (max-width: 768px) 
{
    .n8n-chat-widget .typing-indicator span 
    {
        height: 6px;
        width: 6px;
    }

    .n8n-chat-widget .chat-input textarea 
    {
        padding: 8px;
        font-size: 13px;
    }

    .n8n-chat-widget .chat-messages 
    {
        padding: 12px;
    }

    .n8n-chat-widget .chat-message 
    {
        padding: 10px 12px;
        font-size: 13px;
        max-width: 85%;
    }

    .n8n-chat-widget .typing-indicator
    {
        padding: 10px 12px;
        max-width: 85%;
    }

    .n8n-chat-widget .chat-input button 
    {
        padding: 0 15px;
        font-size: 13px;
    }

    .n8n-chat-widget .chat-input 
    {
        padding: 10px;
        gap: 6px;
    }
}

/* Toggle Button */
/* ================================================================================================================== */

.n8n-chat-widget .chat-toggle 
{
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #5A6B4D 0%, #5A6B4D 100%);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.n8n-chat-widget .chat-toggle svg 
{
    width: 30px;
    height: 30px;
    transition: width 0.3s ease-in-out, height 0.3s ease-in-out, transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    max-width: none; 
    max-height: none;
    transform: scale(1.3);
    display: block;
    overflow: visible;
    fill: currentColor;
}

.n8n-chat-widget .chat-toggle:before 
{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 50%;
    z-index: -1;
}

.n8n-chat-widget .chat-toggle:hover 
{
    transform: scale(1.05);
}

.n8n-chat-widget .chat-toggle.remove 
{
    pointer-events: none;
}

/* @keyframes scb-shockwave2-animation 
{
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
        box-shadow: 0 0 2px #FF8435, inset 0 0 1px rgb(219, 97, 21);
    }
    95% {
        box-shadow: 0 0 50px transparent, inset 0 0 30px transparent;
    }
    100% {
        -webkit-transform: scale(1.2);
        transform: scale(1.2);
    }
} */

@media (max-width: 768px) 
{
    .n8n-chat-widget .chat-container:not(.open) + .chat-toggle svg {
        transform: scale(1.3); 
    }
}

/* Form */
/* ================================================================================================================== */

#formulario-profesional 
{
    padding-top: 20px;
    background: #ffffff;
    overflow-y: visible;
    display: none;
    position: absolute;
    top: 81px;
    left: 0;
    width: 100%;
    height: 360px; 
    z-index: 10;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    padding: 16px;
    opacity: 0;
    transition-duration: 0.75s;
    box-sizing: border-box;
}

#form-contacto 
{
    width: 100%; 
    display: flex;
    flex-direction: column;
    gap: 8px; 
}

#form-contacto h5 
{
    margin: 0;
    font-size: 14px; 
    line-height: 1.3;
    text-align: center;
}

#form-contacto input[type="text"],
#form-contacto input[type="email"],
#form-contacto input[type="tel"] {
    padding: 6px;
    font-size: 13px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#form-contacto button[type="submit"] 
{
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 5px;
    height: auto;
    background: #1A2B4D;
    color: #fff;
    border: none;
    cursor: pointer;
}

#form-contacto button#cerrar-formulario 
{
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 5px;
    height: auto;
    background: #eee;
    color: #333;
    border: none;
    cursor: pointer;
}

#form-contacto button[type="submit"]:hover 
{
    background: #007aa1;
}

#form-contacto button#cerrar-formulario:hover 
{
    background: #dcdcdc;
}

#form-contacto select 
{
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 13px;
    background: #fff;
    color: #000;
}

/* Chat Footer */
/* ================================================================================================================== */

.n8n-chat-widget .chat-footer 
{
    padding: 8px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #d5d5d5;
    z-index: 3;
}

.n8n-chat-widget .chat-footer a 
{
    color: #000;
    text-decoration: none;
    font-size: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.n8n-chat-widget .chat-footer a:hover 
{
    opacity: 1;
}

@media (max-width: 768px) 
{
    .n8n-chat-widget .chat-footer {
        padding: 6px;
    }
    
    .n8n-chat-widget .chat-footer a {
        font-size: 8px;
    }
}