/* Chatbot animations */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.7);
  }
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.5;
  }
  30% {
    opacity: 1;
  }
}

#chatbot-widget {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  font-family: system-ui, -apple-system, sans-serif;
}

.chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(to right, #3b82f6, #2563eb);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out;
  animation: pulse-glow 3s ease-in-out infinite;
}

.chatbot-toggle:hover {
  animation: none;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

.chatbot-toggle:active {
  transform: scale(0.95);
}

.chatbot-icon {
  width: 28px;
  height: 28px;
  color: white;
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 384px;
  height: 400px;
  max-height: 500px;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  animation: slideInFromBottom 0.3s ease-out;
}

.chatbot-window.hidden {
  display: none !important;
}

.chatbot-header {
  background: linear-gradient(to right, #3b82f6, #2563eb);
  color: white;
  padding: 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

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

.chatbot-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.25rem 0 0 0;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chatbot-message-user {
  display: flex;
  justify-content: flex-end;
}

.chatbot-message-bot {
  display: flex;
  justify-content: flex-start;
}

.chatbot-bubble-user {
  background: #3b82f6;
  color: white;
  border-radius: 0.5rem;
  padding: 0.75rem;
  max-width: 280px;
  word-wrap: break-word;
  font-size: 0.875rem;
  line-height: 1.4;
}

.chatbot-bubble-bot {
  background: #e5e7eb;
  color: #1f2937;
  border-radius: 0.5rem;
  padding: 0.75rem;
  max-width: 280px;
  word-wrap: break-word;
  font-size: 0.875rem;
  line-height: 1.4;
}

.chatbot-input-area {
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem;
  background: white;
  border-radius: 0 0 0.5rem 0.5rem;
}

.chatbot-input-container {
  display: flex;
  gap: 0.5rem;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s;
}

.chatbot-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chatbot-input::placeholder {
  color: #9ca3af;
}

.chatbot-send {
  background: #3b82f6;
  border: none;
  color: white;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-send:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.chatbot-send:active {
  transform: scale(0.95);
}

.chatbot-send-icon {
  width: 20px;
  height: 20px;
}

.typing-dots {
  animation: typing 1.4s infinite;
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive design */
@media (max-width: 480px) {
  .chatbot-window {
    width: 90vw;
    height: 70vh;
    max-width: 100%;
  }

  .chatbot-toggle {
    width: 50px;
    height: 50px;
  }

  .chatbot-icon {
    width: 24px;
    height: 24px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .chatbot-window {
    background-color: #1f2937;
    color: #f3f4f6;
  }

  .chatbot-messages {
    background-color: #111827;
  }

  .chatbot-input {
    background-color: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
  }

  .chatbot-input::placeholder {
    color: #9ca3af;
  }

  .chatbot-bubble-bot {
    background-color: #4b5563;
    color: #f3f4f6;
  }
}
