
/* Common */
html {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

body {
    overflow: hidden;
    margin: 0px;
    height: 100%;
    width: 100%;
}

#assistant {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999999;
}

#assistant-iframe {
    width: 130px;
    height: 130px;
    border: none;
}

/* Bubble */
#assistant-bubble {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  justify-content: flex-end;
  max-height: 100%;
  max-width: 100%;
  -webkit-box-align: end;
  -ms-flex-align: end;
}

#assistant-bubble .greeting-wrapper {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-box-align: inherit;
  -ms-flex-align: inherit;
  align-items: inherit;
  display: -webkit-box;
  display: -ms-flexbox;
  -ms-flex-direction: column;
  flex-direction: column;
  margin: 0px 40px 0px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  width: 275px;
  display: none;
  position: relative;
}

#assistant-bubble .greeting-wrapper .greeting-close {
  margin-bottom: 5px;
  opacity: 0;
}

#assistant-bubble .greeting-wrapper:hover .greeting-close {
  opacity: 0.7;
}

#assistant-bubble .greeting-wrapper .greeting-close:hover {
  opacity: 1;
}

#assistant-header .box-close .box-close-btn,
#assistant-bubble .greeting-wrapper .greeting-close .greeting-close-btn {
  height: 15px;
  padding: 2px;
  width: 15px;
  border-radius: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-backface-visibility: hidden;
  cursor: pointer;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  background: rgba(0, 0, 0, 0.4);
}

#assistant-bubble .greeting-wrapper .greeting-content {
  font-family: system-ui;
  word-wrap: break-word;
  border-radius: 6px;
  -webkit-box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  background: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  cursor: pointer;
  font-size: 16px;
  line-height: 20px;
  line-height: 22px;
  max-width: 100%;
  padding: 15px 20px;
  text-align: left;
  -webkit-transition: opacity 0.3s, -webkit-box-shadow 0.3s;
  transition: opacity 0.3s, -webkit-box-shadow 0.3s;
  transition: box-shadow 0.3s, opacity 0.3s;
  transition: box-shadow 0.3s, opacity 0.3s, -webkit-box-shadow 0.3s;
}

#assistant-bubble .greeting-wrapper .greeting-content:hover {
  -webkit-box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

#assistant-bubble .greeting-wrapper .greeting-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 95%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
}

#assistant-bubble .bubble {
  -webkit-backface-visibility: hidden;
  border-radius: 100%;
  -webkit-box-shadow: 0 0 15px 0 rgb(0 0 0 / 25%);
  box-shadow: 0 0 15px 0 rgb(0 0 0 / 25%);
  cursor: pointer;
  height: 50px;
  margin: 20px;
  overflow: hidden;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  width: 50px;
  padding: 5px;
  -webkit-animation: bubble-circle-img-anim 2s infinite ease-in-out;
  animation: bubble-circle-img-anim 2s infinite ease-in-out;
  -webkit-transform-origin: 50% 50%;
  -ms-transform-origin: 50% 50%;
  transform-origin: 50% 50%;

  img {
    -o-object-fit: cover;
    object-fit: cover;
    width: 100%;
    /* aspect-ratio: 1; */
  }
}

@-webkit-keyframes bubble-circle-img-anim {
    0% {
      -webkit-transform: rotate(0) scale(1) skew(1deg);
    }
    10% {
      -webkit-transform: rotate(-10deg) scale(1) skew(1deg);
    }
    20% {
      -webkit-transform: rotate(10deg) scale(1) skew(1deg);
    }
    30% {
      -webkit-transform: rotate(-10deg) scale(1) skew(1deg);
    }
    40% {
      -webkit-transform: rotate(10deg) scale(1) skew(1deg);
    }
    50% {
      -webkit-transform: rotate(0) scale(1) skew(1deg);
    }
    100% {
      -webkit-transform: rotate(0) scale(1) skew(1deg);
    }
  }

  /* Assistant Box */

#assistant-box {
  height: 600px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  background-color: #e1f0ff;
  border-radius: 7px;
  box-shadow: 0 9.5px 12.7px 0 rgba(0, 0, 0, 0.05);
}

