/* Floating Chatbot Widget Styles */
.chatbot-toggler {
  position: fixed;
  bottom: 30px;
  left: 30px;
  right: auto;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #7AB730 0%, #5a8c20 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(122, 183, 48, 0.4);
  z-index: 9998;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-toggler:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 12px 25px rgba(122, 183, 48, 0.6);
}

.chatbot-toggler .badge-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background-color: #ff3b30;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* Chatbot Popup Window */
.chatbot-container {
  position: fixed;
  bottom: 105px;
  left: 30px;
  right: auto;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-container.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #7AB730 0%, #4f7d19 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  background: #ffffff;
  color: #7AB730;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
}

.chat-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-status {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  background-color: #25d366;
  border-radius: 50%;
  display: inline-block;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-close-btn:hover {
  opacity: 1;
}

/* Chat Body */
.chat-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

/* Messages */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.bot .chat-msg-bubble {
  background: #ffffff;
  color: #333333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e9ecef;
}

.chat-msg.user .chat-msg-bubble {
  background: #7AB730;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg-time {
  font-size: 10px;
  color: #888888;
  margin-top: 4px;
  padding: 0 4px;
}

.chat-msg.bot .chat-msg-time {
  align-self: flex-start;
}

.chat-msg.user .chat-msg-time {
  align-self: flex-end;
}

/* Quick Replies Suggestions */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chat-chip {
  background: #ffffff;
  color: #7AB730;
  border: 1px solid #7AB730;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-chip:hover {
  background: #7AB730;
  color: #ffffff;
}

/* Chat Footer / Input */
.chat-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #eeeeee;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #7AB730;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7AB730;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: #5a8c20;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .chatbot-toggler {
    left: 20px;
    right: auto;
    bottom: 30px;
    width: 54px;
    height: 54px;
    font-size: 24px;
  }
  .chatbot-container {
    left: 15px;
    right: auto;
    bottom: 95px;
    width: calc(100vw - 30px);
    height: 460px;
  }
}
