@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

.chatbot-toggler {
    width: 50px;
    height: 50px;
    background-color: var(--main-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 30px;
    bottom: 30px;
    border: 0;
    cursor: pointer;
    transition: background-color 0.4s;
    animation: scaleUp1 4s;
    animation-iteration-count: infinite;
    z-index: 9999;
    padding: 0;
}

@media (min-width: 2180px) {
    .chatbot-toggler {
        height: 50px !important;
    }
}

@keyframes scaleUp1 {
  0% {
    transform: scale(1);
  }
  7% {
    transform: scale(1.1);
  }
  14% {
    transform: scale(1);
  }
}
.chatbot-toggler img {
    animation: scaleUp2 6s;
    animation-iteration-count: infinite;
}
.chatbot-toggler div {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: var(--lorybot-chat-white); 
    background-size: 32px;         
    background-repeat: no-repeat;      
    background-position: center center; 
}
.chatbot-toggler div img {
    opacity: 0;
    transition: opacity 0.4s;
}
@keyframes scaleUp2 {
    0% {
    transform: scale(1);
    }
    7% {
    transform: scale(1.2);
    }
    14% {
    transform: scale(1);
    }
}

.chatbot-sseMessages, .chatbot-original_message{
    display: none;
}


#chatbot-container {
    position: fixed;
    right: 30px;
    bottom: 100px;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.1s, opacity 0.1s;
    transform-origin: bottom right;
}
#chatbot-container.active {
    transform: scale(1) !important;
    opacity: 1;
}
.chatbot {
    border-radius: 30px;
    border: 3px solid #fff;
    background-color: var(--main-color);
    height: 600px;
    max-height: calc(100vh - 110px);
    width: 380px;
    max-width: calc(100vw - 20px);
    display: flex;
    flex-direction: column;
    padding: 6px;
    z-index: 11111;
}
.chatbot .chatbot-header {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chatbot .chatbot-header .profile {
    display: flex;
    flex-direction: row;
}
.chatbot .chatbot-header .img {
    background-image: var(--profile-image-url); 
    background-size: contain;         
    background-repeat: no-repeat;      
    background-position: center center; 
    width: 35px;
}
.chatbot .chatbot-header .profile h5 {
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--title-color);
    margin: 0;
    font-family: "Poppins", sans-serif;
}
.chatbot .chatbot-header .profile p {
    font-weight: 400;
    font-size: 12px;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.73);
    margin: 0;
    font-family: "Poppins", sans-serif;

}

.chatbot .chatbot-header .profile .text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 12px;
}
.chatbot .chatbot-header .chatbot-close-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background-color: var(--main-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 0;
}
.chatbot .chatbot-header .chatbot-close-btn span {
    width: 15px;
    height: 2px;
    border-radius: 2px;
    display: block;
    background-color: #fff;
}
.chatbot .chatbot-content {
    flex: 1;
    background-color: var(--background-color);
    border-radius: 23px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.chatbot .chatbot-start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    transform: translateX(110%);
    transition: transform 0.4s;
}
.chatbot .chatbot-start-screen.active {
    transform: translateX(0);
}
.chatbot .chatbot-chat-screen {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(110%);
    transition: transform 0.4s;
}
.chatbot .chatbot-chat-screen.active {
    transform: translateX(0);
}
.chatbot .chatbot-profile {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--main-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot .chatbot-start-screen h4 {
    font-weight: 700;
    font-size: 24px;
    line-height: 120%;
    letter-spacing: -0.01em;
    text-align: center;
    color: #000;
    margin: 24px 0 10px 0;
}
.chatbot .chatbot-start-screen p {
    font-weight: 400;
    font-size: 12px;
    line-height: 137%;
    letter-spacing: -0.01em;
    text-align: center;
    color: #667085;
    margin: 0 0 12px 0;
}
.chatbot .chatbot-start-screen .start-chat-btn {
    border-radius: 50px;
    padding: 14px;
    width: 170px;
    height: 45px;
    background-color: var(--main-color);
    border: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 12px;
    line-height: 91%;
    letter-spacing: -0.01em;
    color: #fff;
    cursor: pointer;
}
.chatbot .chatbot-start-screen button img {
    margin-right: 12px;
}

.chatbot .chatbot-content .messages {
    overflow: auto;
    padding: 20px 10px;
    flex: 1;
}

.chatbot .chatbot-content .messages::-webkit-scrollbar {
    width: 5px;
    display: none;
}

/* Track */
.chatbot .chatbot-content .messages::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px grey;
    border-radius: 10px;
}

