﻿* {
    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, #7239ea 0.52%, #9C1DE7 100%);
    --secondaryGradient: linear-gradient(268.91deg, #7239ea -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: #7239ea;
}

@keyframes animated_bg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* CHATBOX
=============== */
.chatbox {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

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

@media (max-width: 600px) {
    .chatbox__support {
        width: 90%; /* Take up most of the width on small screens */
        height: auto;
        display: none;
        bottom: 10px;
        right: 10px;
    }
}


/* CONTENT ISOPEN */
.chatbox--active {
    transform: translateY(-40px);
    z-index: 9999;
    opacity: 1;

}

/* BUTTON */
.chatbox__button {
    position: fixed;
    width: 50px;
    height: 50px;
    bottom: 30px; /* Default position */
    right: 30px;
    z-index: 9999;
    transition: bottom 0.3s ease; /* Smooth movement */
}

/* When chatbox is active, move the button down slightly */
.chatbox--active + .chatbox__button {
    bottom: 5px; /* Adjust to move it down a bit more when chatbox is active */
}

.chatbox__button button {
    z-index: 9999;
    cursor: pointer;
}

.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;
}


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


/* HEADER */
.chatbox__header {
    position: sticky;
    top: 0;
    background: orange;
}

/* MESSAGES */
.chatbox__messages {
    padding: 5px;
    margin-top: auto;
    display: flex;
    overflow-y: scroll;
    flex-direction: column-reverse;
    word-wrap: break-word; 
    
}

/* Ensure proper padding for ordered lists */
.chatbox__messages ol {
    list-style-type: decimal; /* Ensure ordered lists use decimal numbers */
    padding-left: 5px;  
    list-style-position: inside; /* Ensures the numbers are within the padding */
}

/* Additional styling for list items */
.chatbox__messages li {
    margin-bottom: 5px;  /* Adds space between list items */
    word-wrap: break-word; /* Prevents long text from overflowing */
}

.messages__item {
    background: orange;
    max-width: 60.6%;
    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: 450px;
    width: 350px;
    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: center;
    justify-content: center;
    padding: 15px 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: var(--primaryBoxShadow);
}

.chatbox__heading--header {
    font-size: 1.2rem;
    color: white;
    font-weight: bold; /* Make the header text bold */
}

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

.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 {
    margin-top: auto;
    display: flex;
    overflow-y: scroll;
    flex-direction: column; 
}


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

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

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

/* 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;
}
/* Stop Button (Matches Send Button Styling) */
.stop__button {
    color: white;
    background: var(--primary);
    padding: 6px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-left: 10px; /* Add some spacing between the send and stop buttons */
    display: none; /* Initially hidden */
    font-weight: bold;
}

/* FOOTER (Ensures buttons align properly) */
.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;
}

/* FOOTER INPUT */
.chatbox__footer input {
    width: 60%; /* Adjusted to make room for both buttons */
    border: none;
    padding: 10px 10px;
    border-radius: 30px;
    text-align: left;
}

/* Send Button */
.chatbox__send--footer {
    color: white;
    background: var(--primary);
    padding: 6px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-left: 10px;
}

/* Initially, make the form non-interactive and invisible */
#user-form {
    opacity: 0;
    pointer-events: none;  /* Disable interaction */
    transition: opacity 0.5s ease; /* Add transition for smooth appearance */
}

/* When the chatbox is active, make the form visible and interactive */
.chatbox--active #user-form {
    opacity: 1;
    pointer-events: auto; /* Enable interaction */
}
.chatbox__user-form {
    padding: 10px; /* Adjust padding to fit better within the container */
    background: white;
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
    margin: 0 auto; /* Center the form horizontally */
    box-sizing: border-box;
    width: 90%; /* Ensure the form stays within the chatbox */
}

.chatbox__user-form h3 {
    text-align: center; /* Center align the heading */
    margin-bottom: 10px; /* Add some space below the heading */
    color: #333; /* Slightly darker color for better readability */
    font-size: 1.1rem;
    font-weight: bold
}


.chatbox__user-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333; /* Same color as the heading */
}

.chatbox__user-form input {
    width: 100%;
    padding: 6px;
    margin-bottom: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.chatbox__user-form button {
    width: 100%;
    padding: 10px;
    background: var(--primaryGradient);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chatbox__user-form button:hover {
    background: var(--secondaryGradient); /* Change the button color on hover */
}
