/* Asistente virtual GIO — solo ayuda de GeoFact */
#geoAsistenteRoot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1090;
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
}

#geoAsistenteFab {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid rgba(56, 189, 248, 0.55);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background:
    radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.28), transparent 62%),
    linear-gradient(160deg, #0E1640 0%, #050816 100%);
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  z-index: 2;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#geoAsistenteFab img {
  width: 118%;
  height: 118%;
  object-fit: contain;
  object-position: center 8%;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  border-radius: 50%;
  position: relative;
  z-index: 1;
}
#geoAsistenteFab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(56, 189, 248, 0.4);
}
.geo-asistente-fab-close {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 22, 0.55);
  color: #fff;
  font-size: 28px;
  border-radius: 50%;
  z-index: 3;
}
#geoAsistenteFab.is-open .geo-asistente-fab-close {
  display: flex;
}

/* Presencia GIO (login y dentro de GeoFact): se nota que la IA está ahí */
#geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) {
  animation: geoFabBob 2.8s ease-in-out infinite, geoFabGlow 2.4s ease-in-out infinite;
}
#geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) img {
  animation: geoFabFace 3.6s ease-in-out infinite;
}
.geo-asistente-fab-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.geo-asistente-fab-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.55);
  opacity: 0;
}
#geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) .geo-asistente-fab-ring:nth-child(1) {
  animation: geoFabPulse 2.6s ease-out infinite;
}
#geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) .geo-asistente-fab-ring:nth-child(2) {
  animation: geoFabPulse 2.6s ease-out infinite 1.3s;
}
.geo-asistente-fab-live {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid #0B1020;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  z-index: 4;
  pointer-events: none;
}
#geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) .geo-asistente-fab-live {
  animation: geoFabLive 1.8s ease-out infinite;
}
#geoAsistenteFab.geo-asistente-fab-vivo.is-open {
  animation: none;
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.38);
}
#geoAsistenteFab.geo-asistente-fab-vivo.is-open img,
#geoAsistenteFab.geo-asistente-fab-vivo.is-open .geo-asistente-fab-ring,
#geoAsistenteFab.geo-asistente-fab-vivo.is-open .geo-asistente-fab-live {
  animation: none;
}
#geoAsistenteFab.geo-asistente-fab-vivo.is-open .geo-asistente-fab-live {
  display: none;
}

@keyframes geoFabBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes geoFabGlow {
  0%, 100% {
    box-shadow:
      0 10px 28px rgba(124, 92, 255, 0.38),
      0 0 0 0 rgba(56, 189, 248, 0.35);
    border-color: rgba(56, 189, 248, 0.55);
  }
  50% {
    box-shadow:
      0 16px 36px rgba(56, 189, 248, 0.5),
      0 0 22px 4px rgba(124, 92, 255, 0.28);
    border-color: rgba(56, 189, 248, 0.95);
  }
}
@keyframes geoFabPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.55);
    opacity: 0;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}
@keyframes geoFabLive {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
@keyframes geoFabFace {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.03) rotate(-2deg); }
  70% { transform: scale(1.02) rotate(2deg); }
}

#geoAsistenteRoot.is-publico .geo-asistente-hola.is-visible {
  animation: geoHolaIn .35s ease, geoHolaNudge 2.8s ease-in-out 0.6s infinite;
}
@keyframes geoHolaNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  #geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open),
  #geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) img,
  #geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) .geo-asistente-fab-ring,
  #geoAsistenteFab.geo-asistente-fab-vivo:not(.is-open) .geo-asistente-fab-live,
  #geoAsistenteRoot.is-publico .geo-asistente-hola.is-visible {
    animation: none !important;
  }
}

#geoAsistentePanel {
  position: absolute;
  right: 0;
  bottom: 86px;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #0B1020;
  border: 1px solid rgba(120, 162, 255, 0.28);
  box-shadow: 0 24px 60px rgba(5, 8, 22, 0.45);
  color: #E6ECFF;
}
#geoAsistentePanel.is-open {
  display: flex;
}

.geo-asistente-header {
  padding: 10px 16px 10px 10px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(56, 189, 248, 0.18));
  border-bottom: 1px solid rgba(120, 162, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.geo-asistente-avatar {
  width: 58px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.22), transparent 70%),
    rgba(5, 8, 22, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.geo-asistente-avatar img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  object-position: center 8%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.geo-asistente-header h6 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #E6ECFF;
  text-transform: none;
  letter-spacing: -0.02em;
}
.geo-asistente-header small {
  display: block;
  color: rgba(230, 236, 255, 0.62);
  font-size: 0.72rem;
  text-transform: none;
}

