/* Chat Bot  */
.chatbot-toggler {
    position: fixed;
    z-index: 1001;
    right: 20px;
    bottom: 30px;
    height: 65px;
    width: 65px;
    font-size: 26px;
    color: #272974;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none;
    outline: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(38, 38, 38, 0.5);
    transition: all 0.2s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    20% {
        transform: translateY(-10px);
    }

    40% {
        transform: translateY(5px);
    }

    60% {
        transform: translateY(-5px);
    }

    80% {
        transform: translateY(2px);
    }
}

@keyframes popUp {
    0% {
        transform: scale(0);
        opacity: 0;
        visibility: visible;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
        visibility: visible;
    }
}

#intro-msg {
    display: none;
    /* Hide chat icon on mobile */
    position: fixed;
    z-index: 100;
    bottom: 30px;
    right: 95px;
    height: 60px;
    width: 155px;
    font-size: 18px;
    background-color: #f2f2f2;
    padding: 10px 6px;
    border-radius: 15px;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 490px) {
    #intro-msg {
        display: flex;
        /* Show chat icon on larger screens */
    }
}

#intro-msg::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent transparent #f2f2f2;
}

#intro-msg .chatbot-profile {
    margin: 0px;
}

#intro-msg p {
    margin: 0px 0px 0px auto;
}

.hide-intro-msg {
    display: none !important;
}

.show-chatbot .chatbot {
    animation: bounce 0.4s ease;
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.show-chatbot .chatbot-toggler {
    transform: rotate(90deg);
}

.show-chatbot button.chatbot-toggler {
    display: none !important;
}

.chatbot-toggler span {
    position: absolute;
}

.show-chatbot .chatbot-header span.fa-xmark {
    display: block;
    position: absolute;
    top: 16px;
    right: 16px;
    transform: none;
    cursor: pointer;
    color: #ffffff;
    font-size: 20px;
    z-index: 1002;
}

.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child {
    opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}

.chatbot {
    position: fixed;
    z-index: 1001;
    right: 20px;
    bottom: 10px;
    border-radius: 15px;
    width: 420px;
    transform: scale(0.5);
    background-color: #ffffff;
    box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
        0 32px 64px -48px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
    transition: all 0.1s ease;
}

.response-loader {
    width: 12px;
    height: 12px;
    margin: 6px 16px;
    background: #272974;
    border-radius: 50%;
    box-shadow: 20px 0 #1d2b2e22, -20px 0 #272974;
    animation: d5 1s infinite linear alternate;
}

@keyframes d5 {
    0% {
        box-shadow: 20px 0 #272974, -20px 0 #1d2b2e22;
        background: #272974;
    }

    33% {
        box-shadow: 20px 0 #272974, -20px 0 #1d2b2e22;
        background: #1d2b2e22;
    }

    66% {
        box-shadow: 20px 0 #1d2b2e22, -20px 0 #272974;
        background: #1d2b2e22;
    }
}

.show-chatbot .chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-header {
    background-color: #272974;
    padding: 16px 16px;
    margin: -1px;
    text-align: center;
    border-radius: 14px 14px 0px 0px;
    position: relative;
}

.chatbot-header h2 {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.25;
    margin: 0 16px;
    padding: 0 56px;
}

.chatbot-header span {
    position: absolute;
    right: 20px;
    top: 50%;
    color: #ffffff;
    cursor: pointer;
    display: none;
    transform: translateY(-50%);
}

.chatbox {
    height: 400px;
    overflow-y: auto;
    padding: 30px 20px 100px;
}

.chat {
    display: flex;
    justify-content: flex-start;
}

.chat p {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    color: #ffffff;
    font-size: 14px;
    max-width: 100%;
    text-align: left;
    white-space: normal;
    padding: 10px 20px;
    border-radius: 10px 10px 0 10px;
    background: #272974;
    overflow-wrap: break-word;
}

.incoming p {
    color: #000;
    background: #f2f2f2;
    border-radius: 10px 10px 10px 0;
}

.chatbot-profile {
    background-image: url(/assets/images/Elle.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.incoming span {
    min-height: 42px;
    min-width: 42px;
    color: #ffffff;
    align-self: flex-end;
    text-align: center;
    line-height: 32px;
    border-radius: 4px;
    margin: 0 10px 7px 0;
}

.outgoing {
    margin: 20px 0;
    justify-content: flex-end;
}

.chat-input {
    position: absolute;
    display: flex;
    gap: 5px;
    bottom: 0;
    width: 100%;
    background: #ffffff;
    padding: 0px 12px;
    border-radius: 0px 0px 14px 14px;
    border-top: 1px solid #ccc;
}

.chat-input textarea {
    font-family: "Roboto", sans-serif;
}

.chat-input textarea {
    height: 55px;
    max-height: 150px;
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    resize: none;
    overflow-y: hidden;
    padding: 16px 15px 16px 0;
}

.chat-input span {
    height: 42px;
    line-height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0px 0px 6px 0px;
    padding: 10px 14px;
    border-radius: 5px;
    align-self: flex-end;
    color: #ffffff;
    background-color: #272974;
    font-size: 18px;
    cursor: pointer;
    visibility: hidden;
}

.chat-input textarea:valid~span {
    visibility: visible;
}

@media (max-width: 490px) {

    .chatbot-toggler {
        bottom: 15px;
        display: none;
    }

    .chatbot {
        right: 0;
        bottom: 50;
        width: 100%;
        height: 85%;
        border-radius: 0;
    }

    .chatbot .chatbox {
        height: 90%;
    }

    .chatbot-header,
    .chat-input {
        border-radius: 0;
    }

    .chatbot-header span {
        display: block;
    }

    #intro-msg {
        display: none;
    }

    .show-chatbot .chatbot {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: 100% !important;
        height: 100% !important;

        border-radius: 0 !important;
        box-shadow: none !important;

        transform: scale(1);
        opacity: 1;
        pointer-events: auto;
    }
}