/* ══════════════════════════════════════════════════════════════
   NexcoreIA Chatbot — hoja de estilos aislada.
   Todas las clases usan el prefijo "nexcoreia-chatbot" a propósito,
   para no colisionar con ninguna clase del resto del sitio.
   Usa las variables de color (--blue, --cyan, etc.) ya definidas en
   :root por la página que incluye este archivo, para mantener la
   misma paleta de marca sin duplicar valores.
   Todas las animaciones son transform/opacity puro (baratas para
   el navegador, sin filtros pesados ni layout thrashing).
   ══════════════════════════════════════════════════════════════ */

.nexcoreia-chatbot-launcher,
.nexcoreia-chatbot-window,
.nexcoreia-chatbot-window *{box-sizing:border-box}

/* ── Launcher (robot flotante) ── */
.nexcoreia-chatbot-launcher{
  width:108px;height:108px;border-radius:50%;border:none;cursor:pointer;flex-shrink:0;
  background:transparent;box-shadow:none;
  display:flex;align-items:center;justify-content:center;
  animation:nexcoreiaChatbotFloat 3.6s ease-in-out infinite;
}
.nexcoreia-chatbot-launcher svg{width:74px;height:83px;filter:drop-shadow(0 4px 6px rgba(6,15,35,.35))}
.nexcoreia-chatbot-launcher:hover{
  animation-play-state:paused;
  transform:translateY(-6px) rotate(-6deg) scale(1.05) !important;
}
.nexcoreia-chatbot-launcher:hover .nexcoreia-chatbot-eye{transform:scale(1.18) !important}

.nexcoreia-chatbot-launcher.nexcoreia-chatbot-launcher--greet{
  animation:nexcoreiaChatbotGreet .6s ease-in-out !important;
}
.nexcoreia-chatbot-launcher.nexcoreia-chatbot-launcher--greet .nexcoreia-chatbot-eye{
  animation:nexcoreiaChatbotEyeFlash .6s ease-in-out !important;
}
.nexcoreia-chatbot-launcher.nexcoreia-chatbot-launcher--active{animation:none}

.nexcoreia-chatbot-eye{
  transform-box:fill-box;transform-origin:center;
  animation:nexcoreiaChatbotBlink 6.5s ease-in-out infinite;
}

@keyframes nexcoreiaChatbotFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-6px)}
}
@keyframes nexcoreiaChatbotGreet{
  0%{transform:rotate(0) translateY(0)}
  25%{transform:rotate(-10deg) translateY(-5px)}
  50%{transform:rotate(8deg) translateY(0)}
  75%{transform:rotate(-4deg)}
  100%{transform:rotate(0) translateY(0)}
}
@keyframes nexcoreiaChatbotEyeFlash{
  0%,100%{transform:scale(1)}
  50%{transform:scale(1.35)}
}
@keyframes nexcoreiaChatbotBlink{
  0%,92%,100%{transform:scaleY(1)}
  95%{transform:scaleY(.12)}
  97%{transform:scaleY(1)}
}
@media(prefers-reduced-motion:reduce){
  .nexcoreia-chatbot-launcher{animation:none}
  .nexcoreia-chatbot-launcher:hover{transform:none !important}
  .nexcoreia-chatbot-launcher.nexcoreia-chatbot-launcher--greet{animation:none !important}
  .nexcoreia-chatbot-eye{animation:none}
}
/* En celular el robot ocupaba 78px y tapaba titulares de la pagina al desplazarse. */
@media(max-width:640px){
  .nexcoreia-chatbot-launcher{width:58px;height:58px}
  .nexcoreia-chatbot-launcher svg{width:42px;height:47px}
}
@media(max-width:400px){
  .nexcoreia-chatbot-launcher{width:52px;height:52px}
  .nexcoreia-chatbot-launcher svg{width:38px;height:43px}
}

/* ── Ventana de chat ── */
.nexcoreia-chatbot-window{
  position:fixed;bottom:150px;right:28px;z-index:901;
  width:380px;max-width:calc(100vw - 40px);
  height:560px;max-height:calc(100vh - 230px);
  background:var(--bg2);border:1px solid var(--bord2);border-radius:20px;
  box-shadow:0 24px 64px rgba(0,0,0,.55);
  display:flex;flex-direction:column;overflow:hidden;
  opacity:0;transform:translateY(16px) scale(.97);pointer-events:none;
  transition:opacity .25s,transform .25s,height .25s;
  font-family:"DM Sans",sans-serif;
}
.nexcoreia-chatbot-window.nexcoreia-chatbot-window--open{
  opacity:1;transform:translateY(0) scale(1);pointer-events:auto;
}
.nexcoreia-chatbot-window.nexcoreia-chatbot-window--minimized{height:auto;max-height:none}
.nexcoreia-chatbot-window--minimized .nexcoreia-chatbot-messages,
.nexcoreia-chatbot-window--minimized .nexcoreia-chatbot-form{display:none}
.nexcoreia-chatbot-window--minimized .nexcoreia-chatbot-header{cursor:pointer}
@media(max-width:640px){
  .nexcoreia-chatbot-window{right:16px;bottom:110px;width:calc(100vw - 32px);max-height:calc(100vh - 190px)}
}

