* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.chatbox {
    font-family: "Nunito", sans-serif;
    font-weight: 400;
    font-size: 16px !important;
}

html {
    --primaryGradient: linear-gradient(93.12deg, #581b98 0.52%, #9c1de7 100%);
    --secondaryGradient: linear-gradient(
        268.91deg,
        #581b98 -2.14%,
        #9c1de7 99.69%
    );
    --primaryBoxShadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
    --secondaryBoxShadow: 0px -10px 15px rgba(0, 0, 0, 0.1);
    --primary: #581b98 !important;
}

.chatbox {
    position: fixed;
    bottom: 30px;
    right: 30px;
}

#chat {
    background: #e0e0e0;
    color: white;
    padding: 10px;
    border-radius: 10px;
    width: 90%;
}

#chat2 {
    margin-top: 40px;
    margin-left: 10%;
    color: white;
    padding: 10px;
    border-radius: 10px;
    width: 90%;
    text-align: center;
}

.chatbox__support {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    width: 31vw;
    height: 80vh;
    z-index: -123456;
    opacity: 0;
    transition: all 0.5s ease-in-out;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

/* CONTENT IS OPEN */
.chatbox--active {
    transform: translateY(-40px);
    z-index: 123456;
    opacity: 1;
}

/* BUTTON */
.chatbox__button {
    text-align: right;
}

.send__button {
    padding: 6px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}

/* HEADER */
.chatbox__header {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: var(--primaryGradient);
    padding: 10px 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: var(--primaryBoxShadow);
}

.chatbox__image--header {
    margin-right: 10px;
}

.chatbox__heading--header {
    font-size: 1.2rem;
    color: white;
}

.chatbox__description--header {
    font-size: 0.9rem;
    color: white;
}

/* MESSAGES */
.chatbox__messages {
    padding: 0 20px;
    margin-top: auto;
    display: flex;
    overflow-y: scroll;
    flex-direction: column-reverse;
}

.chatbox__messages::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
}

.chatbox__messages::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 2px solid white;
    background-color: rgba(0, 0, 0, 0.5);
}

.messages__item {
    margin-top: 10px;
    padding: 8px 12px;
    max-width: 70%;
    background: #e0e0e0;
}

.messages__item--operator {
    background: var(--primary);
    color: white;
    margin-left: auto;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

.messages__item--visitor,
.messages__item--typing {
    margin-right: auto;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* FOOTER */
.chatbox__footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--secondaryGradient);
    box-shadow: var(--secondaryBoxShadow);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    margin-top: 20px;
}

.chatbox__footer input {
    width: 80%;
    border: none;
    padding: 10px;
    border-radius: 30px;
    text-align: left;
}

.chatbox__send--footer {
    color: white;
}

.chat-btn,
#chat-btn {
    font-size: medium;
    background: var(--primary);
    color: white;
    padding: 10px;
    border-radius: 10px;
    margin: 5px;
    cursor: pointer;
    width: 95%;
}

.chatbox__button button,
.chatbox__button button:focus,
.chatbox__button button:visited {
    padding: 10px;
    background: white;
    border: darkblue 5px solid;
    border-radius: 50px;
    box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* RESPONSIVE DESIGN */

@media screen and (max-width: 768px) {
    .chatbox {
        bottom: 20px;
        right: 20px;
    }

    .chatbox__support {
        width: 65vh;
        height: 70vh;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    .chatbox__heading--header {
        font-size: 1rem;
    }

    .chatbox__description--header {
        font-size: 0.8rem;
    }

    .chatbox__footer input {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 85%;
    }

    .chatbox__support {
        width: 90vw;
        height: 80vh;
        margin-left: 5vw;
        padding: 0;
    }

    .chatbox__messages {
        padding-left: 10px;
    }

    .chatbox__header,
    .chatbox__footer {
        padding: 5px;
    }

    .chatbox__heading--header {
        font-size: 0.9rem;
    }

    .chatbox__description--header {
        font-size: 0.7rem;
    }

    .chatbox__footer input {
        width: 100%;
    }

    .chat-btn,
    #chat-btn {
        font-size: 85%;
    }

    svg {
        width: 50px;
        height: 50px;
    }
}


.chatbox__support {
    position: fixed;
    bottom: 4rem;
    right: 1rem;
}