/* Base Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Segoe UI', sans-serif;
}

/* Toggle Button */
.chatbot-toggle-button {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.chatbot-toggle-button:hover {
  transform: scale(1.05);
}

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

/* Chatbot Window */
.chatbot-window {
  width: 360px;
  height: 480px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  bottom: 80px;
  right: 0;
  display: none; /* Hidden by default */
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 16px;
}

.chatbot-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
}

.chatbot-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
}

/* Message Area */
.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: flex;
  max-width: 80%;
  animation: fadeIn 0.3s ease;
  font-size: 14px;
  line-height: 1.4;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.bot {
  align-self: flex-start;
}

.message-avatar img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-top: auto;
}

.message-content {
  padding: 10px 14px;
  border-radius: 18px;
  margin: 0 8px;
}

.message.user .message-content {
  background: #4f46e5;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-content {
  background: #ffffff;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  padding: 12px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.chatbot-input-area input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.chatbot-input-area input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Send Button */
.send-button {
  width: 44px;
  height: 44px;
  background: #4f46e5;
  border: none;
  border-radius: 50%;
  margin-left: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.send-button:hover {
  background: #4338ca;
}

.send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.send-button svg {
  width: 20px;
  height: 20px;
}

/* Typing Indicator */
.typing-dots::before {
  content: "⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓";
  display: inline-block;
  overflow: hidden;
  vertical-align: middle;
  animation: blink 1s steps(10, end) infinite;
}

@keyframes blink {
  0% {
    width: 0;
  }
  100% {
    width: 10ch;
  }
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
