/* ========================================
   AUTOMATION FLOW PAGE — Dedicated Styles
   ======================================== */

/* --- Hero --- */
.af-hero {
  position: relative;
  padding: 160px 24px 80px;
  text-align: center;
  overflow: hidden;
}
.af-hero-inner { position: relative; z-index: 1; }
.af-hero-sub { color: var(--text-secondary); font-size: 1.15rem; max-width: 700px; margin: 16px auto 0; line-height: 1.7; }

.af-hero-pulse {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 48px auto 0;
}
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  opacity: 0;
  animation: pulseRing 3s ease-out infinite;
}
.pulse-ring-2 { animation-delay: 1.5s; }
@keyframes pulseRing {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}
.pulse-core {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.4);
  animation: corePulse 2s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { box-shadow: 0 0 40px rgba(56, 189, 248, 0.4); }
  50% { box-shadow: 0 0 60px rgba(56, 189, 248, 0.7), 0 0 100px rgba(167, 139, 250, 0.3); }
}

/* --- Flow Section --- */
.af-flow-section {
  padding: 0 24px 80px;
}
.af-flow-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

/* --- Phase Block --- */
.af-phase {
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.af-phase.phase-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Phase Connector Between Phases --- */
.af-phase-connector {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  position: relative;
}
.af-phase-conn-line {
  width: 3px;
  height: 60px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.af-phase-conn-line::after {
  content: '';
  position: absolute;
  top: -20px;
  left: -3px;
  width: 9px;
  height: 20px;
  background: linear-gradient(to bottom, transparent, var(--accent-cyan), transparent);
  border-radius: 4px;
  filter: blur(1px);
  animation: connPulse 2s ease-in-out infinite;
}
@keyframes connPulse {
  0% { top: -20px; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 60px; opacity: 0; }
}
.af-phase-conn-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: particleBlink 2s ease-in-out infinite;
}
@keyframes particleBlink {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.5); }
}

/* --- Phase Header --- */
.af-phase-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}
.phase-number-wrap {
  position: relative;
  flex-shrink: 0;
}
.phase-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}
.phase-elec-dot {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan), 0 0 24px rgba(56, 189, 248, 0.3);
  animation: dotGlow 2s ease-in-out infinite;
}
.phase-elec-dot-green { background: var(--accent-green); box-shadow: 0 0 12px var(--accent-green); }
@keyframes dotGlow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.4); }
}
.phase-timing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.phase-timing-warn { color: var(--accent-amber); }
.phase-timing-green { color: var(--accent-green); }
.phase-title-wrap h2 { font-size: clamp(1.4rem, 3vw, 2rem); }

/* --- Phase Body --- */
.af-phase-body {
  position: relative;
  padding-left: 40px;
  margin-left: 20px;
}

/* Electric line running down left side of phase body */
.af-electric-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.af-electric-line::before {
  content: '';
  position: absolute;
  left: -2px;
  width: 7px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple));
  opacity: 0.12;
  border-radius: 4px;
}
.af-electric-line::after {
  content: '';
  position: absolute;
  left: -5px;
  top: -40px;
  width: 13px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(56, 189, 248, 0.9) 40%, rgba(167, 139, 250, 1) 60%, transparent);
  border-radius: 6px;
  filter: blur(2px);
  animation: elecRun 2.5s ease-in-out infinite;
}
.af-electric-line-warn::after {
  background: linear-gradient(to bottom, transparent, rgba(251, 191, 36, 0.9) 40%, rgba(248, 113, 113, 1) 60%, transparent);
}
.af-electric-line-green::after {
  background: linear-gradient(to bottom, transparent, rgba(52, 211, 153, 0.9) 40%, rgba(56, 189, 248, 1) 60%, transparent);
}
@keyframes elecRun {
  0% { top: -40px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: calc(100% + 40px); opacity: 0; }
}

/* --- Nodes --- */
.af-node {
  position: relative;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  transition: all 0.4s ease;
  overflow: hidden;
}
.af-node:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.1);
}
.af-node-glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.06), transparent);
  pointer-events: none;
}
.af-node-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.af-node-content { flex: 1; }
.af-node-content h4 { font-size: 1.1rem; margin-bottom: 4px; }
.af-node-content p { color: var(--text-secondary); font-size: 0.9rem; }
.af-node-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 100px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.af-badge-cyan { background: rgba(56, 189, 248, 0.1); color: var(--accent-cyan); border-color: rgba(56, 189, 248, 0.2); }
.af-badge-purple { background: rgba(167, 139, 250, 0.1); color: var(--accent-purple); border-color: rgba(167, 139, 250, 0.2); }
.af-badge-amber { background: rgba(251, 191, 36, 0.1); color: var(--accent-amber); border-color: rgba(251, 191, 36, 0.2); }

/* --- Connector between nodes --- */
.af-connector {
  display: flex;
  justify-content: center;
  padding: 4px 0;
  position: relative;
}
.af-connector-line {
  width: 2px;
  height: 32px;
  background: rgba(56, 189, 248, 0.15);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}
.af-connector-line::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: connDot 1.5s ease-in-out infinite;
}
@keyframes connDot {
  0% { top: -8px; opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { top: 32px; opacity: 0; }
}

/* --- Pipeline Grid --- */
.af-pipeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.af-pipeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: rgba(167, 139, 250, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.08);
  border-radius: 8px;
  transition: all 0.3s ease;
}
.af-pipeline-item:hover {
  border-color: rgba(167, 139, 250, 0.2);
  background: rgba(167, 139, 250, 0.08);
}
.af-pipeline-item i { color: var(--accent-purple); font-size: 0.75rem; }

