@import "https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/3.0.1/iconfont/material-icons.min.css";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --chat-window-total-width: 25vw;
  /* --chat-window-height: 500px; */
  --chat-window-height: 75%;
  --chat-window-color-theme: #1e90ff;
  --chat-window-bg-color: #fff;
  --chat-send-button: #1e90ff;
  /* --chat-user-msg-bg: #ddd; */
  --chat-user-msg-bg: #fbfafa;
  --chat-related-question-bg: #fbfafa;
  --chat-header-bg: linear-gradient(160deg, dodgerblue 0%, #80d0c7 100%);
}

.chat-btn {
  position: fixed;
  right: 26px;
  bottom: 68px;
  border: none;
  outline: none;
  cursor: pointer;
  background-color: var(--chat-window-color-theme);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  opacity: 0.8;
  transition: opacity 0.3s;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: none;
  padding-top: 10px;
}

.chat-icon {
  transform: scale(1.2);
}

.chat-btn:hover,
.chat-submit:hover {
  opacity: 1;
}

.chat-popup {
  font-family: Arial, Helvetica, sans-serif;
  display: none;
  position: fixed;
  bottom: 15px;
  right: 5px;
  height: 80%;
  width: calc(1.5 * var(--chat-window-total-width));
  background-color: var(--chat-window-bg-color);
  border-radius: 10px;
  /* border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px; */
  /* display: flex; */
  flex-direction: column;
  justify-content: space-between;
  /* padding: 0.75rem; */
  border: 1px solid #ccc;
  box-shadow: 5 5px 5px rgba(0, 0, 0, 0.4);
  /* border-radius: 15px; */
  transition: all 0.5s ease-out;
  z-index: 2000;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.chat-content {
  left: 20%;
  width: 879px;
  height: 100vh;
}

.chat-header {
  /* background-color: dodgerblue; */
  background-color: var(--chat-window-color-theme);
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  /* margin-bottom: 10px; */
  align-items: center;
  max-height: 50px;
  white-space: nowrap;
  /* Prevent text from wrapping to the next line */
  overflow: hidden;
  /* Hide overflowing text */
  text-overflow: ellipsis;
  /* Display ellipses when text overflows */
}

.chat-header .bot-title {
  /* display: flex; */
  justify-content: flex-start;
  float: left;
  flex: 1;
  /* Allow the title to grow and take available space */
  overflow: hidden;
  /* Hide overflowing text */
  text-overflow: ellipsis;
  /* Display ellipses when text overflows */
  /* Add tooltip on hover */
  position: relative;
}

.close-chat-window {
  width: 50px;
  background-color: transparent;
  color: white;
  border: none;
  outline: none;
  cursor: pointer;
}

/* .close-chat-window:hover {
  transform: scale(1.5);
  outline: none;
  border: none;
} */

.expand-chat-window {
  width: 50px;
  background-color: transparent;
  color: white;
  border: none;
  outline: none;
  cursor: pointer;
}

.expand-chat-window:hover {
  transform: scale(1.5);
  outline: none;
  border: none;
}

.input-container {
  position: relative;
  display: flex;
  padding-bottom: 10px;
  width: 100%;
}

.chat-area {
  height: 80%;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--chat-window-bg-color);
  border-radius: 10px;
  padding: 1rem;
}

.chat-area::-webkit-scrollbar {
  width: 10px;
}

/* Track */
.chat-area::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 20px;
}

/* Handle */
.chat-area::-webkit-scrollbar-thumb {
  background: #d2d1d1;
  border-radius: 20px;
  height: 50px;
}

.chat-bot-msg {
  display: flex;
  align-items: center;
  margin-top: 3px;
  margin-bottom: 3px;
  margin-right: 12px;
}

.chat-bot-img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  margin-left: 5px;
}

.chat-bot-msg .msg {
  background-color: var(--chat-user-msg-bg);
  font-size: medium;
  color: black;
  padding: 0.5rem;
  /* margin: 0.5rem; */
  margin-right: 40px;
  margin-left: 0px;
  border-radius: 5px;
  max-width: 90%;
  width: auto;
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); */
}

.chat-bot-msg .msg a {
  text-decoration: underline;
  /* font-size: 0.2rem; */
}

.chat-user-msg {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-right: 5px;
}

.chat-user-msg .msg {
  background-color: var(--chat-window-color-theme);
  color: white;
  font-size: medium;
  /* border: 1px solid black; */
  margin: 1rem;
  padding: 0.5rem;
  border-radius: 5px;
  margin-left: 60px;
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); */
  /* word-break: break-all; */
}

.chat-related-question {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  /* margin-right: 10px; */
  margin-top: 5px;
}

.chat-related-question .msg {
  background-color: white;
  color: var(--chat-window-color-theme);
  /* margin: 0.25rem; */
  /* padding: 0.5rem; */
  border-radius: 5px;
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); */
  /* word-break: break-all; */
  border: 2px solid var(--chat-window-color-theme);
  padding: 3px;
  margin-left: 35px;
}