#assistant-header {
  /* background-color: #ffffff; */
  box-shadow: 0 9.5px 12.7px 0 rgba(0, 0, 0, 0.05);
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 60px;
  padding: 0 18px;
  position: relative;
  width: 100%;
  z-index: 3;
  box-sizing: border-box;
  border-radius: 7px 7px 0px 0px;
  align-items: center;
  justify-content: space-between;
}

#assistant-header .assistant-infor {
  display: flex;
  align-items: center;
  gap: 10px;
}

#assistant-header .assistant-infor .assistant-avatar {
  -webkit-backface-visibility: hidden;
  border-radius: 100%;
  height: 30px;
  width: 30px;
  margin: 3px;
  overflow: hidden;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  background-color: #ffffff;
  padding: 6px;

  img {
    -o-object-fit: cover;
    object-fit: cover;
    width: 100%;
    /* aspect-ratio: 1; */
  }
}

#assistant-header .assistant-infor .assistant-name {

}

#assistant-header .assistant-infor .assistant-name .name {
  color: rgb(0, 0, 0);
  font-size: 20px;
  font-family: system-ui;
  font-weight: 500;
}

#assistant-header .assistant-infor .assistant-name .active-status::before {
  content: "";
  position: absolute;
  top: 30%;
  left: 0%;
  margin-left: 0px;
  border-width: 5px;
  border-style: solid;
  border-radius: 100%;
  border-color: #00ff00;
}

#assistant-header .assistant-infor .assistant-name .active-status {
  font-size: 14px;
  padding-left: 15px;
  font-family: system-ui;
  position: relative;
}

#assistant-header .box-close {
  display: none;
}

#assistant-footer {
  height: auto;
  width: 100%;
  padding: 10px 0px 5px;
  border-radius: 0px 0px 7px 7px;
  background: transparent;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
}

#assistant-form {
  background: rgb(255, 255, 255);
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  min-height: 35px;
  height: fit-content;
  width: 90%;
  border-radius: 25px;
  padding: 8px 5px;

  textarea {
    color: rgb(0, 0, 0) !important;
    font-family: system-ui;
    -webkit-box-flex: 1;
    background: transparent;
    border: 0;
    -ms-flex: 1 0 0px;
    flex: 1 0 0;
    font-size: 16px;
    resize: none;
    line-height: 20px;
    height: auto;
    min-height: auto;
    padding: 0 5px 0px 18px;
    margin-bottom: 0px;
    outline: none;
    box-shadow: none;
    overflow-y: scroll;
  }

  #textarea-resize::-webkit-scrollbar {
    width: 1px;
    /* background-color: #f7f7f7; */
  }

  #textarea-resize::-webkit-scrollbar-thumb {
    border-radius: 0px;
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
    background-color: #ececec;
  }

  /* #textarea-resize::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
    border-radius: 10px;
    background-color: #F5F5F5;
  } */

  .form-send-icon {
    -webkit-box-flex: 0;
    -webkit-backface-visibility: hidden;
    /* cursor: pointer; */
    height: 26px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    width: 26px;
    margin-right: 15px;

    svg {
      height: 100%;
      width: 100%;
    }
  }
}

/* assistant-conversation */
#assistant-body {
  background: transparent;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-box-flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex: 1 0 0px;
  flex: 1 0 0;
  -ms-flex-direction: column;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

#assistant-conversation {
  background: transparent;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-box-flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex: 1 0 0px;
  flex: 1 0 0;
  -ms-flex-direction: column;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 10px 0px 23px;
}

#assistant-conversation::-webkit-scrollbar {
    width: 5px;
}

#assistant-conversation::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgb(0 0 0 / 17%);
  background-color: #c1c1c1;
}

#assistant-conversation .message-bot,
#assistant-conversation .message-user {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding: 10px 15px 0px;
  position: relative;
}

#assistant-conversation .text-wrapper {
  width: fit-content;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  font-family: system-ui;

  word-wrap: break-word;
  font-size: 15px;
  line-height: 20px;
  max-width: 85%;
  padding: 12px 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

#assistant-conversation .text-wrapper span {
  text-align: justify;
}

#assistant-conversation .message-bot {
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
}

