/**
 * Общая анимация индикатора набора для AI-чатов.
 * Цвета точек задаются контекстом каждого чата (#airo-*-chat-root).
 */

.airo-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 1em;
  vertical-align: middle;
}

.airo-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  animation: airo-typing-bounce 1.15s ease-in-out infinite;
}

.airo-typing__dot:nth-child(1) {
  animation-delay: 0s;
}

.airo-typing__dot:nth-child(2) {
  animation-delay: 0.16s;
}

.airo-typing__dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes airo-typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.38;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* AIRoGuide */
#airo-system-chat-root .asc-plaque__body--typing {
  display: flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 0 1px;
  white-space: nowrap;
}

#airo-system-chat-root .airo-typing__dot {
  background: rgba(200, 225, 248, 0.55);
}

/* AI-Тренер */
#airo-ai-trainer-chat-root .atcm-msg-text--typing {
  display: flex;
  align-items: center;
  min-height: 40px;
  min-width: 72px;
  padding: 4px 2px;
}

#airo-ai-trainer-chat-root .airo-typing__dot {
  background: rgba(160, 225, 243, 0.72);
}

/* AIRo Mission */
#airo-mission-chat-root .atcm-msg-text--typing {
  display: flex;
  align-items: center;
  min-height: 40px;
  min-width: 72px;
  padding: 4px 2px;
}

#airo-mission-chat-root .airo-typing__dot {
  background: rgba(255, 210, 150, 0.78);
}

body.island-media-page #airo-mission-chat-root .airo-typing__dot {
  background: rgba(255, 198, 120, 0.85);
}

@media (max-width: 768px) {
  .airo-typing__dot {
    width: 6px;
    height: 6px;
  }

  @keyframes airo-typing-bounce {
    0%,
    60%,
    100% {
      transform: translateY(0);
      opacity: 0.38;
    }
    30% {
      transform: translateY(-3px);
      opacity: 1;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .airo-typing__dot {
    animation: airo-typing-fade 1.15s ease-in-out infinite;
  }

  @keyframes airo-typing-fade {
    0%,
    100% {
      opacity: 0.35;
    }
    50% {
      opacity: 1;
    }
  }
}
