﻿/* @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap"); */
:root {
  --chatbot-background: #ffffff;
  --chatbot-text-color: #333;
  --chatbot-header-text-color: #fff;
  --chatbot-header-background: #001024;
  --user-message-background: #ff990050;
  --user-message-text-color: #333;
  --bot-message-background: rgba(255, 153, 0, 0.30);
  --bot-message-text-color: #333;
  --chatbot-shadow: 0px 5px 5px 3px rgba(0, 0, 0, 0.1);
  --bot-icon-color: #ff9900;
  --toggle-btn-background: #001024;
  --toggle-btn-icon-color: #ffffff;
  --error-background: #f8d7da;
  --error-text-color: #721c24;
}

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


/*   */

.chatbot-toggler {
  position: fixed;
  right: 24px;
  border-radius: 50%;
  bottom: 30px;

  color: var(--toggle-btn-icon-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  width: 50px;
  border: none;
  outline: none;

  transition: all 0.3s ease;
  z-index: 999;

}

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

.chatbot-toggler i {
  position: absolute;
  font-size: 1.5rem;
}

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

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

.chatbot {
  width: 420px;
  position: fixed;
  bottom: 100px;
  transform: scale(0.5);
  pointer-events: none;
  opacity: 0;
  right: 24px;
  background-color: var(--chatbot-background);
  border-radius: 12px;
  box-shadow: var(--chatbot-shadow);
  overflow: hidden;
  transform-origin: bottom right;
  transition: all 0.3s ease;
  transition: all 0.3s ease;
  z-index: 999;
  /* margin: 0;
  padding: 0;
  box-sizing: border-box; */
}

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

.chatbot header {
  position: relative;
  padding: 1rem;
  position: relative;
}

/* .chatbot header h2 {
  

} */

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

.chatbot header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--chatbot-header-text-color);
}

.chatbot header span {
  font-size: 10px;
  font-weight: 600;
  position: absolute;
  bottom: 4px;
  right: 10px;
  color: var(--chatbot-header-text-color);
}


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

}

.chat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbox .chat p {
  font-size: 14px;
  padding: 12px 16px;

  border-radius: 8px 8px 0 8px;
  color: var(--user-message-text-color);
  max-width: 75%;
  font-weight: 500;
  /* white-space: pre-wrap; */

}

.send-btn {
  color: #000000;
}

.chatbox .chat p.error {
  color: var(--error-text-color);
  background-color: var(--error-background);
}

/* .chatbox .incoming {
  color: var(--bot-icon-color);
} */
.chatbox .outgoing {
  justify-content: flex-end;
  margin: 10px 0;

}

.chatbox .outgoing p {
  background-color: var(--user-message-background);

}

.chatbox .incoming p {
  padding: 12px;
  font-size: 14px;
  padding: 12px 16px;
  /* background-color: var(--bot-message-background); */
  border-radius: 8px 8px 8px 0;
  color: var(--bot-message-text-color);
}

.chatbox .incoming i {
  font-size: 1.5rem;
}

.chatbot .chat-input {
  position: absolute;
  bottom: 0;
  width: 100%;
  border-top: 1px solid #ccc;
  background-color: #fff;
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 5px 16px;
}

.chat-input textarea {
  border: none;
  outline: none;
  font-size: 14px;
  resize: none;
  padding: 16px 16px 16px 0;
  width: 100%;
  height: 55px;
  color: #333;
  max-height: 180px;
}

.chat-input span {
  cursor: pointer;
}

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

/* ===== Scrollbar CSS ===== */
/* Firefox */
.chatbox {
  scrollbar-width: thin;
  scrollbar-color: var(--chatbot-header-background) #ffffff;
}

/* Chrome, Edge, and Safari */
.chatbox::-webkit-scrollbar {
  width: 10px;
}

.chatbox::-webkit-scrollbar-track {
  background: #ffffff;
}

.chatbox::-webkit-scrollbar-thumb {
  background-color: var(--chatbot-header-background);
  border-radius: 10px;
  border: 3px solid #ffffff;
}

@media screen and (max-width: 480px) {
  .chatbot {
    right: 0;
    bottom: 0;
    width: 100%;
    transform: none !important;
    max-width: 100vw;
    height: 100%;
    border-radius: 0;
  }

  body.safari .chatbot {
    left: 0;
    /* Ensure it's centered by setting both left and right to 0 */
    right: 0;
    margin: auto;
    /* This will help in center alignment */
  }

  .chatbox {
    height: 100%;

  }

  .chatbot .chatbox {
    height: 90%;
  }

  .chatbot header i {

    display: block;

  }

  .chatbot .chat-input {

    padding: 0 16px;
  }

  .chat-input textarea {
    flex: 1;
    padding: 16px 0 16px 12px;

    /* width: max-content; */
    height: 55px;
    color: #333;
    max-height: 180px;
  }
}

.chatbox .chat p a {
    color: #0066cc;
    text-decoration: underline;
    word-break: break-all;
}

.chatbox .chat p a:hover {
    text-decoration: none;
}