/* =============================================
   ANIMATED EXPLAINERS — Replace Video Content
   ============================================= */

/* --- Explainer Container --- */
.explainer {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 32px 0;
}

.explainer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(245, 166, 35, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.explainer-header .explainer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.explainer-header .explainer-title i {
  color: var(--color-secondary);
}

.explainer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.explainer-controls .step-indicator {
  font-family: var(--font-accent);
  font-size: 14px;
  color: var(--color-text-secondary);
}

.explainer-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.explainer-controls button:hover {
  background: var(--color-secondary);
  color: #0A1628;
  border-color: var(--color-secondary);
}

.explainer-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.explainer-controls button:disabled:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

/* --- Explainer Stage --- */
.explainer-stage {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #0a0e1a;
}

.explainer-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.explainer-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.explainer-slide.exit-left {
  opacity: 0;
  transform: translateX(-40px);
}

/* --- Screenshot in Stage --- */
.explainer-screenshot {
  position: absolute;
  inset: 0;
}

.explainer-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.explainer-screenshot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.6), rgba(10, 22, 40, 0.3));
  pointer-events: none;
}

/* --- Annotation Overlays --- */
.annotation {
  position: absolute;
  z-index: 10;
  animation: annotationIn 0.6s ease forwards;
}

@keyframes annotationIn {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.annotation-box {
  background: rgba(10, 22, 40, 0.92);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  max-width: 260px;
  backdrop-filter: blur(8px);
}

.annotation-box .annotation-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.annotation-box p {
  font-size: 13px;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

.annotation-pointer {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-secondary);
  border-radius: 50%;
  animation: pointerPulse 2s ease-in-out infinite;
}

@keyframes pointerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(245, 166, 35, 0); }
}

.annotation-arrow {
  position: absolute;
  width: 2px;
  background: var(--color-secondary);
  opacity: 0.6;
}

/* --- Slide Content (non-screenshot slides) --- */
.slide-content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 40px;
  max-width: 600px;
}

.slide-content h3 {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .slide-content h3 { font-size: 20px; }
  .slide-content { padding: 24px; }
}

.slide-content p {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 0;
  line-height: 1.6;
}

.slide-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--color-secondary), #D4880E);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #0A1628;
  margin: 0 auto 20px;
  animation: float 4s ease-in-out infinite;
}

/* --- Flowchart Slide --- */
.flowchart {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 32px;
  flex-wrap: nowrap;
  overflow-x: auto;
  width: 100%;
}

@media (max-width: 768px) {
  .flowchart { flex-direction: column; padding: 20px 16px; }
}

.flow-step {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  min-width: 130px;
  flex-shrink: 0;
  opacity: 0;
  animation: flowStepIn 0.4s ease forwards;
}

.flow-step:nth-child(1) { animation-delay: 0.1s; }
.flow-step:nth-child(3) { animation-delay: 0.3s; }
.flow-step:nth-child(5) { animation-delay: 0.5s; }
.flow-step:nth-child(7) { animation-delay: 0.7s; }
.flow-step:nth-child(9) { animation-delay: 0.9s; }

@keyframes flowStepIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.flow-step .flow-icon {
  font-size: 24px;
  color: var(--color-secondary);
  margin-bottom: 8px;
}

.flow-step .flow-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.flow-step.flow-highlight {
  border-color: var(--color-secondary);
  background: rgba(245, 166, 35, 0.1);
}

.flow-step.flow-danger {
  border-color: var(--color-danger);
  background: rgba(252, 129, 129, 0.08);
}

.flow-step.flow-success {
  border-color: var(--color-success);
  background: rgba(72, 187, 120, 0.08);
}

.flow-arrow {
  color: var(--color-secondary);
  font-size: 20px;
  flex-shrink: 0;
  opacity: 0;
  animation: flowStepIn 0.3s ease forwards;
}

.flow-arrow:nth-child(2) { animation-delay: 0.2s; }
.flow-arrow:nth-child(4) { animation-delay: 0.4s; }
.flow-arrow:nth-child(6) { animation-delay: 0.6s; }
.flow-arrow:nth-child(8) { animation-delay: 0.8s; }

@media (max-width: 768px) {
  .flow-arrow { transform: rotate(90deg); }
}

/* --- Stats Counter Animation --- */
.stat-counter {
  font-family: var(--font-accent);
  font-size: 48px;
  font-weight: 700;
  color: var(--color-secondary);
}

/* --- Progress Dots --- */
.explainer-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
}

.explainer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.explainer-dot.active {
  background: var(--color-secondary);
  width: 24px;
  border-radius: 4px;
}

/* --- Auto-play indicator --- */
.explainer-autoplay {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.explainer-autoplay .autoplay-bar {
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.explainer-autoplay .autoplay-fill {
  height: 100%;
  background: var(--color-secondary);
  width: 0%;
  transition: width linear;
}

.explainer-autoplay.playing .autoplay-fill {
  width: 100%;
}
