/* ── Agent Graph Canvas Styles ────────────────────────────────
 *
 * Animations and filters for the force-directed agent execution
 * graph, following the octogent visual language.
 */

/* ── Canvas background ── */
.agent-graph-canvas {
  background-color: #0a0e14;
  background-image: radial-gradient(#1a2030 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

/* ── Bloom pulse (processing state) ── */
@keyframes canvas-bloom-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

.canvas-node-bloom--pulse {
  animation: canvas-bloom-pulse 3s ease-in-out infinite;
}

/* ── Waiting pill pulse ── */
@keyframes canvas-waiting-pill-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.canvas-waiting-pill {
  animation: canvas-waiting-pill-pulse 1.5s ease-in-out infinite;
}

/* ── Edge activity dot glow ── */
.canvas-edge-dot-trail {
  filter: blur(1.4px)
    drop-shadow(0 0 10px rgba(255, 163, 44, 0.6))
    drop-shadow(0 0 18px rgba(255, 112, 43, 0.45));
}

.canvas-edge-dot-core {
  filter: drop-shadow(0 0 4px rgba(255, 232, 168, 0.95))
    drop-shadow(0 0 10px rgba(255, 163, 44, 0.9))
    drop-shadow(0 0 18px rgba(255, 112, 43, 0.7));
}

/* ── Waiting notification bars ── */
.canvas-waiting-bar {
  background: #f59e0b;
  color: #0a0e14;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-waiting-bar:hover {
  opacity: 0.85;
}

.canvas-waiting-bar-prefix {
  opacity: 0.7;
}

/* ── Toolbar ── */
.canvas-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  gap: 4px;
  background: #0d1017ee;
  backdrop-filter: blur(6px);
  border: 1px solid #2b2f36;
  border-radius: 8px;
  padding: 4px;
}

.canvas-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: #9ca3af;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.canvas-toolbar-btn:hover {
  background: #2b3040;
  color: #d1d5db;
}

/* ── State-specific pulse animations ── */

/* Processing: cyan glow — clearly visible active state */
@keyframes agent-pulse-processing-kf {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(34, 211, 238, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.8))
            drop-shadow(0 0 24px rgba(34, 211, 238, 0.4));
  }
}

.agent-pulse-processing {
  animation: agent-pulse-processing-kf 1.8s ease-in-out infinite;
}

/* Waiting: amber glow — attention needed */
@keyframes agent-pulse-waiting-kf {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.8))
            drop-shadow(0 0 24px rgba(245, 158, 11, 0.4));
  }
}

.agent-pulse-waiting {
  animation: agent-pulse-waiting-kf 1.2s ease-in-out infinite;
}

/* Completed: green glow — single fade, no repeat */
@keyframes agent-pulse-completed-kf {
  0% {
    filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.8));
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
  }
}

.agent-pulse-completed {
  animation: agent-pulse-completed-kf 1.5s ease-out forwards;
}

/* Failed: red glow — urgent pulse */
@keyframes agent-pulse-failed-kf {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.9))
            drop-shadow(0 0 24px rgba(239, 68, 68, 0.5));
  }
}

.agent-pulse-failed {
  animation: agent-pulse-failed-kf 1s ease-in-out infinite;
}

/* Legacy fallback */
.agent-card-pulse {
  animation: agent-pulse-processing-kf 1.8s ease-in-out infinite;
}

/* ── Agent card hover ── */
.agent-card-hover {
  transition: opacity 0.2s ease;
}

g.cursor-pointer:hover .agent-card-hover {
  opacity: 0.06 !important;
}

/* ── Node label ── */
.canvas-node-label {
  font-family: system-ui, -apple-system, sans-serif;
  pointer-events: none;
  user-select: none;
}
