/* Toggle Chat Button */
#chatbot-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: linear-gradient(45deg, #ff5d22, #ff5d22);
  color: white;
  padding: 12px 22px;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
}

/* Chat Window */
#chatbot-window {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 370px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  font-family: "Segoe UI", sans-serif;
  box-shadow: 0px 10px 20px #c5c2c2;
}

/* Header */

.chatbot-header {
  background: linear-gradient(45deg, #ff5d22, #ff5d22);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
}

.chatbot-header-icons {
  display: flex;
  gap: 10px;
}

.chatbot-header-icons .refresh-img img {
  width: 20px;
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
}
.icon-btn img {
  width: 16px;
}

/* Scrollable message area */
.chatbot-messages {
  flex: 1;
  padding: 10px;
  background-image: url("./../img/chatbot-bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-bottom: 1px solid #e1e1e1;
}
.chatbot-messages .message {
  position: relative;
}

/* Message Layout */
.message {
  display: flex;
  align-items: flex-end;
  max-width: 92%;
}

.chatbot-messages .user-message {
  align-self: flex-end;
  width: 90%;
  background-color: #ff5d22;
  color: white;
  border: 1px solid #e1e1e1;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 100%;
  word-wrap: break-word;
  font-size: 14px;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.bot {
  align-self: flex-start;
  display: flex;
  align-items: center;
}

/* Avatar/Icon */
.avatar {
  width: 43px;
  /* border: 1px solid #f0ebeb; */
  position: absolute;
  /* bottom: 10px; */
  box-shadow: 0px 2px 2px #d7d0d0;
  background: #fffdfd;
  border-radius: 30px;
  padding: 9px;
  border-bottom: 1px solid #e1e1e1;
}

.avatar img {
  height: 22px;
}

/* Chat Bubble */
.bubble {
  /* background: #ff5d22; */
  border-bottom: 1px solid #e1e1e1;
  background: #fcf8f8;
  /* box-shadow: 0px 5px 20px #d7d0d0; */
  box-shadow: -1px 2px 2px #d7d0d0;
  color: black;
  padding: 10px 14px;
  border-radius: 11px;
  max-width: 100%;
  word-wrap: break-word;
  font-size: 14px;
  margin-left: 22px;
  padding-left: 30px;
}

.message.user .bubble {
  background: #ff5d22;
  color: white;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}



/* Input Area */
.input-area {
  display: flex;
  position: relative;
  padding: 10px;
  /* border-top: 1px solid #ddd; */
  /* background: #ece9ff; */
}

.input-area textarea {
  width: 100%;
  height: 70px;
  background-color: #f6f6f6;
  border-radius: 8px;
  border: none;
  padding: 10px 45px 10px 12px;
  /* border: 1px solid #ccc; */
  resize: none;
  font-size: 14px;
}

.send-button {
  background: white;
  border: none;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
}
.btn-icn {
  background: #ff5d22;
  border-radius: 20px;
  padding: 8px;
  display: flex;
  border: none;
}

.send-button img {
  width: 20px;
  align-self: center;
}

.popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  /* dim background */
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.popup-modal {
  background: white;
  border-radius: 16px;
  padding: 20px;
  width: 85%;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.popup-modal h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.popup-modal p {
  font-size: 14px;
  margin-bottom: 20px;
}

.popup-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.popup-buttons button {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.popup-buttons .confirm {
  background-color: #ff5d22;
  color: white;
}

/* floating messages in chatbot */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 10px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #555;
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
