/* CHATBOT WIDGET STYLES */
.chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.6);
}

.chatbot-toggle.hidden {
  display: none;
}

.chatbot-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.chatbot-widget {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 380px;
  height: 600px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(400px) scale(0.8);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 998;
  border: 1px solid #e5e7eb;
}

.chatbot-widget.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.chatbot-header {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  padding: 20px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chatbot-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.chatbot-message {
  display: flex;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message {
  justify-content: flex-end;
}

.user-message p {
  background: #22c55e;
  color: white;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  margin: 0;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.bot-message p {
  background: white;
  color: #374151;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  margin: 0;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  border: 1px solid #e5e7eb;
}

.bot-message.error p {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.bot-message.loading p {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 12px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.bot-message.loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: bounce 1.4s infinite;
}

.bot-message.loading span:nth-child(2) {
  animation-delay: 0.2s;
}

.bot-message.loading span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: white;
  border-radius: 0 0 16px 16px;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.chatbot-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.chatbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #22c55e;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
  background: #16a34a;
  transform: scale(1.05);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-widget {
    width: calc(100vw - 40px);
    height: 70vh;
    bottom: 80px;
    right: 20px;
    left: 20px;
  }

  .chatbot-toggle {
    bottom: 20px;
    right: 20px;
  }

  .user-message p {
    max-width: 90%;
  }

  .bot-message p {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .chatbot-widget {
    width: calc(100vw - 20px);
    height: 65vh;
    bottom: 70px;
    right: 10px;
    left: 10px;
  }

  .chatbot-toggle {
    bottom: 15px;
    right: 15px;
    width: 55px;
    height: 55px;
    font-size: 20px;
  }

  .chatbot-header h3 {
    font-size: 16px;
  }

  .chatbot-message {
    font-size: 12px;
  }
}
