:root {
    --color-darkgrey: #5f5d5d;
    --color-lightgrey: #ebebeb;
    --color-transgrey: #5f5d5d23;
    --color-red: #ff4550;
    --color-green: #1170aa;
    --color-brightblue: #0a76ff;
    --color-greyblue: #a5bddc;
    --color-transwhite: rgba(255, 255, 255, 0.97);
    --color-transred: rgba(255, 69, 80, 0.85);
}


.chat-context {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    padding: 1em;
    box-sizing: border-box;
    font-family: 'Avenir',helvetica,arial,sans-serif;
    padding-top: 0em;
}

#chat {
    flex: 1 1 0;
    overflow-y: scroll;
    padding-left: 2.5em;
    padding-right: 2.5em;
    box-sizing: border-box;
    /*overflow-y: auto;
    max-height: 400px;
    min-height: 350px;*/
    height: 350px;
}
#chat::-webkit-scrollbar, #ui-options::-webkit-scrollbar {
    width: 0 !important;
}
.button {
    cursor: pointer;
}
.chat-response {
    max-width: 100%;
    opacity: 0;
    padding: 1em;
    border-radius: 15px 15px 0px 15px;
    background-color: var(--color-green);
    text-align: left;
    margin-right: 0;
    margin-left: auto;
    margin-top: 1em;
    margin-bottom: 1em;
    position: relative;
    color: var(--color-transwhite);
    width: fit-content;
}
    .chat-response p {
        margin: 0;
        font-size: 15px;
        line-height: 1.5;
    }
.chat-response.robot {
    background-color: var(--color-lightgrey);
    border-radius: 15px 15px 15px 0px;
    text-align: left;
    margin-right: auto;
    margin-left: 0;
    color: var(--color-darkgrey);
}
.chat-response:after {
    content: "";
    width: 2em;
    height: 2em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: absolute;
    bottom: -1.5em;
    left: -2.5em;
    font-size: 1em;
}
.chat-response.user:after {
    content: "";
    left: auto;
    right: -2.5em;
}

#ui-response {
    height: 60px;
    max-height: 60px;
    position: relative;
    transition: all .5s ease-out;
    -webkit-transition: all .5s ease-out;
    -moz-transition: all .5s ease-out;
}
#ui-response.full-submit #response-text {
    display: none;
}
#ui-response.full-submit #ui-submit {
    width: 100%;
}
#ui-response.hide {
    overflow: hidden;
    animation: hide .5s forwards;
    -webkit-animation: hide .5s forwards;
    -moz-animation: hide .5s forwards;
}
@keyframes hide {
    0% {
        opacity: 1;
    }
    99.9999% {
        opacity: 0;
        max-height: 60px;
    }
    100% {
        max-height: 0em;
    }
}

#ui-submit {
    width: 60px;
    height: 60px;
    background-color: var(--color-green);
    color: var(--color-transwhite);
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border-bottom-right-radius: 10px;
}
#response-text {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding-left: 1em;
    border: 1px solid var(--color-lightgrey);
    transition: all .5s ease-in;
    -webkit-transition: all .5s ease-in;
    -moz-transition: all .5s ease-in;
    color: var(--color-darkgrey);
    font-size: 16px;
    text-align: left;
    direction: ltr;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding-right: 70px;
}
/*[dir=rtl] #response-text {
    padding-right: 1em;
    padding-left: 70px;
}*/
    #response-text:focus {
        outline: none;
        box-shadow: 0 0 15px var(--color-lightgrey);
    }
#response-text.invalid {
    background-color: var(--color-transred);
    color: var(--color-transwhite);
}
#ui-options {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 1em;
    /*overflow-x: scroll;*/
}
#ui-options:empty {
    padding: 0em;
}
.ui-option {
    border-radius: 3px;
    border: 1px solid var(--color-green);
    padding: 3px 6px;
    margin-right: .5em;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transition: background-color .2s ease-in;
    color: var(--color-darkgrey);
    margin-bottom: 7px;
}
.ui-option:hover, .ui-option.selected {
    background-color: var(--color-green);
    color: #FFF;
}
.ui-option:last-child {
/*    margin: 0;*/
}
.ui-option p {
    margin: 0;
    font-size:15px;
}
.ui-option .subtext {
    color: var(--color-greyblue);
    font-size: .85em;
}
.ui-option:hover .subtext, .ui-option.selected .subtext {
    color: var(--color-transwhite);
}
.ui-option.filtered-out {
    display: none;
}
#ui-control > * {
    opacity: 1;
    transition: opacity 1s ease-in-out, max-height 1s ease-in-out;
    -moz-transition: opacity 1s ease-in-out, max-height 1s ease-in-out;
    -webkit-transition: opacity 1s ease-in-out, max-height 1s ease-in-out;
}
#ui-control .hidden {
    opacity: 0;
    -webkit-transition: background 0s;
    -moz-transition: background 0s;
    -ms-transition: background 0s;
    -o-transition: background 0s;
    transition: background 0s;
}


.loader {
    border: 16px solid #f3f3f3;
    border-top: 16px solid var(--color-green);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    margin: auto;
    animation: spin 2s linear infinite;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


@media (max-width: 600px) {
    .chat-context {
        padding: 0em;
    }
    #chat {
        padding: 1.25em;
        padding-bottom: 0em;
    }
    .chat-response.user:after {
        right: -1em;
    }
    .chat-response:after {
        left: -1em;
        bottom: -1em;
    }
}
/* Chat header */
#chat-header {
    background: #1170aa;
    color: #fff;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border-radius: 10px 10px 0 0;
}

/* Chat body (scrollable) */
#chat-context .cb-body {
    flex: 1;
    height: 400px; /* fixed height for chat body */
    overflow-y: auto; /* scroll when content grows */
    padding: 10px;
    background: #fafafa;
}

    /* Scrollbar style (optional) */
    #chat-context .cb-body::-webkit-scrollbar {
        width: 6px;
    }

    #chat-context .cb-body::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 5px;
    }

#chat-context {
    position: fixed;
    bottom: 20px;
    left: 6%;
    width: 500px;
    /*max-height: 500px;*/ /* overall height */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    padding: 0;
    flex-direction: column;
    /*overflow: hidden;*/
    z-index: 9999;
}
[dir=rtl] #chat-context {
    left: auto;
    right: 6%;
}
.ui-option:last-child p {
    margin: 0;
    font-size: 15px;
}
/*[dir=rtl] #chat-context {
    right: auto;
    left: 6%;
}*/
[dir=rtl] #ui-submit {
    right: auto;
    left: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 10px;
}
[dir=rtl] #response-text {
    padding-right: 1em;
    padding-left: 70px;
    text-align: right;
}
#ui-control #ui-options {
    height:auto;
    overflow: scroll;
}
.chatbot_btn {
    position: fixed;
    width: 50px;
    height: 50px;
    bottom: 80px;
    left: 15px;
    z-index: 10;
}
.chatbot_btn a {
    background: #fff;
    display: block;
    border-radius: 100%;
}
[dir=rtl] .chatbot_btn {
    left: auto;
    right: 15px;
}