/* Floating Chatbot Button */
.chatbot-toggler {
  position: fixed;
  bottom: 25px;
  right: 25px;
  outline: none;
  border: none;
  height: 60px;
  width: 60px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e76a8, #004d7a);
  color: #fff;
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
}

.chatbot-toggler:hover {
  transform: scale(1.1) rotate(5deg);
  background: linear-gradient(135deg, #004d7a, #0e76a8);
}

.chatbot-toggler span {
  position: absolute;
}

.chatbot-toggler .fa-xmark {
  opacity: 0;
}

.show-chatbot .chatbot-toggler .fa-xmark {
  opacity: 1;
  transform: rotate(90deg);
  transition: 0.3s;
}

.show-chatbot .chatbot-toggler .fa-comments {
  opacity: 0;
}

/* Chatbot UI */
.chatbot {
  position: fixed;
  right: 35px;
  bottom: 100px;
  width: 350px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9998;
  display: flex;
  flex-direction: column;
}

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

.chatbot header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #0e76a8, #004d7a);
  color: #fff;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot header h2 {
  color: #fff;
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot header .header-btns {
  display: flex;
  align-items: center;
}

.chatbot header span {
  cursor: pointer;
  display: block;
  transition: opacity 0.2s;
}

.chatbot header span:hover {
  opacity: 0.8;
}

/* Chatbox Area */
.chatbox {
  overflow-y: auto;
  height: 380px;
  padding: 20px;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #fdfdfd;
}

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

.chat p {
  padding: 12px 16px;
  border-radius: 10px 10px 10px 0;
  max-width: 85%;
  color: #333;
  font-size: 0.95rem;
  background: #f0f2f5;
  margin: 0;
  white-space: pre-wrap;
}

.chat.outgoing {
  justify-content: flex-end;
}

.chat.outgoing p {
  background: #0e76a8;
  color: #fff;
  border-radius: 10px 10px 0 10px;
}

.chat.incoming p {
  background: #f1f1f1;
  border: 1px solid #e1e1e1;
}

.bot-avatar {
  background: #0e76a8;
  color: #fff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
}

/* Chat Input Area */
.chat-input {
  display: flex;
  gap: 5px;
  background: #fff;
  padding: 10px 20px;
  border-top: 1px solid #ddd;
  align-items: center;
}

.chat-input textarea {
  height: 45px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 0.95rem;
  padding: 12px 10px 0px 10px;
  background: #f9f9f9;
  border-radius: 8px;
  font-family: inherit;
}

.chat-input span {
  align-self: center;
  color: #0e76a8;
  cursor: pointer;
  font-size: 1.3rem;
  transition: color 0.2s ease;
  padding: 10px;
  border-radius: 50%;
}

.chat-input span:hover {
  background: #e6f0f8;
}

/* WhatsApp Integration Button inside Chat */
.whatsapp-integration-btn {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: none;
  padding: 12px 15px;
  width: calc(100% - 40px);
  margin: 0 20px 15px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
  text-decoration: none;
}

.whatsapp-integration-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.5);
  color: white;
}

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.qr-btn {
  background: #e6f0f8;
  color: #0e76a8;
  border: 1px solid #0e76a8;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.qr-btn:hover {
  background: #0e76a8;
  color: #ffffff;
}

/* Responsive */
@media (max-width: 490px) {
  .chatbot {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .chatbot .chatbox {
    height: 100%;
  }
  .chatbot header span {
    display: block;
  }
  .chatbot-toggler {
    bottom: 15px;
    right: 15px;
  }
}
