/* ===== CHATBOT FLOTANTE ===== */

.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(157,108,255,.95), rgba(102,51,153,.95));
  border: 2px solid rgba(255,255,255,.20);
  box-shadow: 0 8px 24px rgba(157,108,255,.35),
              0 0 0 1px rgba(255,255,255,.10);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  color: #fff;
  font-size: 24px;
}

.chatbot-button:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(157,108,255,.45),
              0 0 0 1px rgba(255,255,255,.15);
}

.chatbot-button.active {
  transform: scale(0.95);
}

.chatbot-container {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 120px);
  border-radius: 20px;
  background: rgba(20, 20, 35, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.55),
              0 0 0 1px rgba(255,255,255,.08);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-container.active {
  display: flex;
}

.chatbot-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(157,108,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.chatbot-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  border: none;
  color: rgba(255,255,255,.80);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background .2s ease;
}

.chatbot-close:hover {
  background: rgba(255,255,255,.20);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.20);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.30);
}

.chatbot-message {
  display: flex;
  gap: 10px;
  animation: fadeInUp .3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message.user {
  flex-direction: row-reverse;
}

.chatbot-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chatbot-message.user .chatbot-message-avatar {
  background: linear-gradient(135deg, rgba(157,108,255,.90), rgba(102,51,153,.90));
  color: #fff;
}

.chatbot-message.bot .chatbot-message-avatar {
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.80);
}

.chatbot-message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
}

.chatbot-message.user .chatbot-message-content {
  background: linear-gradient(135deg, rgba(157,108,255,.25), rgba(102,51,153,.25));
  border: 1px solid rgba(157,108,255,.30);
  color: #fff;
}

.chatbot-message.bot .chatbot-message-content {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.85);
}

.chatbot-input-container {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}

.chatbot-input-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chatbot-input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  font-family: inherit;
}

.chatbot-input::placeholder {
  color: rgba(255,255,255,.45);
}

.chatbot-input:focus {
  border-color: rgba(157,108,255,.45);
  box-shadow: 0 0 0 3px rgba(157,108,255,.14);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(157,108,255,.95), rgba(102,51,153,.95));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(157,108,255,.40);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-loading {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  max-width: 75%;
}

.chatbot-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.60);
  animation: bounce 1.4s infinite ease-in-out both;
}

.chatbot-loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.chatbot-loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.chatbot-error {
  padding: 12px 16px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.30);
  border-radius: 16px;
  color: rgba(255,255,255,.90);
  font-size: 13px;
  max-width: 75%;
}

/* Responsive */
@media (max-width: 480px) {
  .chatbot-container {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 12px;
    height: calc(100vh - 80px);
  }

  .chatbot-button {
    width: 56px;
    height: 56px;
    bottom: 16px;
    right: 16px;
  }
}


