:root {
    --green: #6EB546;
    --green-dark: #11533d;
    --text: #000000;
    --text-light: #ffffff;
    --white: #ffffff;
    --black: #000000;
    --text-bg: #DCF8C6;
}

.a21chat {
    position: relative;

    ::-webkit-scrollbar {
        width: 5px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--green-dark);
        border-radius: 5px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--green-dark);
    }

    .a21chat-icon {
        position: fixed;
        bottom: 30px;
        right: 30px;
        cursor: pointer;
        z-index: 99;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 8px 16px;
        border-radius: 50px;
        background-color: var(--green);
        border: 1px solid #fff;
        color: var(--text-light);
        font-size: 16px;
        line-height: 100%;
        font-weight: 500;
        transition: all 0.3s ease;
        outline: none;
        box-shadow: none;

        img {
            height: 16px;
            margin-right: 6px;
        }

        &:hover {
            background-color: var(--green-dark);
            border-color: var(--green-dark);
            transform: scale(0.95);
        }
    }

    .a21chat-header {
        display: flex;
        align-items: center;
        background-color: var(--green-dark);
        padding: 12px;
        min-height: 65px;
        
        .a21chat-header-icon {
            background-color: var(--white);
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 4px;
            height: 35px;
            width: 35px;
            margin-right: 16px;

            img {
                height: 16px;
                width: auto;
            }
        }

        .a21chat-header-content {
            color: var(--text-light);

            h2 {
                color: var(--text-light);
                margin: 0;
                font-size: 16px;
                line-height: 140%;
            }

            p {
                color: var(--text-light);
                margin: 0;
                font-size: 12px;
                line-height: 140%;
                padding: 0;
            }
        }
    }

    .a21chat-close {
        border: 1px solid var(--text-light);
        border-radius: 50%;
        color: var(--text-light);
        font-size: 16px;
        line-height: 100%;
        transition: all 0.3s ease;
        cursor: pointer;
        height: 24px;
        width: 24px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: auto;

        &:hover {
            transform: scale(0.95);
        }
    }

    .a21chat-back {
        color: var(--text-light);
        font-size: 16px;
        transform: scaleY(2.5);
        line-height: 100%;
        transition: all 0.3s ease;
        cursor: pointer;
        height: 24px;
        width: 24px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 12px;

        &:hover {
            transform: scaleY(2);
        }
    }

    .area-visivel {
        position: fixed;
        bottom: 70px;
        right: 30px;
        opacity: 0;
        z-index: -1;
        overflow: hidden;
        transition: all 0.1s ease;
        min-width: 350px;

        &.active {
            opacity: 1;
            z-index: 9999;
        }
    }

    .a21chat-content {
        background-color: #E5DDD5;
        padding: 0;
        height: 470px;

        .messages {
            display: flex;
            flex-direction: column;
            height: 100%;
            padding: 12px;
            background-image: url('bg.svg');
            background-size: 185px;
            overflow-y: auto;

            .message-item {
                background-color: var(--white);
                border: none;
                border-radius: 12px;
                padding: 12px;
                color: var(--black);
                display: flex;
                align-items: center;
                margin-bottom: 12px;
                transition: all 0.3s ease;
                cursor: pointer;
                font-size: 14px;
                line-height: 130%;
                word-break: break-word;

                a {
                    color: var(--green-dark);

                    &:hover {
                        color: var(--black);
                    }
                }

                &:hover {
                    transform: scale(0.99);
                    background-color: #eeeeee;
                }

                &:first-of-type {
                    border-top-left-radius: 0;
                    width: fit-content;

                    &:hover {
                        transform: scale(1);
                        cursor: default;
                    }
                }

                &:last-of-type {
                    margin-bottom: 0;
                }

                &.bot {
                    margin-right: 20px;
                    border-top-left-radius: 0;
                }

                &.human {
                    background-color: var(--text-bg);
                    margin-left: 20px;
                    margin-right: 0;
                    border-top-right-radius: 0;
                }

                &.form {
                    margin-top: auto;
                    background-color: transparent;
                    padding: 0;

                    &:hover {
                        transform: scale(1);
                        cursor: default;
                    }

                    input {
                        width: 100%;
                        border: 1px solid var(--text-light);
                        border-radius: 12px;
                        padding: 8px;
                        margin-bottom: 12px;
                        outline: none;
                        box-shadow: none;
                        font-size: 12px;
                        line-height: 100%;

                        &::placeholder {
                            color: #aaaaaa;
                        }
                    }

                    textarea {
                        width: 100%;
                        height: 140px;
                        border: 1px solid var(--text-light);
                        border-radius: 12px;
                        padding: 8px;
                        margin-bottom: 12px;
                        outline: none;
                        box-shadow: none;
                        font-size: 12px;
                        line-height: 100%;
                        resize: none!important;
                        -webkit-resize: none!important;
                        overflow: auto;
                        position: relative;

                        &::placeholder {
                            color: #aaaaaa;
                        }
                    }

                    button {
                        border: 1px solid var(--green);
                        background-color: var(--green);
                        border-radius: 12px;
                        color: var(--text-light);
                        font-size: 16px;
                        line-height: 16px;
                        padding: 8px 16px;
                        width: 100%;
                        transition: all 0.3s ease;
                        cursor: pointer;
                        outline: none;
                        box-shadow: none;

                        &:hover {
                            transform: scale(0.99);
                            background-color: var(--green-dark);
                            border-color: var(--green-dark);
                        }
                    }
                }

                .contact-wrapper {
                    height: 35px;
                    width: 35px;
                    margin: 0;
                    margin-right: 12px;
                    border-radius: 50%;
                    overflow: hidden;

                    img {
                        object-fit: cover;
                        height: 100%;
                        width: 100%;
                    }
                }

                .contact-content {
                    margin-right: 12px;

                    .contact-name {
                        color: var(--black);
                        font-size: 16px;
                        line-height: 140%;
                        margin: 0;
                        padding: 0;
                    }

                    .contact-position {
                        color: #aaaaaa;
                        font-size: 12px;
                        line-height: 140%;
                        margin: 0;
                        padding: 0;
                    }
                }

                .contact-link {
                    margin-left: auto;
                    font-size: 16px;
                    transform: scaleY(2.5);
                }
            }
        }
    }

    .a21chat-body {
        position: relative;
        overflow: hidden;
        border-radius: 12px;
        background-color: var(--white);
        border: none;
    }

    .contact-card {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        overflow: hidden;
        border-radius: 12px;
        background-color: var(--white);
        border: none;
        transition: all 0.3s ease;
        transform: translateX(100%);
        z-index: -1;

        &.active {
            transform: translateX(0);
            z-index: inherit;
        }

        .a21chat-header {
            .a21chat-header-icon {
                padding: 0;
                overflow: hidden;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
        }

        .messages {
            .message-item {
                display: flex;
                flex-direction: column;
                align-items: start;
                justify-content: center;

                .phone {
                    height: 16px;
                    width: auto;
                    margin-right: 5px;
                }

                .phone-link {
                    display: flex;
                    align-items: center;
                }

                .disclaimer {
                    font-size: 12px;
                    color: #757575;
                }
            }

            &#chat-messages {
                .spacer {
                    margin-top: auto;
                }
                
                .message-item {
                    margin-bottom: 6px;
                }
            }
        }
    }
    
    .online {
        
        display: flex;
        align-items: center;

        .icon {
            position: relative;
            height: 20px;
            width: 20px;
            
            span {
                background-color: var(--green);
                border-radius: 50%;
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                height: 10px;
                width: 10px;

                &:first-of-type {
                    height: 7px;
                    width: 7px; 
                }

                &:last-of-type {
                    animation: myAnimation 2s linear infinite;
                }
            }
        }

        p {
            color: #757575;
            font-size: 12px;
            line-height: 140%;
            margin: 0;
            padding: 0;
        }
    }

    .input-chat {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 6px 12px 12px 12px;
        background-color: #E5DDD5;
        background-image: url('bg.svg');
        background-size: 185px;
        margin-right: 5px;

        label {
            position: absolute;
            height: 0;
            width: 0;
        }

        textarea {
            margin: 0;
            height: 100%;
            width: 100%;
            border-radius: 100px;
            padding: 10px 50px 10px 20px;
            border: none;
            outline: none;
            box-shadow: none;
            display: block;
            resize: none!important;
            -webkit-resize: none!important;
            overflow: auto;
            line-height: 120%;
        }

        span {
            position: absolute;
            top: calc(50% - 3px);
            right: 24px;
            transform: translateY(-50%);
            font-size: 20px;
            line-height: 100%;
            cursor: pointer;
            height: 30px;
            width: 30px;
            min-width: 30px;
            border-radius: 50%;
            background-color: var(--green-dark);
            color: var(--white);
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    #chat-messages {
        padding-bottom: 75px;
    }
}

@media (max-width: 767.99px) {
    .a21chat {
        .area-visivel {
            min-width: 100%;
            top: 0;
            bottom: 0;
            right: 0;
            left: 0;
        }

        .a21chat-body {
            height: 100%;
            border-radius: 0;

            .general {
                height: 100%;

                
            }
        }

        .a21chat-content {
            height: calc(100% - 65px);
        }

        .contact-card {
            border-radius: 0;
        }
    }
}

@keyframes myAnimation {
  0% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.75;
  }
  100% {
    opacity: 0.1;
  }
}