.workspace-page[data-page="video"] {
  --video-phase-color: #806dff;
}

.workspace-page[data-page="video"] > .panel {
  position: relative;
  overflow: hidden;
  transition: border-color 300ms ease, box-shadow 360ms ease, background 360ms ease;
}

.workspace-page[data-page="video"] > .panel::before {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -135px;
  top: -145px;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  background: var(--video-phase-color);
  filter: blur(58px);
  transition: opacity 360ms ease;
}

.workspace-page[data-page="video"] > .panel.video-step-current {
  border-color: rgba(128, 109, 255, .48);
  box-shadow: 0 22px 60px rgba(2, 6, 13, .22), 0 0 0 1px rgba(128, 109, 255, .045) inset;
}

.workspace-page[data-page="video"] > .panel.video-step-current::before { opacity: .13; }
.workspace-page[data-page="video"] > .panel.video-step-complete { border-color: rgba(64, 217, 160, .22); }

.workspace-page[data-page="video"] .step {
  position: relative;
  overflow: visible;
  transition: color 280ms ease, background 280ms ease, box-shadow 280ms ease, scale 360ms var(--motion-ease-spring);
}

.workspace-page[data-page="video"] .step::after {
  position: absolute;
  inset: -5px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(128, 109, 255, .35);
  border-radius: 13px;
  opacity: 0;
  scale: .78;
}

.video-step-current .step {
  color: #fff;
  background: linear-gradient(135deg, #7561f0, #5d8cff);
  box-shadow: 0 9px 24px rgba(102, 83, 233, .3);
  scale: 1.06;
}

.video-step-current .step::after { animation: videoStepPulse 2.2s ease-out infinite; }
.video-step-complete .step { color: #64ddb1; background: rgba(64, 217, 160, .11); }

.video-stage {
  transition: border-color 300ms ease, box-shadow 400ms ease, scale 420ms var(--motion-ease-spring);
}

.video-stage.has-source {
  border-color: rgba(156, 144, 255, .62);
  box-shadow: inset 0 0 45px #0005, 0 22px 52px #0007, 0 0 0 1px rgba(128, 109, 255, .09);
}

.video-stage.has-source::before {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 22%;
  left: 0;
  top: -24%;
  content: "";
  pointer-events: none;
  opacity: .28;
  background: linear-gradient(180deg, transparent, rgba(128, 109, 255, .19), rgba(64, 217, 160, .1), transparent);
  animation: videoStageScan 7s ease-in-out infinite;
}

.video-stage.stage-media-enter {
  animation: videoStageSourceIn 620ms var(--motion-ease-enter) both;
}

.stage-placeholder span {
  position: relative;
  animation: videoPlaceholderBreathe 3.6s ease-in-out infinite;
}

.overlay-object:not(.hidden) {
  transition: opacity 180ms ease, box-shadow 220ms ease;
}

.overlay-object:not(.hidden):not(.dragging) {
  animation: videoOverlayReady 520ms var(--motion-ease-spring) both;
}

.item-job-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
  margin-top: -5px;
  padding: 8px 10px;
  border: 1px solid rgba(128, 109, 255, .18);
  border-radius: 10px;
  color: #9eafc4;
  background: rgba(8, 14, 23, .56);
  font-size: 11px;
}

.item-job-progress.hidden { display: none; }
.item-job-progress > i { grid-column: 1 / -1; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(128, 109, 255, .11); }
.item-job-progress > i span { display: block; width: var(--job-progress, 10%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #806dff, #5d8cff, #40d9a0); box-shadow: 0 0 12px rgba(128, 109, 255, .45); transition: width 620ms var(--motion-ease-enter); }
.item-job-progress.is-running > i span { background-size: 180% 100%; animation: videoProgressFlow 1.4s linear infinite; }
.item-job-progress.is-ready { border-color: rgba(64, 217, 160, .26); color: #6cdfb4; }
.item-job-progress.is-error { border-color: rgba(255, 107, 125, .3); color: #ff9aaa; }

.batch-progress {
  display: grid;
  gap: 9px;
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid rgba(128, 109, 255, .24);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(128, 109, 255, .07), rgba(64, 217, 160, .025));
}

.batch-progress.hidden { display: none; }
.batch-progress > div { display: flex; justify-content: space-between; gap: 16px; color: #aebdd0; font-size: 12px; }
.batch-progress > div b { color: #d9d5ff; }
.batch-progress > i { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(128, 109, 255, .1); }
.batch-progress > i span { display: block; width: var(--batch-progress, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6e5ce9, #9d91ff 55%, #40d9a0); box-shadow: 0 0 14px rgba(128, 109, 255, .48); transition: width 700ms var(--motion-ease-enter); }
.batch-progress.is-complete { border-color: rgba(64, 217, 160, .28); }
.batch-progress.is-error { border-color: rgba(255, 107, 125, .3); }

.item.ready::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 82% 20%, rgba(64, 217, 160, .14), transparent 36%);
  animation: videoReadyGlow 900ms ease-out both;
}

@keyframes videoStepPulse {
  0% { opacity: .65; scale: .78; }
  70%, 100% { opacity: 0; scale: 1.45; }
}

@keyframes videoStageScan {
  0%, 20% { translate: 0 0; opacity: 0; }
  35% { opacity: .28; }
  70%, 100% { translate: 0 570%; opacity: 0; }
}

@keyframes videoStageSourceIn {
  from { opacity: .35; scale: .975; filter: saturate(.5) blur(3px); }
  to { opacity: 1; scale: 1; filter: saturate(1) blur(0); }
}

@keyframes videoPlaceholderBreathe {
  0%, 100% { opacity: .65; scale: .96; }
  50% { opacity: 1; scale: 1.04; text-shadow: 0 0 24px rgba(128, 109, 255, .35); }
}

@keyframes videoOverlayReady {
  0% { opacity: 0; scale: .88; }
  65% { scale: 1.035; }
  100% { opacity: 1; scale: 1; }
}

@keyframes videoProgressFlow {
  from { background-position: 100% 0; }
  to { background-position: -80% 0; }
}

@keyframes videoReadyGlow {
  from { opacity: 1; box-shadow: 0 0 0 1px rgba(64, 217, 160, .38) inset; }
  to { opacity: 0; box-shadow: 0 0 0 7px rgba(64, 217, 160, 0) inset; }
}

@media (prefers-reduced-motion: reduce) {
  .video-step-current .step::after,
  .video-stage.has-source::before,
  .stage-placeholder span,
  .overlay-object:not(.hidden):not(.dragging),
  .item-job-progress.is-running > i span,
  .item.ready::before {
    animation: none;
  }
}