.msg-relatedQue {
  /* background-color: white; */
  color: var(--chat-window-color-theme);
  /* margin: 0.25rem; */
  /* padding: 0.5rem; */
  border-radius: 5px;
  /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); */
  /* word-break: break-all; */
  border: 0.5px solid var(--chat-window-color-theme);
  padding: 3px;
  margin-left: 35px;
  margin-right: 12px;
}

/* .msg-image {
    max-width: 90%;
    max-height: 400px;
} */

.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.chat-action-button-container {
  position: relative;
  display: flex;
  justify-content: center;
  font-size: 0.9rem;
  margin: 0.9rem;
}

/* Outer container for action messages */
.chat-action-button-area {
  position: relative;
  border: 1px solid #ccc;
  padding: 0.5rem;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  /* Allow items to wrap to the next line in case of limited width */
  font-size: 0.7rem;
}

/* Individual action message */
.chat-action-msg {
  /* display: flex; */
  align-items: center;
  padding: 4px;
  margin: 4px;
  border: 2px solid var(--chat-window-color-theme);
  background-color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  white-space: nowrap;
  flex-basis: calc(33.33% - 16px);
  /* Set the width to one-third of the container minus the margins */
  box-sizing: border-box;
  /* Include padding and border in the element's total width */
  justify-content: center;
  /* Center-align the content horizontally */
  text-align: center;
  /* Center-align the text within the button */
  overflow: hidden;
  /* Hide the overflow text */
  text-overflow: ellipsis;
  /* Show ellipsis when text exceeds the container */
  white-space: nowrap;
  /* Prevent text from wrapping */
}

/* Optional style for hover effect on action messages */
.chat-action-msg:hover {
  background-color: #e0e0e0;
}

/* Styling for the link inside the action message */
.chat-action-msg a {
  color: #333;
  text-decoration: none;
  /* margin-left: 8px; */
}

/* Optional style for hover effect on links */
.chat-action-msg a:hover {
  text-decoration: none;
}

.chat-input {
  border: 1px solid #ccc;
  padding: 1rem;
  font-size: 0.8rem;
  border-radius: 5px;
  height: 1rem;
  margin-bottom: 0.5rem;
  outline-color: var(--chat-window-color-theme);
  padding-right: 40px;
  /* Adjust as needed */
  border-radius: 10px;
  border: 1px solid #ffc5dd;
  width: calc(1.5 * var(--chat-window-total-width));
  transition: width 0.3s;
}

.chat-submit {
  background-color: var(--chat-send-button);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  border: none;
  outline: none;
  cursor: pointer;
  position: absolute;
  height: 28px;
  width: 28px;
  background-color: #ff0266;
  color: #ffffff;
  text-transform: uppercase;
  right: 0;
  margin-top: 3px;
  margin-right: 2.5px;
}

/* 
.show {
    display: flex;
} 

.btn-primary {
    background-color: #0096fe;
    border: 1px solid var(--chat-window-color-theme);
    outline: none;
    display: inline-block;
    color: var(--chat-window-color-theme);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #0096fe;
    color: #fff;
    transform: scale(1.1);
}
*/
.loading-animation {
  position: relative;
  left: -9999px;
  width: 5px;
  height: 5px;
  border-radius: 5px;
  background-color: #333333;
  color: #333333;
  box-shadow: 9999px 0 0 -5px;
  animation: loading-animation 2s infinite linear;
  animation-delay: 0.25s;
  margin: 15px;
  margin-left: 30px;
  margin-bottom: 40px;
}

.loading-animation::before,
.loading-animation::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 5px;
  background-color: #333333;
  color: #333333;
}

.loading-animation::before {
  box-shadow: 9984px 0 0 -5px;
  animation: loading-animation-before 2s infinite linear;
  animation-delay: 0s;
}

.loading-animation::after {
  box-shadow: 10014px 0 0 -5px;
  animation: loading-animation-after 2s infinite linear;
  animation-delay: 0.5s;
}

/* Add the hover effect and styling for clickable questions */
.clickable-question {
  cursor: pointer;
  color: var(--chat-window-color-theme);
  word-wrap: break-word;
}

.clickable-question:hover {
  text-decoration: underline;
}

@keyframes loading-animation-before {
  0% {
    box-shadow: 9984px 0 0 -5px;
  }

  30% {
    box-shadow: 9984px 0 0 2px;
  }

  60%,
  100% {
    box-shadow: 9984px 0 0 -5px;
  }
}

@keyframes chat-loading-animation {
  0% {
    box-shadow: 9999px 0 0 -5px;
  }

  30% {
    box-shadow: 9999px 0 0 2px;
  }

  60%,
  100% {
    box-shadow: 9999px 0 0 -5px;
  }
}

@keyframes loading-animation-after {
  0% {
    box-shadow: 10014px 0 0 -5px;
  }

  30% {
    box-shadow: 10014px 0 0 2px;
  }

  60%,
  100% {
    box-shadow: 10014px 0 0 -5px;
  }
}

@media (max-width: 500px) {
  .chat-popup {
    bottom: 1px;
    top: 1px;
    right: 1px;
    left: 1px;
    width: 100vw;
    height: 100%;
  }
}

/* blink keyframes: fade in/out */
@keyframes blinkText {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* apply it to any element with .blinking-text */
.blinking-text {
  animation: blinkText 1s linear infinite;
}
