/* ============================================================
 * Keyframe animations
 * ============================================================ */

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toolIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes flashUp {
  0%   { background: rgba(239, 68, 68, 0.25); }
  100% { background: transparent; }
}
@keyframes flashDown {
  0%   { background: rgba(34, 197, 94, 0.25); }
  100% { background: transparent; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.2); }
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

/* Typing dots */
.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  height: 14px;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-bright);
  animation: typingBlink 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-2px); }
}

/* K-line draw animation (applied to path via stroke-dashoffset) */
.kline-draw path,
.kline-draw line,
.kline-draw rect {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: klineDraw 0.9s var(--ease-out) forwards;
}
.kline-draw rect {
  /* Animate fill opacity instead for candles */
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
  opacity: 0;
  animation: candleIn 0.4s var(--ease-out) forwards;
}
@keyframes klineDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes candleIn {
  to { opacity: 1; }
}

/* Heat cell entry */
.heat-cell {
  opacity: 0;
  animation: cellIn 0.5s var(--ease-out) forwards;
}
@keyframes cellIn {
  to { opacity: 1; }
}

/* Scan line for "agent working" effect */
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: scanMove 2.4s linear infinite;
  opacity: 0.6;
}
@keyframes scanMove {
  0%   { top: 0; }
  100% { top: 100%; }
}
