/* Bot "Vortex/A" del sitio principal (Facturacion Electronica + ERP).
   Mismo criterio que el bot del curso (vortex-ed-chatbot.css): abajo a la
   izquierda, para no superponerse con el boton global de WhatsApp
   (data-whatsapp-chat, inyectado por theme.js) que esta fijo abajo-derecha. */

.va-bot-launcher {
  position: fixed;
  left: max(22px, env(safe-area-inset-left));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: linear-gradient(145deg, #00A8FF, #2563EB);
  color: #ffffff;
  padding: 12px 18px 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 13px 34px rgba(37, 99, 235, 0.38), 0 0 0 6px rgba(37, 99, 235, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.va-bot-launcher:hover,
.va-bot-launcher:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 17px 38px rgba(37, 99, 235, 0.44), 0 0 0 7px rgba(37, 99, 235, 0.14);
}

.va-bot-launcher svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.va-bot-launcher.is-hidden {
  display: none;
}

.va-bot-panel {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 9001;
  width: min(380px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: #071426;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2, 10, 20, 0.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.va-bot-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.va-bot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(145deg, #00A8FF, #2563EB);
  color: #fff;
}

.va-bot-head strong {
  display: block;
  font-size: 14px;
}

.va-bot-head small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
}

.va-bot-close {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.va-bot-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #071426;
}

.va-bot-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.va-bot-msg.from-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #e7edf5;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.va-bot-msg.from-user {
  align-self: flex-end;
  background: linear-gradient(145deg, #00A8FF, #2563EB);
  color: #fff;
}

.va-bot-msg.is-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  animation: va-bot-typing 1s infinite ease-in-out;
}

.va-bot-msg.is-typing span:nth-child(2) { animation-delay: 0.15s; }
.va-bot-msg.is-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes va-bot-typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.va-bot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}

.va-bot-suggestions button {
  border: 1px solid rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.14);
  color: #bcd6ff;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11.5px;
  cursor: pointer;
}

.va-bot-suggestions button:hover {
  background: rgba(37, 99, 235, 0.24);
}

.va-bot-form {
  display: flex;
  gap: 8px;
  padding: 10px 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b1b2b;
}

.va-bot-form input {
  flex: 1 1 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
}

.va-bot-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.va-bot-form input:focus {
  border-color: rgba(37, 99, 235, 0.6);
}

.va-bot-form button {
  flex: 0 0 auto;
  width: 40px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #00A8FF, #2563EB);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.va-bot-form button:disabled {
  opacity: 0.5;
  cursor: default;
}

.va-bot-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2ee66b, #16a951);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.va-bot-wa svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .va-bot-panel {
    width: calc(100vw - 24px);
    height: auto;
    left: 12px;
    right: 12px;
    top: 76px;
    bottom: 86px;
  }

  .va-bot-launcher span.va-bot-launcher-text {
    display: none;
  }
}
