.chatbot {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 360px;
  max-width: 95%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  transform: scale(0);
  transform-origin: bottom right;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 0;
  font-family: "Segoe UI", sans-serif;
}
/* Active State */
.chatbot.active {
  transform: scale(1);
  opacity: 1;
  height: 520px;
}

/* Chatbot Header */
.chatbot header {
  background: #3e7b27;
  padding: 18px;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  position: relative;
}

.chatbot-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.3rem;
  cursor: pointer;
}

.chatbot-close:hover {
  color: #ddd;
}

.chatbot header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

/* Chatbox Messages */
.chatbox {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f9f9f9;
}

/* Message Bubbles */
.chatbox li {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  list-style: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Incoming Messages */
.chat-incoming {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: transparent;
  align-self: flex-start;
}

.chat-incoming .icon {
  color: #3e7b27;
  font-size: 1.4rem;
  margin-top: 5px;
}
.chat-incoming p {
  background: #eeeeee;
  color: #333;
  padding: 12px 15px;
  border-radius: 20px;
  border-bottom-left-radius: 5px;
  max-width: 75%;
  margin: 0;
}

/* Outgoing Messages */
.chat-outgoing {
  background: #3e7b27;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Chat Input Area */
.chat-input {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #eee;
  align-items: center;
}

.chat-input textarea {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 12px 15px;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border 0.3s ease;
}

.chat-input textarea:focus {
  border-color: #3e7b27;
}

#send-btn {
  background: #3e7b27;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

#send-btn:hover {
  background: #5cb338;
  transform: scale(1.05);
}

/* Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #3e7b27;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: all 0.3s ease;
  border: none;
}

.chatbot-toggle:hover {
  background: #5cb338;
  transform: scale(1.1);
}

.chatbot-toggle i {
  font-size: 1.5rem;
}

/* Scrollbar Styling */
.chatbox::-webkit-scrollbar {
  width: 6px;
}

.chatbox::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chatbox::-webkit-scrollbar-thumb {
  background: #3e7b27;
  border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 480px) {
  .chatbot {
    width: 90%;
    right: 5%;
    bottom: 80px;
  }

  .chatbot-toggle {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}

.chatbot header .chatbot-close {
  position: absolute;
  right: 15px;
  top: 12px;
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chatbot header .chatbot-close:hover {
  transform: scale(1.2);
}
.typing-dots {
  display: inline-flex;
  font-size: 24px;
  color: #999;
  gap: 4px;
  animation: blink 1.2s infinite;
}

.typing-dots span {
  animation: blinkDot 1.5s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blinkDot {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

.chat-typing {
  align-self: flex-start;
  background: #f1f1f1;
  padding: 10px 16px;
  border-radius: 18px;
  max-width: 80%;
  font-size: 0.9rem;
  color: #666;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}
