* {
    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, #428DFF 0.52%, #428DFF 100%);
    --secondaryGradient: linear-gradient(268.91deg, #fff -2.14%, #fff 99.69%);
    --primaryBoxShadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
    --secondaryBoxShadow: 0px -10px 15px rgba(0, 0, 0, 0.1);
    --primary: #FFA85A;
}

/* CHATBOX
=============== */
.chatbox {
    position: absolute;
    bottom: 30px;
    right: 30px;
}

/* CONTENT IS CLOSE */
.chatbox__support {
    display: flex;
    flex-direction: column;
    background: #eee;
    width: 300px;
    height: 650px;
    z-index: -123456;
    opacity: 0;
    transition: all .5s ease-in-out;
}

/* CONTENT ISOPEN */
.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 {
    position: sticky;
    top: 0;
    background: orange;
}

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

.messages__item {
    margin-top: 10px;
    padding: 8px 12px;
    max-width: 70%;
    width: fit-content;
}

.messages__item--operator {
    margin-left: auto;
}

.messages__item--visitor {
    margin-right: auto;
}

/* FOOTER */
.chatbox__footer {
    position: sticky;
    bottom: 0;
}

.chatbox__support {
    background: #f9f9f9;
    height: 650px;
    width: 450px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

/* HEADER */
.chatbox__header {
    background: var(--primaryGradient);
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: left;
    padding: 15px 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: .9rem;
    color: white;
}

/* Messages */
.chatbox__messages {
    padding: 0 20px;
}

.messages__item-visitor {
    margin-top: 10px;
    padding: 8px 12px;
    max-width: 100%;
    display: flex;
}

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

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

.visitor-img {
    flex: 1; /* Adjust as needed */
    max-width: 15%;
}
.visitor-text {
    flex: 3;
    margin-left: 10px;
    max-width: 90%;
    background: #E0E0E0;
    padding: 8px 12px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}
.visitor-text ol {
    padding-left: 2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.more_link {
    margin-top: 5px;
}

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

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

.chatbox__send--footer {
    color: white;
}

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

/* Add responsive styles for mobile devices */
@media (max-width: 768px) {
    .chatbox {
        position: fixed; /* Fixed position to stay in view on scroll */
        bottom: 10px; /* Adjusted for mobile spacing */
        right: 10px;
        width: calc(100% - 20px); /* Full width with some padding */
    }

    .chatbox__support {
        width: 100%; /* Full width for mobile */
        height: calc(100vh - 20px); /* Full viewport height with some padding */
        border-radius: 10px; /* Smaller border radius for mobile */
    }

    .chatbox__header,
    .chatbox__footer {
        padding: 10px; /* Reduced padding for mobile */
    }

    .chatbox__messages {
        padding: 0 10px; /* Reduced side padding for mobile */
    }

    .chatbox__footer input {
        width: 90%; /* Adjust input width to leave space for send button */
    }

    .chatbox__button button {
        width: 48px; /* Fixed width for send button */
        height: 48px; /* Fixed height for send button */
        padding: 0; /* Remove padding */
        border-radius: 50%; /* Circular button */
    }
}

/* Additional styles for smaller mobile screens */
@media (max-width: 480px) {
    .chatbox {
        bottom: 5px; /* Less spacing from the bottom */
        right: 5px;
        width: calc(100% - 10px); /* Full width with less padding */
    }

    .chatbox__support {
        height: calc(100vh - 10px); /* Full viewport height with less padding */
    }
}
