:root {
    --primary-main: #0078c2;
    --primary-dark: #0769b4;
    --linear-color: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-main)100%);
    --secondary-color: #F2F2FF;
    --tertiary-color: #CCCCE5;
    --transition: 250ms;
    --height-expand: 555px;
    --height-mini: 460px;
}

#chatbot-toggler {
    position: fixed;
    bottom: 28px;
    right: 5px;
    height: 46px;
    width: 46px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid var(--primary-main);
    background: var(--primary-main);
    transition: all var(--transition) ease;
}

body.show-chatbot #chatbot-toggler {
    transform: rotate(90deg);
}

#chatbot-toggler span {
    color: #fff;
    position: absolute;
    font-size: 18px;
}

#chatbot-toggler span .bot-icon {
    vertical-align: middle;
}

body.show-chatbot #chatbot-toggler span:first-child,
#chatbot-toggler span:last-child {
    opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child {
    opacity: 1;
}

.chatbot-popup {
    position: fixed;
    right: 35px;
    bottom: 79px;
    width: 450px;
    background: #fff;
    z-index: 9999;
    overflow: hidden;
    border-radius: 20px;
    opacity: 0;
    transform: scale(0.2);
    transform-origin: bottom right;
    pointer-events: none;
    box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
    transition: all var(--transition) ease;
}

body.show-chatbot .chatbot-popup {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

body.show-chatbot .chatbot-popup.expand-chatbot {
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 0;
    width: 100%;
}

body.show-chatbot .chatbot-popup.expand-chatbot .chat-body {
    height: var(--height-expand);
}

.chat-header {
    display: flex;
    align-items: center;
    background: var(--linear-color);
    padding: 2px 20px;
    justify-content: space-between;
}

.chat-header .header-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-info .chatbot-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: var(--primary-main);
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
}

.header-info .logo-text {
    color: #fff;
    font-size: 1.31rem;
    font-weight: 600;
}

.chat-header .header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-header #close-chatbot {
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 1.2rem;
    padding-top: 2px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
}

.chat-header #expand-chatbot {
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 1.2rem;
    padding-top: 2px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
}
.chat-header #close-chatbot:hover,
.chat-header #expand-chatbot:hover {
    background: var(--primary-dark);
}

.chat-body {
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    height: var(--height-mini);
    margin-bottom: 82px;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 transparent;
}

.chat-body .message {
    display: flex;
    gap: 11px;
    align-items: flex-end;
}

.chat-body .bot-message .bot-avatar {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #fff;
    flex-shrink: 0;
    margin-bottom: 2px;
    align-items: flex-end;
    background: linear-gradient(135deg, var(--primary-main) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
}

#welcome-message {
    color: #637381;
    text-align: center;
    font-size: 1.1rem;
}

.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .message .message-text {
    padding: 12px 16px;
    max-width: 82%;
    font-size: 1.07rem;
}

.chat-body .bot-message.thinking .message-text {
    padding: 2px 16px;
}

.chat-body .bot-message .message-text {
    background: #F2F2FF;
    border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message .message-text {
    color: #fff;
    background: var(--linear-color);
    border-radius: 13px 13px 3px 13px;
}

.chat-body .user-message .attachment {
    width: 50%;
    margin-top: -7px;
    border-radius: 13px 3px 13px 13px;
}

.chat-body .bot-message .thinking-indicator {
    display: flex;
    gap: 4px;
    padding-block: 15px;
}

.chat-body .bot-message .thinking-indicator .dot {
    height: 7px;
    width: 7px;
    opacity: 0.7;
    border-radius: 50%;
    background: #81c0e7;
    animation: dotPulse 1.8s ease-in-out infinite;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(1){
    animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2){
    animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3){
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 44% {
        transform: translateY(0);
    }

    28% {
        opacity: 0.4;
        transform: translateY(-4px);
    }

    44% {
        opacity: 0.2;
    }
}

.chat-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 15px 22px 20px;
    transition: bottom var(--transition) ease;
}

.chat-footer .chat-form {
    display: flex;
    position: relative;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    outline: 1px solid #CCCCE5;
}

.chat-footer .chat-form:focus-within {
    outline-width: 2px;
    outline-style: solid;
    outline-color: #7ec9e5;
}

.chat-form .message-input {
    border: none;
    outline: none;
    height: 47px;
    width: 100%;
    resize: none;
    max-height: 180px;
    white-space: pre-line;
    font-size: 0.95rem;
    padding: 14px 0 13px 18px;
    border-radius: inherit;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.chat-form .message-input:hover {
    scrollbar-color: #ccccf5 transparent;
}

.chat-form .chat-controls {
    display: flex;
    height: 47px;
    gap: 3px;
    align-items: center;
    align-self: flex-end;
    padding-right: 6px;
}

.chat-form .chat-controls button {
    height: 35px;
    width: 35px;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    color: #706DB0;
    background: none;
    border-radius: 50%;
    transition: 0.2s ease;
}

.chat-form .chat-controls #send-message {
    color: #fff;
    display: none;
    background: var(--primary-main);
    font-size: 1.1rem;
}

.chat-form .chat-controls #send-message:hover {
    background: var(--primary-dark);
}

.chat-form .message-input:valid~.chat-controls #send-message {
    display: block;
}

.chat-form .message-input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.chat-form .chat-controls button:hover {
    background: #f1f1ff;
}

.chat-label {
    font-weight: 600;
    font-size: 0.95rem;
    font-weight: bold;
    display: block;
    color: #1C252E;
}

.chat-link {
    font-size: 0.96rem;
    font-weight: bold;
    margin-left: 3px;
    color: #057fd7;
    text-decoration: none;
}

.chat-link:hover {
    text-decoration: underline;
}

.length-counter {
    font-size: 0.83rem;
    color: #637381;
}

@media (max-width: 577px) {

    .chatbot-popup {
        right: 0;
        bottom: 0;
        height: 100%;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }

    #expand-chatbot {
        display: none;
    }

    .chatbot-popup .chat-header {
        padding: 14px 18px;
        font-size: 16px;
    }

    .chat-body {
        height: var(--height-expand);
        overflow-y: auto;
        /* padding: 10px; */
    }

    .chat-form {
        padding: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .chat-form textarea {
        flex: 1;
        padding: 10px;
        font-size: 14px;
        border-radius: 6px;
    }

     #chatbot-toggler {
        right: 44px;
    }

    .ir-arriba {
        right: 150px;
    }

    .ir-alianza {
        right: 97px;
    }
}