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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 100%;
    background: #F1F1F1;
}

*, 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;
}

.chatbox {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chatbox__support {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    width: 350px;
    height: 450px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    opacity: 0;
    transition: all 0.5s ease-in-out;
    overflow: hidden;
}

.chatbox--active {
    opacity: 1;
    transform: translateY(-40px);
    z-index: 123456;
}

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

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

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

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

.close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.chatbox__messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
}

.messages__item {
    margin-top: 10px;
    padding: 8px 12px;
    max-width: 70%;
    border-radius: 20px;
    word-wrap: break-word;
}

.messages__item--visitor {
    background: #E0E0E0;
    margin-right: auto;
    border-bottom-right-radius: 0;
}

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

.chatbox__footer {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--secondaryGradient);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    box-shadow: var(--secondaryBoxShadow);
}

.chatbox__footer input {
    width: 80%;
    padding: 10px;
    border: none;
    border-radius: 30px;
    margin-right: 10px;
}

.chatbox__send--footer {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

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

@media (max-width: 600px) {
    .chatbox__support {
        width: 100%;
        height: 80vh;
        border-radius: 0;
    }
    .chatbox__header {
        border-radius: 0;
    }
    .chatbox__footer {
        border-radius: 0;
    }
    .close-btn {
        margin-right: 10px;
    }
}