/* ===========================
   CHATBOT WIDGET STYLES
=========================== */

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

/* Toggle Button */
.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-toggle svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
}

.chatbot-toggle:hover {
  background: #1d4ed8;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.chatbot-toggle.hidden {
  display: none;
}

/* Chat Container */
.chatbot-container {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.chatbot-container.open {
  opacity: 1;
  visibility: visible;
}

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

/* Header */
.chatbot-header {
  background: #2563eb;
  color: white;
  padding: 16px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

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

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-message {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

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

.chatbot-message p {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-message.bot p {
  background: #f1f5f9;
  color: #334155;
}

.chatbot-message.user p {
  background: #2563eb;
  color: white;
}

.bot-message-content {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 90%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.6;
  background: #f1f5f9;
  color: #334155;
  white-space: pre-wrap;
}

.bot-message-content strong {
  font-weight: 600;
  color: #1e293b;
}

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

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* Quick Replies */
.chatbot-quick-replies {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-reply-btn {
  padding: 5px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif;
}

.quick-reply-btn:hover {
  background: #f1f5f9;
  border-color: #2563eb;
  color: #2563eb;
}

/* Input Area */
.chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: #2563eb;
}

.chatbot-send {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.chatbot-send:hover {
  background: #1d4ed8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-container {
    width: 90vw;
    height: 60vh;
    max-width: 380px;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

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

  .chatbot-message p {
    max-width: 85%;
  }
}