.geo-asistente-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.geo-asistente-fila {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  width: fit-content;
}
.geo-asistente-fila.bot {
  align-self: flex-start;
}
.geo-asistente-fila.user {
  align-self: flex-end;
  margin-left: auto;
}
.geo-asistente-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #0A0F2C;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.geo-asistente-mini img {
  width: 120%;
  height: 120%;
  margin: -8% 0 0 -10%;
  object-fit: contain;
  object-position: center 6%;
}
.geo-asistente-msg {
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  min-width: 2.8rem;
  flex: 0 1 auto;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-transform: none;
  letter-spacing: 0;
}
.geo-asistente-fila.bot .geo-asistente-msg {
  background: rgba(230, 236, 255, 0.08);
  border: 1px solid rgba(120, 162, 255, 0.16);
  border-bottom-left-radius: 6px;
}
.geo-asistente-fila.user .geo-asistente-msg {
  background: linear-gradient(135deg, #7C5CFF, #5F3DFF);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.geo-asistente-msg .geo-asistente-titulo {
  font-weight: 700;
  margin-bottom: 6px;
  color: #38BDF8;
  font-size: 0.8rem;
}
.geo-asistente-texto {
  white-space: pre-wrap;
}
.geo-asistente-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.geo-asistente-acciones a,
.geo-asistente-chip {
  border: 1px solid rgba(120, 162, 255, 0.3);
  background: rgba(124, 92, 255, 0.16);
  color: #E6ECFF !important;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.74rem;
  text-decoration: none;
  cursor: pointer;
  text-transform: none;
}
.geo-asistente-acciones a:hover,
.geo-asistente-chip:hover {
  background: rgba(56, 189, 248, 0.22);
}
.geo-asistente-sugerencias {
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(120, 162, 255, 0.14);
  background: #08102E;
}
.geo-asistente-btn-preguntas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(120, 162, 255, 0.35);
  background: rgba(124, 92, 255, 0.18);
  color: #E6ECFF;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.geo-asistente-btn-preguntas:hover,
.geo-asistente-btn-preguntas.is-open {
  background: rgba(56, 189, 248, 0.22);
}
.geo-asistente-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 0;
}
.geo-asistente-chips.d-none {
  display: none !important;
  margin: 0;
  padding: 0;
  max-height: 0;
}
.geo-asistente-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(120, 162, 255, 0.18);
  background: #08102E;
}
.geo-asistente-form input {
  flex: 1;
  border: 1px solid rgba(120, 162, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #E6ECFF;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.86rem;
}
.geo-asistente-form input:focus {
  outline: none;
  border-color: #7C5CFF;
}
.geo-asistente-form button {
  border: 0;
  width: 42px;
  border-radius: 12px;
  background: #7C5CFF;
  color: #fff;
}
.geo-asistente-typing {
  font-size: 0.78rem;
  color: rgba(230, 236, 255, 0.55);
}

.geo-asistente-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 14px 4px;
  background: #08102E;
  border-top: 1px solid rgba(120, 162, 255, 0.14);
}
.geo-asistente-cta-crear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  color: #fff !important;
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 10px 22px -12px rgba(16, 185, 129, 0.75);
}
.geo-asistente-cta-crear:hover {
  filter: brightness(1.06);
  color: #fff !important;
}
.geo-asistente-cta-hint {
  border: 0;
  background: transparent;
  color: rgba(230, 236, 255, 0.65);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  padding: 2px 0 4px;
}
.geo-asistente-cta-hint:hover { color: #38BDF8; }
.geo-asistente-chip.is-cta,
.geo-asistente-acciones a.is-cta {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
  color: #fff !important;
  font-weight: 700;
}

.geo-asistente-hola {
  position: absolute;
  right: 84px;
  bottom: 10px;
  width: min(250px, calc(100vw - 120px));
  padding: 12px 28px 12px 14px;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(180deg, rgba(14, 22, 64, 0.96), rgba(5, 8, 22, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #E6ECFF;
  box-shadow: 0 14px 32px rgba(5, 8, 22, 0.45);
  cursor: pointer;
  display: none;
}
.geo-asistente-hola.is-visible {
  display: block;
  animation: geoHolaIn .35s ease;
}
.geo-asistente-hola strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 4px;
}
.geo-asistente-hola span {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(230, 236, 255, 0.72);
}
.geo-asistente-hola-cerrar {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: transparent;
  color: rgba(230, 236, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
@keyframes geoHolaIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
  #geoAsistenteRoot {
    right: 12px;
    bottom: 12px;
  }
  #geoAsistenteFab {
    width: 64px;
    height: 64px;
  }
  .geo-asistente-hola {
    right: 76px;
    width: min(210px, calc(100vw - 100px));
  }
}
