#chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Poppins', Arial, sans-serif;
}

#chatbot-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-color, #2c6804);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

#chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  height: 520px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
  transform-origin: bottom right;
}

#chatbot-window.chatbot-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
}

.chatbot-header {
  background: var(--accent-color, #2c6804);
  color: white;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

#chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 50%;
  transition: background 0.15s;
}

#chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f5f7f5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chatbot-msg-user {
  background: var(--accent-color, #2c6804);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chatbot-msg-ai {
  background: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chatbot-typing {
  background: #fff;
  border: 1px solid #e0e0e0;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 0.875rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.chatbot-typing-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa;
  animation: chatbot-bounce 1.2s infinite ease-in-out;
}

.chatbot-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chatbot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.chatbot-input-area {
  display: flex;
  padding: 10px 12px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

#chatbot-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  background: #fafafa;
}

#chatbot-input:focus {
  border-color: var(--accent-color, #2c6804);
  background: #fff;
}

#chatbot-input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

#chatbot-send {
  background: var(--accent-color, #2c6804);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#chatbot-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 576px) {
  #chatbot-widget {
    bottom: 14px;
    right: 14px;
  }

  #chatbot-toggle {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  #chatbot-window {
    position: fixed;
    bottom: 74px;
    right: 8px;
    left: 8px;
    width: auto;
    height: calc(100dvh - 96px);
    max-height: 460px;
    border-radius: 12px;
  }

  .chatbot-header {
    padding: 10px 14px;
  }

  .chatbot-header h3 {
    font-size: 0.875rem;
  }

  #chatbot-messages {
    padding: 10px;
    gap: 8px;
  }

  .chatbot-msg {
    font-size: 0.8rem;
    padding: 8px 11px;
  }

  .chatbot-typing {
    font-size: 0.8rem;
    padding: 8px 11px;
  }

  .chatbot-input-area {
    padding: 8px 10px;
    gap: 6px;
  }

  #chatbot-input {
    font-size: 0.8rem;
    padding: 7px 13px;
  }

  #chatbot-send {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }
}