#assistant-conversation .message-bot .text-wrapper {
  -webkit-box-align: inherit;
  -ms-flex-align: inherit;
  align-items: inherit;

  border-radius: 13px 13px 13px 3px;
  background: rgb(255, 255, 255);
  color: rgb(0, 0, 0);

  button,
  a {
    margin-top: 5px;
    padding: 3px 5px;
    border-color: rgb(86 171 251);
    border-radius: 6px;
    background-color: transparent;
    cursor: pointer;
  }
}

#assistant-conversation .message-user {
  -webkit-box-align: end;
  -ms-flex-align: end;
  align-items: flex-end;
  text-align: -webkit-right;
}

#assistant-conversation .message-user .text-wrapper {
  -webkit-box-align: end;
  -ms-flex-align: end;
  align-items: flex-end;

  border-radius: 13px 13px 3px 13px;
}

#assistant-conversation .text-wrapper.loading-spinner {
  display: inline-block;
  white-space: nowrap;
}

.loading-spinner span {
  font-size: 20px;
  margin-right: 2px;
  display: inline-block;
  animation: wave 1.5s linear infinite;
}

.loading-spinner span:nth-child(1) {
  animation-delay: 0s;
}

.loading-spinner span:nth-child(2) {
  animation-delay: 0.1s;
}

.loading-spinner span:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Categories */
.assistant-categories {
    font-size: 14px;
    position: relative;
}

.category-header .arrow {
  transition: transform 0.3s ease;
  transform: rotate(180deg);
}

.category-header .arrow.rotate {
  transform: rotate(0deg);
}

#collapse-categories-action {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: -15px;
    left: 5px;
    height: 15px;
    width: 40px;
    border-radius: 6px 6px 0px 0px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 10px 5px;
}

.collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.collapsible.open {
  max-height: 200px;
  overflow: auto;
}

.collapsible.open::-webkit-scrollbar {
    width: 3px;
}

.collapsible.open::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgb(0 0 0 / 17%);
  background-color: #c1c1c1;
}

.category-tag {
    border: none;
    padding: 5px 10px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

/* Keyword Suggestions */
.assistant-keywords {
  overflow-x: scroll;
  -webkit-overflow-scrolling: touch;
}

#assistant-keyword-suggestions::-webkit-scrollbar {
  height: 2px;
}

#assistant-keyword-suggestions::-webkit-scrollbar-thumb {
  border-radius: 3px;
  -webkit-box-shadow: inset 0 0 6px rgb(0 0 0 / 17%);
  background-color: #c1c1c1;
}

.keyword-tags {
  display: flex;
  gap: 6px;
  padding: 15px 10px 20px;
  flex-direction: row;
  width: max-content;
  cursor: grab;
}

.keyword-tags:active {
  cursor: grabbing;
}

.keyword-tag {
  border: none;
  padding: 7px 13px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s;
  line-height: 20px;
}

.assistant-keywords,
.keyword-tags,
.keyword-tag {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#user-verification-form {
  padding: 0px 25px;
  font-family: system-ui;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#user-verification-form .form-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

#user-verification-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#user-verification-form select,
#user-verification-form input[type="text"],
#user-verification-form input[type="email"] {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  border: 1px solid #ccc;
  border-radius: 25px;
  box-sizing: border-box;
  font-size: 15px;
}

#user-verification-form button {
  margin-top: 22px;
  width: 50%;
  padding: 13px;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

#user-verification-form .form-status {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
}


/* Mobile Responsive Design - Using CSS Classes */
.mobile-device {
    /* Reset html and body for mobile */
    html {
        height: 100vh;
        width: 100vw;
        display: block;
        justify-content: initial;
        align-items: initial;
    }

    body {
        overflow: hidden;
        margin: 0;
        height: 100vh;
        width: 100vw;
        position: relative;
    }

    /* Mobile assistant box - fullscreen */
    #assistant-box {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 20px 20px 0px 0px;
        box-shadow: none;
        z-index: 10001;
    }

    #assistant-header {
      border-radius: 20px 20px 0px 0px;
    }

    #assistant-header .box-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Mobile bubble adjustments */
    #assistant-bubble .bubble {
        position: fixed;
        bottom: 20px;
        right: 20px;
        margin: 0;
        z-index: 10002;
    }
    #assistant-bubble .greeting-wrapper .greeting-close {
      opacity: 1;
    }

    #assistant-footer {
      border-radius: 0px;
    }
}
