@use '../../styles/variables.scss' as vars;

.botfoundry-chatbot-btn {
  position: fixed;
  border: 0px;
  bottom: 1rem;
  right: 1rem;
  width: 55px;
  height: 55px;
  background-color: vars.$primary-color;
  z-index: 999999999;
  border-radius: 50%;
  transform: scale(1);
  display: flex;
  &:hover {
    cursor: pointer;
    background-color: vars.$primary-color-hover;
    transform: scale(1.08);
  }

  .btn-icon {
    margin: auto;
    height: 50%;
    height: 50%;
    color: #fff;
  }

  &.customize-mode {
    bottom: unset;
    z-index: unset;
    position: relative;
    right: unset;
    margin-top: auto;
    margin-left: 24px;
  }
}
.botfoundry-chatbot-window {
  border: none;
  position: fixed;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    rgba(150, 150, 150, 0.2) 0px 10px 30px 0px,
    rgba(150, 150, 150, 0.2) 0px 0px 0px 1px;
  bottom: 85px;
  right: 1rem;
  max-width: 458px;
  width: 100%;
  height: 85dvh;
  max-height: 824px;
  border-radius: 0.75rem;
  display: flex;
  z-index: 2147483646;
  overflow: hidden;
  background-color: white;
  left: unset;

  @media (max-width: 490px) {
    width: 95%;
    height: 95%;
    right: 0;
    top: 4px;
  }
  // Chatbot header
  .chatbot-header {
    color: #fff;
    background-color: vars.$primary-color;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0.75rem 0.75rem 0 0;
    @media (max-width: 490px) {
      border-radius: 0px;
    }
    .chatbot-header-title {
      h3 {
        color: #fff;
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
      }
    }
    .chatbot-header-close {
      background-color: transparent;
      border: none;
      color: white;
      font-size: 1.5rem;

      &:hover {
        cursor: pointer;
      }

      &:focus {
        outline: none;
      }
    }
  }

  .chatbot-body-wrapper {
    flex: 1;
    overflow-y: hidden;
    height: 100%;
    justify-content: flex-end;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-color: #f9f9f9;
    // Chatbot body
    .chatbot-body {
      overflow-y: auto;
      overscroll-behavior-y: contain;
      .chatbot-body-inner {
        padding: 1rem;
      }

      // Chatbot message
      .chatbot-message {
        margin-bottom: 1rem;
        display: flex;

        &.chatbot-message-user {
          justify-content: flex-end;

          .chatbot-message-content {
            background-color: vars.$primary-color;
            color: #fff;
            padding: 0.75rem 1rem;
            border-radius: 0.75rem 0.75rem 0 0.75rem;
          }
        }

        &.chatbot-message-bot {
          justify-content: flex-start;

          .chatbot-message-content {
            background-color: #e0e0e0;
            color: #000;
            padding: 0.75rem 1rem;
            border-radius: 0.75rem 0.75rem 0.75rem 0;
          }
        }

        .chatbot-message-content {
          font-size: 0.875rem;
          margin: 0;
          max-width: 75%;
          word-wrap: break-word;
          margin-bottom: 1rem;

          &:last-child {
            margin-bottom: 0;
          }
        }
      }
    }
  }

  // Chatbot footer
  .chatbot-footer {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    .chatbot-footer-input {
      flex: 1;
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 0.5rem;
      padding: 0.5rem;
      margin-right: 1rem;
      line-height: 1.5;
      &:focus {
        outline: none;
        border-color: vars.$primary-color;
      }
    }
    .chatbot-footer-send {
      color: #fff;
      background-color: vars.$primary-color;
      border: none;
      border-radius: 0.5rem;
      padding: 0.5rem 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1.5;

      &:hover {
        cursor: pointer;
        background-color: vars.$primary-color-hover;
      }

      &:focus {
        outline: none;
      }
    }
  }

  // Chatbot footer powered by
  .chatbot-footer-powered-by {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    .chatbot-footer-powered-by-text {
      margin: 0;
      font-size: 0.75rem;
      color: rgba(0, 0, 0, 0.5);
    }
  }

  &.customize-mode {
    bottom: unset;
    z-index: unset;
    position: relative;
    right: unset;
    margin-top: auto;
    margin-left: 48px;
  }
}