/* ── Encabezado ── */
.nexcoreia-chatbot-header{
  background:linear-gradient(135deg,var(--blue),#0040CC);
  padding:14px 14px 14px 16px;display:flex;align-items:center;gap:10px;flex-shrink:0;
}
.nexcoreia-chatbot-header-avatar{
  width:38px;height:38px;border-radius:50%;background:#fff;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.nexcoreia-chatbot-header-avatar svg{width:26px;height:26px}
.nexcoreia-chatbot-header-text{display:flex;flex-direction:column;min-width:0}
.nexcoreia-chatbot-title{
  font-family:"Syne",sans-serif;font-weight:700;font-size:14px;color:#fff;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.nexcoreia-chatbot-subtitle{font-size:11px;color:rgba(255,255,255,.7);margin-top:1px}
.nexcoreia-chatbot-status{
  font-size:11px;color:rgba(255,255,255,.8);display:flex;align-items:center;gap:5px;margin-top:2px;
}
.nexcoreia-chatbot-status-dot{
  width:6px;height:6px;border-radius:50%;background:#00E5A0;box-shadow:0 0 6px #00E5A0;flex-shrink:0;
}
.nexcoreia-chatbot-header-actions{margin-left:auto;display:flex;gap:6px;flex-shrink:0}
.nexcoreia-chatbot-minimize,
.nexcoreia-chatbot-close{
  background:rgba(255,255,255,.14);border:none;color:#fff;
  width:26px;height:26px;border-radius:50%;cursor:pointer;font-size:14px;line-height:1;flex-shrink:0;
}
/* en pantallas tactiles los dos botones del encabezado eran de 26px: muy dificiles de acertar */
@media(max-width:1024px){
  .nexcoreia-chatbot-minimize,
  .nexcoreia-chatbot-close{width:34px;height:34px;font-size:16px}
  .nexcoreia-chatbot-send{width:46px;height:46px}
  .nexcoreia-chatbot-subtitle,.nexcoreia-chatbot-status{font-size:12px}
  .nexcoreia-chatbot-quick-reply{padding:9px 14px;font-size:13px}
  .nexcoreia-chatbot-input{padding:13px 14px;font-size:14px}
}
.nexcoreia-chatbot-minimize:hover,
.nexcoreia-chatbot-close:hover{background:rgba(255,255,255,.24)}

/* ── Área de mensajes ── */
.nexcoreia-chatbot-messages{
  flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;
}
.nexcoreia-chatbot-message{
  max-width:85%;padding:10px 14px;border-radius:14px;font-size:13.5px;line-height:1.55;white-space:pre-line;
}
.nexcoreia-chatbot-message--bot{
  align-self:flex-start;background:rgba(255,255,255,.06);color:var(--txt);border-bottom-left-radius:4px;
}
.nexcoreia-chatbot-message--user{
  align-self:flex-end;background:linear-gradient(135deg,var(--blue),#0040CC);color:#fff;border-bottom-right-radius:4px;
}
.nexcoreia-chatbot-typing{
  align-self:flex-start;display:flex;gap:4px;padding:12px 14px;
  background:rgba(255,255,255,.06);border-radius:14px;border-bottom-left-radius:4px;
}
.nexcoreia-chatbot-typing span{
  width:6px;height:6px;border-radius:50%;background:var(--t3);animation:nexcoreiaChatbotTyping 1.2s infinite;
}
.nexcoreia-chatbot-typing span:nth-child(2){animation-delay:.2s}
.nexcoreia-chatbot-typing span:nth-child(3){animation-delay:.4s}
@keyframes nexcoreiaChatbotTyping{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* ── Preguntas rápidas ── */
.nexcoreia-chatbot-quick-replies{
  align-self:flex-start;max-width:100%;display:flex;flex-wrap:wrap;gap:7px;margin-top:2px;
}
.nexcoreia-chatbot-quick-reply{
  background:rgba(11,92,255,.10);border:1px solid var(--bord2);color:var(--txt);
  font-size:12.5px;font-family:"DM Sans",sans-serif;padding:7px 12px;border-radius:20px;cursor:pointer;
}
.nexcoreia-chatbot-quick-reply:hover{background:rgba(11,92,255,.2)}

/* ── Formulario ── */
.nexcoreia-chatbot-form{
  display:flex;gap:8px;padding:12px;border-top:1px solid var(--bord);flex-shrink:0;
}
.nexcoreia-chatbot-input{
  flex:1;background:rgba(3,8,18,.6);border:1px solid var(--bord);border-radius:11px;
  padding:11px 13px;color:var(--txt);font-size:13.5px;font-family:"DM Sans",sans-serif;outline:none;
}
.nexcoreia-chatbot-input:focus{border-color:var(--bord2)}
.nexcoreia-chatbot-send{
  width:40px;height:40px;border-radius:11px;background:linear-gradient(135deg,var(--blue),var(--cyan));
  border:none;color:#fff;cursor:pointer;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:16px;
}
.nexcoreia-chatbot-send:disabled{opacity:.5;cursor:not-allowed}
