/* ========================================
   GEASIS BOT - Asistente Motivacional
======================================== */

.geasis-bot {
  position: fixed;
  bottom: 40px;
  left: 40px;
  z-index: 999;
  pointer-events: none;
}

/* ========== BOT AVATAR ========== */
.bot-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.3s ease;
}

.bot-avatar:hover {
  transform: scale(1.1);
}

.bot-avatar-circle {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 188, 212, 0.4);
  position: relative;
  z-index: 2;
  animation: bot-breathe 3s ease-in-out infinite;
}

@keyframes bot-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.bot-avatar-circle svg {
  color: #fff;
}

/* Pulso del bot */
.bot-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: bot-pulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes bot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ========== BOT MESSAGE ========== */
.bot-message {
  position: absolute;
  bottom: 75px;
  left: 0;
  min-width: 280px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  cursor: pointer;
}

[data-theme="light"] .bot-message {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.bot-message.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.bot-message:hover {
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 188, 212, 0.2);
}

/* Flecha que apunta al bot */
.bot-message::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--bg-card);
}

.bot-message::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 19px;
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 11px solid var(--border);
}

.bot-message:hover::after {
  border-top-color: var(--bg-card);
}

/* ========== TYPING INDICATOR ========== */
.bot-typing {
  display: none;
  gap: 6px;
  align-items: center;
  height: 24px;
}

.bot-typing.active {
  display: flex;
}

.bot-typing span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bot-typing-bounce 1.4s infinite ease-in-out;
}

.bot-typing span:nth-child(1) {
  animation-delay: 0s;
}

.bot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.bot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bot-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* ========== BOT TEXT ========== */
.bot-text {
  display: none;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
}

.bot-text.visible {
  display: block;
  animation: bot-text-fade 0.4s ease;
}

@keyframes bot-text-fade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== CLOSE BUTTON ========== */
.bot-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  padding: 0;
}

.bot-close:hover {
  opacity: 1;
  background: rgba(255, 71, 87, 0.1);
  transform: scale(1.1);
}

.bot-close svg {
  color: var(--text-muted);
}

.bot-close:hover svg {
  color: var(--error);
}

/* ========== BADGE DE NOTIFICACIÓN (opcional) ========== */
.bot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--error);
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 3;
  animation: badge-bounce 2s ease-in-out infinite;
}

@keyframes badge-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* ========== ESTADOS DEL BOT ========== */
.geasis-bot.dismissed .bot-message {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .geasis-bot {
    bottom: 24px;
    left: 24px;
  }

  .bot-avatar {
    width: 56px;
    height: 56px;
  }

  .bot-avatar-circle {
    width: 56px;
    height: 56px;
  }

  .bot-avatar-circle svg {
    width: 24px;
    height: 24px;
  }

  .bot-message {
    min-width: 260px;
    max-width: 280px;
    padding: 16px;
    bottom: 70px;
  }

  .bot-text {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .geasis-bot {
    bottom: 20px;
    left: 20px;
  }

  .bot-avatar {
    width: 52px;
    height: 52px;
  }

  .bot-avatar-circle {
    width: 52px;
    height: 52px;
  }

  .bot-message {
    min-width: 240px;
    max-width: 260px;
    padding: 14px;
  }

  .bot-text {
    font-size: 13px;
  }
}

/* ========== REDUCE MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  .bot-avatar-circle,
  .bot-pulse,
  .bot-badge {
    animation: none;
  }

  .bot-message {
    transition-duration: 0.01ms;
  }
}