/* Handle */
.chatbot .chatbot-content .messages::-webkit-scrollbar-thumb {
    background: grey;
    border-radius: 10px;
}

/* Handle on hover */
.chatbot .chatbot-content .messages::-webkit-scrollbar-thumb:hover {
    background: #b30000;
}
.chatbot .chatbot-message {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 6px;
}
.chatbot .chatbot-message .profile {
    background-color: var(--main-color);
    background-image: var(--profile-image-url);
    background-size: 22px;
    background-repeat: no-repeat;
    background-position: center center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.chatbot .chatbot-message ul {
    flex: 1;
    padding: 0;
    margin: 0;
    list-style: none;
    padding-left: 5px;
    max-width: 70%;
    display: flex;
    flex-direction: column;
}
.chatbot .chatbot-message ul li {
    background-color: rgba(244, 243, 244, 0.61);
    margin-bottom: 5px;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: #000;
    width: fit-content;
    min-height: 35px;
    padding: 10px 18px 10px 10px;
    border-radius: 0 12px 12px 0;
    max-width: 100%;
    word-wrap: break-word;
    font-family: "Poppins", sans-serif;
}
.chatbot .chatbot-message ul li .bold {
    font-weight: bold;
}
.chatbot .chatbot-message ul li .italic {
    font-weight: normal;
    font-style: italic;
}
.chatbot .chatbot-message ul li:nth-of-type(1) {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 0 !important;
}
.chatbot .chatbot-message ul li:nth-last-of-type(1) {
    border-bottom-left-radius: 12px;
}
.chatbot .chatbot-message .link {
    background: rgba(7, 184, 205, 0.08);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: -0.01em;
    color: var(--main-color);
    display: block;
    padding: 6px 14px;
    text-wrap: pretty;
    border-radius: 10px;
    word-wrap: break-word;
    text-align: left;
    margin: 10px 0;
    text-decoration: none;
}
.chatbot .chatbot-message ul li .link:nth-child(1) {
    margin-top: 0;
}
.chatbot .chatbot-message ul li .link:nth-last-child(1) {
    margin-bottom: 0;
}
.chatbot .chatbot-message .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.chatbot .chatbot-message .nav-link {
    background: transparent;
    border: 1px solid var(--main-color);
    font-weight: 400;
    font-size: 12px;
    color: var(--main-color);
    padding: 0px 15px;
    text-wrap: pretty;
    border-radius: 15px;
    word-wrap: break-word;
    text-align: left;
    margin: 0;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: background-color 0.4s, color 0.4s;
    width: fit-content;
}
.chatbot .chatbot-message .nav-link:hover {
    background-color: var(--main-color);
    color: #fff;
}
.chatbot .chatbot-message ul li > .img {
    width: 100%;
    max-height: 125px;
    border-radius: 8px;
    overflow: hidden;
    /* object-fit: cover; */
}
.chatbot .chatbot-message ul li > .img > img {
    object-fit: cover;
    object-position: center;
    width: 100%;
    height: 100%;
}
.chatbot .user-message {
    display: flex;
    justify-content: end;
    margin-bottom: 6px;
}
.chatbot .user-message .profile {
    background-color: #f5f8ff;
    background-image: var(--lorybot-user-profile); 
    background-size: 25px;         
    background-repeat: no-repeat;      
    background-position: center center; 
    width: 35px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: end;
    justify-content: center;
    overflow: hidden;
}
.chatbot .user-message ul {
    flex: 1;
    padding: 0;
    margin: 0;
    list-style: none;
    padding-right: 6px;
    max-width: 70%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: end;
}
.chatbot .user-message ul li {
    background-color: var(--main-color);
    margin-bottom: 5px;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: #fff;
    width: fit-content;
    min-height: 35px;
    padding: 10px 10px 10px 18px;
    border-radius: 12px 0 0 12px;
}
.chatbot .user-message ul li:nth-of-type(1) {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 0 !important;
}
.chatbot .user-message ul li:nth-last-of-type(1) {
    border-bottom-right-radius: 12px;
}
.chatbot-radio-inputs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.chatbot-radio-inputs .chatbot-radio {
    display: inline-block;
}
.chatbot-radio-inputs .chatbot-radio input {
    display: none;
}
.chatbot-radio-inputs .chatbot-radio label {
    background-color: #eee;
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 14px 0 4px;
    border-radius: 31px;
    font-weight: 400;
    font-size: 10px;
    line-height: 1;
    color: #afafaf;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.chatbot-radio-inputs .chatbot-radio input:checked + label {
    border-color: #000;
    color: #000;
    background-color: transparent;
}

.chatbot-radio-inputs .chatbot-radio label::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    background-color: #afafaf;
    margin-right: 5px;
    transition: background-color 0.4s;
}
.chatbot-radio-inputs .chatbot-radio input:checked + label::before {
    background-color: #000;
}
.chatbot-write-message {
    display: flex;
    flex-direction: row;
    padding: 0px 10px 10px 10px;
    gap: 10px;
}
.chatbot-write-message .textbox {
    flex: 1;
    border: 1px solid rgba(151, 151, 151, 0.24);
    border-radius: 82px;
    height: 40px;
    display: flex;
    flex-direction: row;
}
.chatbot-write-message .textbox input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 15px;
    outline: none;
    width: 100%;
    height: auto;
    font-size: 14px;
    font-weight: 400;
    color: #000;
    font-family: "Poppins", sans-serif;
    font-style: normal;
    margin: 0;
    max-width: 100%;  /* Ensure the input does not overflow the screen width */
}
.chatbot-write-message .textbox input:focus{
    font-size: 14px;
    font-weight: 400;
    color: #000;
    font-family: "Poppins", sans-serif;
    font-style: normal;
    transform: scale(1);
    margin-top: 0;
    height: auto;
}


