/* ================================================
   WORKFLOW VIDEO DEMO ANIMATIONS
   Step-by-step visual demo player
   ================================================ */

.workflow-demo {
  position: relative;
  background: #0a0a0f;
  border-radius: 16px;
  overflow: hidden;
  margin: 32px 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* --- Mini player overlay --- */
.workflow-player {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 10;
  font-size: 12px;
  color: #94a3b8;
}

.workflow-player-play {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
  animation: playerPulse 2s ease-in-out infinite;
}

@keyframes sceneAppear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes playerPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
  50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.8); }
}

.workflow-progress-text {
  font-weight: 600;
  color: #e2e8f0;
}

/* --- Progress bar --- */
.workflow-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.05);
  z-index: 5;
}

.workflow-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  width: 0%;
  border-radius: 0 2px 2px 0;
  animation: progressFill 6s linear forwards;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

@keyframes progressFill {
  to { width: 100%; }
}

/* --- Scene container --- */
.workflow-scenes {
  padding: 60px 24px 24px;
  position: relative;
  min-height: 300px;
}

/* --- Scene (each step) --- */
.workflow-scene {
  opacity: 0;
  transform: translateY(20px);
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  position: relative;
}

/* --- Connector lines --- */
.workflow-connector {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  opacity: 0;
  animation: connectorAppear 0.4s ease-out forwards;
}

.workflow-connector svg {
  color: #4b5563;
}

/* --- Scene header --- */
.workflow-scene-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.workflow-scene-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}

.workflow-scene.sequential .workflow-scene-number {
  background: linear-gradient(135deg, #f472b6, #ec4899);
  box-shadow: 0 0 15px rgba(244, 114, 182, 0.4);
}

.workflow-scene.parallel .workflow-scene-number {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.4);
}

.workflow-scene.qa .workflow-scene-number {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.workflow-scene-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid;
}

.workflow-scene.sequential .workflow-scene-badge {
  background: rgba(244, 114, 182, 0.1);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
}

.workflow-scene.parallel .workflow-scene-badge {
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.3);
}

.workflow-scene.qa .workflow-scene-badge {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

/* --- Parallel execution zone --- */
.workflow-execution-zone {
  position: relative;
  padding: 16px;
  border-radius: 12px;
  overflow: hidden;
}

.workflow-scene.parallel .workflow-execution-zone {
  background: rgba(34, 211, 238, 0.03);
  border: 1px dashed rgba(34, 211, 238, 0.25);
}

.workflow-execution-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(34,211,238,0.02) 0%, rgba(99,102,241,0.02) 100%);
  pointer-events: none;
}

/* --- Agents grid --- */
.workflow-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  position: relative;
}

/* --- Agent card --- */
.workflow-agent-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(15, 17, 23, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}

/* Parallel agents: appear together with spread effect */
.workflow-scene.parallel .workflow-agent-card {
  animation: agentSpread 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes agentSpread {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    filter: blur(4px);
  }
  60% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Sequential agents: appear one by one */
.workflow-scene.sequential .workflow-agent-card,
.workflow-scene.qa .workflow-agent-card {
  animation: agentSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes agentSlide {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Agent type icon --- */
.workflow-agent-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.workflow-agent-card[data-type="architect"] .workflow-agent-icon {
  background: linear-gradient(135deg, #f472b6, #db2777);
}

.workflow-agent-card[data-type="dev"] .workflow-agent-icon {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.workflow-agent-card[data-type="security"] .workflow-agent-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.workflow-agent-card[data-type="testing"] .workflow-agent-icon {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
}

.workflow-agent-card[data-type="webservice"] .workflow-agent-icon {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.workflow-agent-card[data-type="qa"] .workflow-agent-icon {
  background: linear-gradient(135deg, #4ade80, #16a34a);
}

.workflow-agent-card[data-type="packaging"] .workflow-agent-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.workflow-agent-card[data-type="ops"] .workflow-agent-icon {
  background: linear-gradient(135deg, #64748b, #475569);
}

/* Running indicator */
.workflow-agent-running {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  animation: runningDot 1s ease-in-out infinite;
}

@keyframes runningDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* --- Agent info --- */
.workflow-agent-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.workflow-agent-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  font-family: 'Inter', system-ui, sans-serif;
}

/* --- Parallel burst effect --- */
.workflow-scene.parallel .workflow-execution-zone::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(34,211,238,0.15) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: burstEffect 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes burstEffect {
  0% { width: 0; height: 0; opacity: 1; }
  100% { width: 150%; height: 150%; opacity: 0; }
}

/* --- Scene label --- */
.workflow-scene-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #475569;
  margin-top: 8px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* --- Legend --- */
.workflow-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.3);
  flex-wrap: wrap;
}

.workflow-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  font-family: 'Inter', system-ui, sans-serif;
}

.workflow-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.workflow-legend-item.sequential .workflow-legend-dot {
  background: #f472b6;
  box-shadow: 0 0 6px rgba(244, 114, 182, 0.5);
}

.workflow-legend-item.parallel .workflow-legend-dot {
  background: #22d3ee;
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.5);
}

.workflow-legend-item.qa .workflow-legend-dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .workflow-scene,
  .workflow-agent-card,
  .workflow-connector,
  .workflow-progress-fill {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .workflow-agents-grid {
    grid-template-columns: 1fr;
  }
  
  .workflow-scenes {
    padding: 50px 16px 16px;
  }
  
  .workflow-player {
    padding: 6px 14px;
    gap: 8px;
    font-size: 10px;
  }
}