/* --- Scan Results --- */
.af-scan-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.af-scan-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(251, 191, 36, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.08);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.af-scan-item:hover { border-color: rgba(251, 191, 36, 0.2); background: rgba(251, 191, 36, 0.06); }
.scan-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-amber);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* --- Safeguards --- */
.af-safeguards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.af-safeguard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.af-safeguard i { color: var(--accent-blue); }

/* --- SMS Preview --- */
.af-sms-preview { margin-top: 16px; }
.sms-bubble {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(56, 189, 248, 0.04));
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 16px 16px 16px 4px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
  position: relative;
}
.sms-bubble::before {
  content: 'AI SMS';
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 0.6rem;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-green);
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 4px;
}

/* --- Dual Channel (Phase 4) --- */
.af-dual-channel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.af-channel {
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.4s ease;
}
.af-channel:hover { border-color: rgba(52, 211, 153, 0.3); box-shadow: 0 0 30px rgba(52, 211, 153, 0.08); }
.af-channel-voice { border-color: rgba(167, 139, 250, 0.12); }
.af-channel-voice:hover { border-color: rgba(167, 139, 250, 0.3); box-shadow: 0 0 30px rgba(167, 139, 250, 0.08); }

.af-channel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: rgba(52, 211, 153, 0.04);
  border-bottom: 1px solid rgba(52, 211, 153, 0.08);
}
.af-channel-voice .af-channel-header { background: rgba(167, 139, 250, 0.04); border-color: rgba(167, 139, 250, 0.08); }
.channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
}
.channel-icon-voice { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
.af-channel-header h4 { flex: 1; font-size: 1rem; }
.channel-badge {
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 100px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.channel-badge-voice { background: rgba(167, 139, 250, 0.1); color: var(--accent-purple); border-color: rgba(167, 139, 250, 0.2); }

.af-channel-body { padding: 16px 20px; }
.channel-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.channel-step:last-child { border-bottom: none; }
.channel-step i { color: var(--accent-green); margin-top: 2px; width: 16px; text-align: center; flex-shrink: 0; }
.af-channel-voice .channel-step i { color: var(--accent-purple); }

/* --- Schedule Steps (Phase 5) --- */
.af-schedule-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.af-sched-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(56, 189, 248, 0.03);
  border: 1px solid rgba(56, 189, 248, 0.08);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.af-sched-step:hover { border-color: rgba(56, 189, 248, 0.2); background: rgba(56, 189, 248, 0.06); transform: translateX(4px); }
.sched-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* --- Exceptions (Phase 6) --- */
.af-exceptions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.af-exception {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}
.af-exception:hover { border-color: var(--border-glow); transform: translateY(-2px); }
.exc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.exc-amber { background: rgba(251, 191, 36, 0.1); color: var(--accent-amber); }
.exc-red { background: rgba(248, 113, 113, 0.1); color: var(--accent-red); }
.exc-purple { background: rgba(167, 139, 250, 0.1); color: var(--accent-purple); }
.exc-blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.exc-content h5 { font-size: 0.95rem; margin-bottom: 2px; }
.exc-content p { font-size: 0.8rem; color: var(--text-muted); }

/* --- Loop (Phase 7) --- */
.af-loop-cycle {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}
.af-loop-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.1);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}
.af-loop-item:hover { border-color: rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.03); }
.loop-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.loop-icon-green { background: rgba(52, 211, 153, 0.1); color: var(--accent-green); }
.loop-icon-purple { background: rgba(167, 139, 250, 0.1); color: var(--accent-purple); }
.loop-content { flex: 1; }
.loop-content h5 { font-size: 1rem; margin-bottom: 2px; }
.loop-content p { font-size: 0.85rem; color: var(--text-secondary); }
.loop-arrow { color: var(--accent-cyan); font-size: 1.2rem; opacity: 0.5; }
.loop-arrow-loop { color: var(--accent-green); animation: loopSpin 3s linear infinite; }
@keyframes loopSpin { 100% { transform: rotate(-360deg); } }

/* --- Loop Visual --- */
.af-loop-visual {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}
.loop-orbit {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(56, 189, 248, 0.15);
  border-radius: 50%;
  animation: orbitSpin 12s linear infinite;
}
@keyframes orbitSpin { 100% { transform: rotate(360deg); } }
.orbit-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}
.orbit-dot-1 { top: -6px; left: 50%; margin-left: -6px; background: var(--accent-cyan); color: var(--accent-cyan); }
.orbit-dot-2 { bottom: 20%; right: -6px; background: var(--accent-purple); color: var(--accent-purple); }
.orbit-dot-3 { bottom: 20%; left: -6px; background: var(--accent-green); color: var(--accent-green); }
.loop-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-align: center;
  letter-spacing: 0.12em;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* --- CTA --- */
#af-cta { padding: 40px 0 120px; }

/* ========================================
   HERO PIPELINE — Now handled by app.js
   Keeping only the /automation page styles
   ======================================== */

/* --- Responsive --- */
@media (max-width: 768px) {
  .af-phase-header { flex-direction: column; gap: 12px; }
  .phase-number { font-size: 1.6rem; }
  .af-phase-body { padding-left: 24px; margin-left: 10px; }
  .af-dual-channel { grid-template-columns: 1fr; }
  .af-exceptions-grid { grid-template-columns: 1fr; }
  .af-pipeline-grid { grid-template-columns: 1fr; }
}
