/* See in Action — animated demo */
.action-page {
  background: var(--gradient-hero);
}

.action-hero {
  padding: calc(var(--nav-height) + 3rem) 2rem 2rem;
  text-align: center;
  position: relative;
}

.action-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.action-hero p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.action-demo-section {
  padding: 2rem 2rem 4rem;
}

.action-demo-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: start;
}

/* Phone mockup */
.demo-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 580px;
  padding: 2rem;
}

.demo-stage-bg {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(236,254,255,0.6) 100%);
  border: 1px solid rgba(6, 182, 212, 0.12);
  box-shadow: var(--shadow-card), 0 0 80px rgba(6, 182, 212, 0.1);
  overflow: hidden;
}

.demo-stage-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(20, 184, 166, 0.06) 0%, transparent 45%);
}

.demo-clinic-scene {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(236,254,255,0.5), transparent);
  opacity: 0.6;
}

.demo-phone {
  position: relative;
  z-index: 2;
  width: 280px;
  background: #1a1a2e;
  border-radius: 36px;
  padding: 12px;
  box-shadow:
    0 24px 60px rgba(12, 53, 71, 0.25),
    0 0 0 2px rgba(255,255,255,0.1) inset,
    0 0 40px rgba(6, 182, 212, 0.15);
  animation: phoneFloat 5s ease-in-out infinite;
}

.demo-phone-notch {
  width: 80px;
  height: 22px;
  background: #1a1a2e;
  border-radius: 0 0 14px 14px;
  margin: -4px auto 6px;
  position: relative;
  z-index: 5;
}

.demo-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  background: #0f172a;
  border-radius: 26px;
  overflow: hidden;
}

.demo-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
  display: flex;
  flex-direction: column;
}

.demo-scene.active {
  opacity: 1;
  visibility: visible;
}

/* Scene 1 — Capture */
.scene-capture {
  background: linear-gradient(180deg, #e2f0f2 0%, #cbd5e1 100%);
}

.capture-clinic-header {
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--navy);
  background: rgba(255,255,255,0.85);
}

.capture-viewfinder {
  flex: 1;
  position: relative;
  margin: 8px 14px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  min-height: 200px;
}

.capture-skin-photo,
.scan-skin-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.capture-viewfinder .capture-skin-photo {
  animation: captureFocus 4s ease-in-out infinite;
}

.capture-lesion {
  position: absolute;
  top: 38%;
  left: 52%;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #5c2e0a 0%, #7c3a12 50%, transparent 70%);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(124, 58, 18, 0.4);
  animation: lesionPulse 2s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

.capture-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(6, 182, 212, 0.9);
  animation: cornerPulse 1.5s ease-in-out infinite;
}

.capture-corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.capture-corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.capture-corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.capture-corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.capture-scan-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 53, 71, 0.75);
  color: white;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  animation: hintBlink 1.2s ease-in-out infinite;
}

.capture-shutter-bar {
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.9);
}

.capture-shutter {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--teal-500);
  display: grid;
  place-items: center;
  animation: shutterPulse 1.5s ease-in-out infinite;
}

.capture-shutter-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-glow);
}

.capture-flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.capture-flash.flash {
  animation: cameraFlash 0.5s ease-out forwards;
}

/* Scene 2 — Scan */
.scene-scan {
  background: #0f172a;
}

.scan-image-wrap {
  flex: 1;
  position: relative;
  margin: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
}

.scan-line-anim {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan-glow);
  box-shadow: 0 0 16px var(--cyan-glow), 0 0 32px rgba(6, 182, 212, 0.4);
  animation: demoScanLine 2s ease-in-out infinite;
  z-index: 2;
}

.scan-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(6,182,212,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  animation: gridDrift 4s linear infinite;
}

.scan-nodes {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.scan-node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--cyan-glow);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan-glow);
  animation: nodeOrbit 3s ease-in-out infinite;
}

.scan-node:nth-child(1) { top: 25%; left: 30%; }
.scan-node:nth-child(2) { top: 40%; left: 65%; animation-delay: -0.8s; }
.scan-node:nth-child(3) { top: 60%; left: 40%; animation-delay: -1.6s; }
.scan-node:nth-child(4) { top: 35%; left: 50%; animation-delay: -2.2s; }

.scan-progress-panel {
  padding: 14px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(6, 182, 212, 0.2);
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal-200);
  margin-bottom: 8px;
}

.scan-status-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan-glow);
  border-radius: 50%;
  animation: pulse 1s ease infinite;
}

.scan-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-glow);
  border-radius: 4px;
  transition: width 0.15s linear;
}

.scan-progress-label {
  font-size: 0.62rem;
  color: var(--slate-light);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

/* Scene 3 — Mind Map */
.scene-mindmap {
  background: #f8fbfc;
}

.mindmap-header {
  padding: 12px 14px 10px;
  background: white;
  border-bottom: 1px solid rgba(6, 182, 212, 0.1);
}

.mindmap-header h3 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
}

.mindmap-header p {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mindmap-progress {
  height: 3px;
  background: var(--ice);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.mindmap-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-glow);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.mindmap-progress-label {
  font-size: 0.58rem;
  color: var(--teal-600);
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.mindmap-body {
  flex: 1;
  padding: 10px 12px;
  overflow: hidden;
}

.mindmap-tree {
  position: relative;
}

.mindmap-root {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal-700) 100%);
  color: white;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.mm-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan-glow);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan-glow);
  animation: pulse 1.5s ease infinite;
  flex-shrink: 0;
}