.chatbot-write-message .textbox .send-voice-btn {
    border: 0;
    background: transparent;
    display: none; /*DISPLAY: FLEX*/
    align-items: center;
    justify-content: center;
}
.chatbot-write-message .send-message-btn {
    width: 40px;
    max-width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--main-color);
    background-color: var(--main-color);
    background-image: var(--send-icon-url);
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.chatbot-loader {
    width: 50px;
}
.chatbot-loader > div {
    position: relative;
    left: -9999px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #d9d9d9;
    color: #d9d9d9;
    box-shadow: 9999px 0 0 -5px;
    animation: dot-pulse 1.5s infinite linear;
    animation-delay: 0.25s;
    transform: translate(20px, 4px);
}
.chatbot-loader > div::before,
.chatbot-loader > div::after {
    content: "";
    display: inline-block;
    position: absolute;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #d9d9d9;
    color: #d9d9d9;
}
.chatbot-loader > div::before {
    box-shadow: 9984px 0 0 -5px;
    animation: dot-pulse-before 1.5s infinite linear;
    animation-delay: 0s;
}
.chatbot-loader > div::after {
    box-shadow: 10014px 0 0 -5px;
    animation: dot-pulse-after 1.5s infinite linear;
    animation-delay: 0.5s;
}

@keyframes dot-pulse-before {
    0% {
        box-shadow: 9984px 0 0 -5px;
    }
    30% {
        box-shadow: 9984px 0 0 2px;
    }
    60%,
    100% {
        box-shadow: 9984px 0 0 -5px;
    }
}
@keyframes dot-pulse {
    0% {
        box-shadow: 9999px 0 0 -5px;
    }
    30% {
        box-shadow: 9999px 0 0 2px;
    }
    60%,
    100% {
        box-shadow: 9999px 0 0 -5px;
    }
}
@keyframes dot-pulse-after {
    0% {
        box-shadow: 10014px 0 0 -5px;
    }
    30% {
        box-shadow: 10014px 0 0 2px;
    }
    60%,
    100% {
        box-shadow: 10014px 0 0 -5px;
    }
}

@media screen and (max-width: 767px) {
    .chatbot-toggler {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
    }
    .chatbot-toggler div {
        background-size: 22px;
    }
    .chatbot {
        height: 500px;
        width: 300px;
        border-width: 0;
        max-height: calc(100vh - 60px);
    }
    #chatbot-container {
        bottom: 60px;
        right: 10px;
    }
    .chatbot .chatbot-header {
        padding: 7px 15px;
    }
}

@media screen and (max-width: 576px) {
    .chatbot {
        width: calc(100% - 20px);
        border-width: 0;
        height: calc(100vh - 75px);
    }
    #chatbot-container {
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
