/* Mixsora Chatbot Widget */

#chatbot-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#chatbot-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chatbot-toggle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 123, 255, 0.5);
}

#chatbot-toggle i {
  font-size: 18px;
}

#chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 500px;
  max-height: 70vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 1;
  transform: translateY(0);
}

#chatbot-window.chatbot-hidden {
  display: none;
  opacity: 0;
  transform: translateY(15px);
}

#chatbot-header {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#chatbot-header .chatbot-title {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#chatbot-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 4px;
}

#chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

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

.chatbot-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chatbot-user .chatbot-bubble {
  background: #007bff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chatbot-bot .chatbot-bubble {
  background: #fff;
  color: #333;
  border: 1px solid #e1e4e8;
  border-bottom-left-radius: 4px;
}

#chatbot-typing {
  padding: 0 16px 8px;
  background: #f8f9fa;
}

#chatbot-typing.chatbot-hidden {
  display: none;
}

.chatbot-typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.chatbot-typing-dots span {
  width: 8px;
  height: 8px;
  background: #adb5bd;
  border-radius: 50%;
  animation: chatbot-bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes chatbot-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

#chatbot-footer {
  display: flex;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e1e4e8;
  gap: 8px;
}

#chatbot-input {
  flex: 1;
  border: 1px solid #ced4da;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

#chatbot-input:focus {
  border-color: #007bff;
}

#chatbot-send {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

#chatbot-send:hover {
  background: #0056b3;
}

#chatbot-send:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  #chatbot-widget {
    bottom: 75px;
    right: 12px;
  }

  #chatbot-window {
    width: 92vw;
    height: 65vh;
    bottom: 60px;
    right: -8px;
  }

  #chatbot-toggle {
    padding: 12px 18px;
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .chatbot-label {
    display: none;
  }
}