.mindmap-connector {
  width: 2px;
  height: 8px;
  background: linear-gradient(to bottom, var(--teal-400), var(--teal-200));
  margin: 0 auto 4px;
  border-radius: 2px;
}

.mindmap-question {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: white;
  border: 1px solid rgba(6, 182, 212, 0.12);
  border-radius: 10px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s, box-shadow 0.3s;
}

.mindmap-question.show {
  opacity: 1;
  transform: translateX(0);
}

.mindmap-question.answered {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.1);
}

.mm-q-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.mm-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mm-answer {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid rgba(6, 182, 212, 0.2);
  transition: all 0.35s ease;
}

.mindmap-question.answered .mm-answer:first-child {
  background: var(--gradient-glow);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
  animation: answerPop 0.4s ease;
}

.mm-answer.mm-dim {
  background: var(--ice);
  color: var(--slate-light);
  border-color: transparent;
  opacity: 0.5;
}

.mindmap-footer {
  padding: 10px 14px;
  background: white;
  border-top: 1px solid rgba(6, 182, 212, 0.1);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--teal-600);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mindmap-status-dot {
  width: 6px;
  height: 6px;
  background: var(--cyan-glow);
  border-radius: 50%;
  animation: pulse 1s ease infinite;
}

/* Scene 4 — Diagnose */
.scene-diagnose {
  background: #f8fbfc;
}

.diagnose-header {
  padding: 14px;
  background: white;
  border-bottom: 1px solid rgba(6, 182, 212, 0.1);
}

.diagnose-header h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}

.diagnose-header p {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.diagnose-confidence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--teal-50);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--teal-700);
}

.diagnose-list {
  flex: 1;
  padding: 10px 14px;
  overflow: hidden;
}

.diagnose-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: white;
  border: 1px solid rgba(6, 182, 212, 0.12);
  border-radius: 12px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.diagnose-item.show {
  opacity: 1;
  transform: translateX(0);
}

.diagnose-item.primary {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.12);
}

.diagnose-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ice);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--teal-700);
  flex-shrink: 0;
}

.diagnose-item.primary .diagnose-rank {
  background: var(--gradient-glow);
  color: white;
}

.diagnose-name {
  flex: 1;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--navy);
}

.diagnose-pct {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--teal-600);
}

.diagnose-item.primary .diagnose-pct {
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1rem;
}

/* Scene 4 — Treatment */
.scene-treat {
  background: #f8fbfc;
}

.treat-header {
  padding: 14px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal-700) 100%);
  color: white;
}

.treat-header h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
}

.treat-header p {
  font-size: 0.62rem;
  opacity: 0.8;
  margin-top: 2px;
}

.treat-body {
  flex: 1;
  padding: 12px 14px;
  overflow: hidden;
}

.treat-section-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 8px;
  margin-top: 4px;
}

.treat-card {
  background: white;
  border: 1px solid rgba(6, 182, 212, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.treat-card.show {
  opacity: 1;
  transform: translateY(0);
}

.treat-card h4 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.treat-card p {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.treat-card .treat-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: var(--teal-50);
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--teal-700);
}

.treat-action-bar {
  padding: 12px 14px;
  background: white;
  border-top: 1px solid rgba(6, 182, 212, 0.1);
}

.treat-action-btn {
  width: 100%;
  padding: 10px;
  background: var(--gradient-glow);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
  animation: btnGlow 2s ease-in-out infinite;
}

/* Side panel — live steps */
.demo-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}

.demo-step-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.demo-step {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid rgba(6, 182, 212, 0.1);
  border-radius: 14px;
  transition: all 0.4s ease;
  cursor: default;
}

.demo-step.active {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: var(--shadow-soft), 0 0 24px rgba(6, 182, 212, 0.12);
  transform: translateX(4px);
}

.demo-step.done {
  opacity: 0.65;
}

.demo-step-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ice);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal-600);
  flex-shrink: 0;
  transition: all 0.4s;
}

.demo-step.active .demo-step-num {
  background: var(--gradient-glow);
  color: white;
  box-shadow: var(--shadow-glow);
}

.demo-step.done .demo-step-num {
  background: var(--teal-50);
  color: var(--teal-700);
}

.demo-step-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.demo-step-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.demo-live-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.demo-stat {
  background: white;
  border: 1px solid rgba(6, 182, 212, 0.1);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.demo-stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demo-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Info sections below demo */
.action-info-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 2rem 4rem;
}

.action-info-card {
  background: white;
  border: 1px solid rgba(6, 182, 212, 0.1);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.4s, box-shadow 0.4s;
}

.action-info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.action-info-card .icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.action-info-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.action-info-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.action-banner {
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.action-banner-inner {
  background: linear-gradient(135deg, var(--navy) 0%, #0a4a5e 50%, var(--teal-700) 100%);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.action-banner-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
}

.action-banner-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
  position: relative;
}

.action-banner-inner p {
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  position: relative;
  font-size: 0.95rem;
}

@keyframes captureFocus {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes answerPop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(0.5deg); }
}

@keyframes lesionPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes cornerPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes hintBlink {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@keyframes shutterPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes cameraFlash {
  0% { opacity: 0; }
  15% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes demoScanLine {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(6, 182, 212, 0.55); }
}

@media (max-width: 1024px) {
  .action-demo-layout {
    grid-template-columns: 1fr;
  }

  .demo-sidebar {
    position: static;
  }

  .action-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .demo-stage {
    min-height: 520px;
    padding: 1rem;
  }

  .demo-phone {
    width: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-phone,
  .capture-shutter,
  .capture-corner,
  .capture-lesion,
  .scan-line-anim,
  .scan-node,
  .treat-action-btn {
    animation: none !important;
  }
}
