@import "https://fonts.googleapis.com/css?family=Noto+Sans";

.floating-chat * {
    box-sizing: border-box;
}

.floating-chat {
    font:
        14px/16px "Noto Sans",
        sans-serif;

    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    transform: translateY(70px);
    transition: all 250ms ease-out;
    border-radius: 50% !important;
    opacity: 0;
    background: linear-gradient(
        -45deg,
        #183850 0,
        #183850 25%,
        #192c46 50%,
        #22254c 75%,
        #22254c 100%
    );
    background-repeat: no-repeat;
    background-attachment: fixed;

    i {
        font-size: 24px;
    }
}
.floating-chat.enter:hover {
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.19),
        0 6px 6px rgba(0, 0, 0, 0.23);
    opacity: 1;
}
.floating-chat.enter {
    transform: translateY(0);
    opacity: 0.6;
    box-shadow:
        0px 1px 3px rgba(0, 0, 0, 0.12),
        0px 1px 2px rgba(0, 0, 0, 0.14);
}
.floating-chat.expand {
    width: 350px;
    max-height: 450px;
    height: 450px;
    border-radius: 5px !important;
    cursor: auto;
    opacity: 1;
}
.floating-chat :focus {
    outline: 0;
    box-shadow: 0 0 3pt 2pt rgba(14, 200, 121, 0.3);
}
.floating-chat button {
    background: transparent;
    border: 0;
    color: white;
    text-transform: uppercase;
    border-radius: 3px !important;
    cursor: pointer;
}
.floating-chat .chat {
    display: flex;
    flex-direction: column;
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    border-radius: 50% !important;
    transition: all 250ms ease-out;
    margin: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.floating-chat .chat.enter {
    opacity: 1;
    border-radius: 0 !important;
    margin: 10px;
    width: auto;
    height: auto;
}

.floating-chat .chat .header {
    height: unset;
    flex-shrink: 0;
    padding-bottom: 10px;
    display: flex;
    background: transparent;

    .title {
        font-size: 16px;
        flex-grow: 1;
        flex-shrink: 1;
        padding: 0 5px;
    }

    button {
        flex-shrink: 0;
    }
}

.floating-chat .language-selector {
    display: grid;
    grid-auto-flow: column;
    column-gap: 14px;
    place-content: center;
    height: 28px;
    padding-bottom: 7px;

    input[type="radio"] {
        display: none;
    }

    label {
        padding: 4.5px 7px;
        background-color: rgba(25, 147, 147, 0.2);
        color: #0ec879;
        text-align: center;

        border: 2px solid transparent;
        border-radius: 4.5px !important;

        transition: border-color ease-in-out 200ms;
        cursor: pointer;

        &:focus-within {
            border-color: #0ec87980;
        }

        &:has(input[type="radio"]:checked) {
            border-color: #0ec879;
        }
    }
}

.floating-chat .chat .messages {
    padding: 10px;
    margin: 0;
    list-style: none;
    overflow-y: scroll;
    overflow-x: hidden;
    flex-grow: 1;
    border-radius: 4px !important;
    background: transparent;

    &::-webkit-scrollbar {
        width: 5px;
    }
    &::-webkit-scrollbar-track {
        border-radius: 5px !important;
        background-color: rgba(25, 147, 147, 0.1);
    }
    &::-webkit-scrollbar-thumb {
        border-radius: 5px !important;
        background-color: rgba(25, 147, 147, 0.2);
    }
}

.floating-chat .chat .messages li {
    position: relative;
    clear: both;
    display: inline-block;
    padding: 14px;
    margin: 0 0 20px 0;
    font:
        14px/16px "Noto Sans",
        sans-serif;
    border-radius: 10px !important;
    background-color: rgba(25, 147, 147, 0.2);
    word-wrap: break-word;
    white-space: pre-wrap;
    max-width: 81%;
}
.floating-chat .chat .messages li:before {
    position: absolute;
    top: 0;
    width: 35px;
    height: 35px;
    border-radius: 35px !important;
    content: "";
    background-size: cover;
}
.floating-chat .chat .messages li:after {
    position: absolute;
    top: 10px;
    content: "";
    width: 0;
    height: 0;
    border-top: 10px solid rgba(25, 147, 147, 0.2);
}

.floating-chat .chat .messages li.user {
    animation: show-chat-even 0.15s 1 ease-in;
    float: right;
    margin-right: 55px;
    color: #0ad5c1;

    &:before {
        right: -55px;
        background-image: url(https://github.com/Thatkookooguy.png);
    }

    &:after {
        border-right: 10px solid transparent;
        right: -10px;
    }
}

.floating-chat .chat .messages li.bot {
    animation: show-chat-odd 0.15s 1 ease-in;
    float: left;
    margin-left: 55px;
    color: #0ec879;

    &:before {
        left: -55px;
        /* background-image: url(https://github.com/ortichon.png); */
        background-image: url(./bot.png);
    }

    &:after {
        border-left: 10px solid transparent;
        left: -10px;
    }
}

.floating-chat .chat .floating-chat-footer {
    display: grid;
    grid-template-columns: 32px auto 50px;
    column-gap: 10px;
    flex-shrink: 0;
    padding-top: 10px;
    max-height: 90px;
    background: transparent;

    #voiceInput {
        width: 32px;
        height: 32px;
        border-radius: 50% !important;
        background-color: rgba(25, 147, 147, 0.2);
        place-self: center;

        &.recording {
            color: #dc362e;
        }

        i {
            font-size: 14px;
        }
    }
}
.floating-chat .chat .floating-chat-footer .text-box {
    border-color: gray;
    border-radius: 3px !important;
    background: rgba(25, 147, 147, 0.2);
    min-height: 100%;
    width: 100%;
    margin-right: 5px;
    color: #0ec879;
    overflow-y: auto;
    padding: 5px;
    resize: none;
    font-size: 14px;

    &::-webkit-scrollbar {
        width: 5px;
    }
    &::-webkit-scrollbar-track {
        border-radius: 5px !important;
        background-color: rgba(25, 147, 147, 0.1);
    }
    &::-webkit-scrollbar-thumb {
        border-radius: 5px !important;
        background-color: rgba(25, 147, 147, 0.2);
    }
}

@keyframes show-chat-even {
    0% {
        margin-left: -480px;
    }
    100% {
        margin-left: 0;
    }
}

@keyframes show-chat-odd {
    0% {
        margin-right: -480px;
    }
    100% {
        margin-right: 0;
    }
}
