/* Bot del curso Vortex Ed. Se posiciona abajo-izquierda a proposito: ya existe
   un boton flotante de WhatsApp global (data-whatsapp-chat, inyectado por
   theme.js) fijo abajo-derecha, y no deben superponerse. */

.ved-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, #7b5cff, #4f8cff);
  color: #ffffff;
  padding: 12px 18px 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 13px 34px rgba(79, 70, 229, 0.38), 0 0 0 6px rgba(124, 92, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ved-bot-launcher:hover,
.ved-bot-launcher:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 17px 38px rgba(79, 70, 229, 0.44), 0 0 0 7px rgba(124, 92, 255, 0.14);
}

.ved-bot-launcher svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

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

.ved-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(560px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: #0b1b2b;
  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;
}

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

.ved-bot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(145deg, #7b5cff, #4f8cff);
  color: #fff;
}

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

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

.ved-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;
}

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

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

.ved-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);
}

.ved-bot-msg.from-user {
  align-self: flex-end;
  background: linear-gradient(145deg, #7b5cff, #4f8cff);
  color: #fff;
}

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

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

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

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

.ved-bot-suggestions button {
  border: 1px solid rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.12);
  color: #cdd6ff;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11.5px;
  cursor: pointer;
}

.ved-bot-suggestions button:hover {
  background: rgba(124, 92, 255, 0.22);
}

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

.ved-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;
}

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

.ved-bot-form input:focus {
  border-color: rgba(124, 92, 255, 0.6);
}

.ved-bot-form button {
  flex: 0 0 auto;
  width: 40px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #7b5cff, #4f8cff);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

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

.ved-bot-humanlink {
  display: block;
  text-align: center;
  font-size: 11px;
  padding: 7px 0 10px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.ved-bot-humanlink b {
  color: #55e6a5;
}

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

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