/* ── PROGRESSIVE DISCLOSURE ENGINE ────────────────────── */
/* Step visibility, chat bubbles, typing indicator, continue button */

/* ── STEP VISIBILITY ─────────────────────────────────── */
.step-hidden {
  opacity: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}

.step-visible {
  animation: stepReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.step-instant {
  opacity: 1 !important;
}

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


/* ── TYPING INDICATOR ────────────────────────────────── */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  min-height: 28px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%           { transform: translateY(-7px); opacity: 1; }
}

/* ── CHAT-STYLE DIALOGUE ────────────────────────────── */
.dialogue[data-chat] {
  background: transparent;
  border: none;
  padding: 4px 0;
  margin: 6px 0;
}

.dialogue[data-chat] .dialogue-bubble {
  background: var(--bg-card);
  border: 1px solid var(--grey-border);
  border-radius: 18px 18px 18px 4px;
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .dialogue[data-chat] .dialogue-bubble {
  background: rgba(15, 21, 32, 0.85);
  border-color: rgba(255,255,255,0.08);
}

.dialogue[data-chat] .dialogue-bubble p {
  font-style: normal;
}

/* Character accent borders */
.dialogue[data-chat][data-character="ceo"] .dialogue-bubble       { border-left: 3px solid #7C3AED; }
.dialogue[data-chat][data-character="ciso"] .dialogue-bubble      { border-left: 3px solid #2563EB; }
.dialogue[data-chat][data-character="it-mgr"] .dialogue-bubble    { border-left: 3px solid #0891B2; }
.dialogue[data-chat][data-character="auditor"] .dialogue-bubble   { border-left: 3px solid #DC2626; }
.dialogue[data-chat][data-character="customer"] .dialogue-bubble  { border-left: 3px solid #D97706; }
.dialogue[data-chat][data-character="colleague"] .dialogue-bubble { border-left: 3px solid #059669; }

/* Dark mode character glow */
[data-theme="dark"] .dialogue[data-chat][data-character="ceo"] .dialogue-bubble       { box-shadow: var(--shadow-sm), 0 0 12px rgba(124,58,237,0.08); }
[data-theme="dark"] .dialogue[data-chat][data-character="ciso"] .dialogue-bubble      { box-shadow: var(--shadow-sm), 0 0 12px rgba(37,99,235,0.08); }
[data-theme="dark"] .dialogue[data-chat][data-character="it-mgr"] .dialogue-bubble    { box-shadow: var(--shadow-sm), 0 0 12px rgba(8,145,178,0.08); }
[data-theme="dark"] .dialogue[data-chat][data-character="colleague"] .dialogue-bubble { box-shadow: var(--shadow-sm), 0 0 12px rgba(5,150,105,0.08); }

/* Bubble text fade-in after typing */
.bubble-text-reveal {
  animation: bubbleFadeIn 0.3s ease forwards;
}
@keyframes bubbleFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── CONTINUE BUTTON ─────────────────────────────────── */
.continue-prompt {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
  animation: continueFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  box-shadow: 0 2px 12px rgba(37,99,235,0.25);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: 0.2px;
}
.continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,99,235,0.35);
  background: #1D4ED8;
}
.continue-btn:active {
  transform: scale(0.97);
}
.continue-btn svg {
  width: 16px;
  height: 16px;
}

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

/* ── SHOW ALL TOGGLE ─────────────────────────────────── */
.show-all-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  padding: 5px 14px;
  margin-bottom: 12px;
  font-family: var(--font-body);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.show-all-toggle:hover {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
  background: var(--bg-card-alt);
}

/* Hide toggle when all content is shown */
.disclosure-done .show-all-toggle { display: none; }

/* ── DISABLE AUTO-STAGGER WHEN DISCLOSURE IS ACTIVE ── */
.disclosure-active .dialogue,
.disclosure-active .narrator,
.disclosure-active .content-card,
.disclosure-active .task-card,
.disclosure-active .interaction-block,
.disclosure-active .choice-block,
.disclosure-active .reveal-block,
.disclosure-active .video-block,
.disclosure-active .scene-break,
.disclosure-active .email-block {
  animation: none !important;
  /* Reset any stagger delays */
  animation-delay: 0s !important;
}

/* But allow step-visible animation */
.disclosure-active .step-visible {
  animation: stepReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

/* ── REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .typing-dot {
    animation: none !important;
    opacity: 0.5;
  }
  .step-visible {
    animation: none !important;
    opacity: 1;
  }
  .continue-prompt {
    animation: none !important;
  }
  .bubble-text-reveal {
    animation: none !important;
    opacity: 1;
  }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 820px) {
  .continue-btn {
    padding: 12px 24px;
    font-size: 14px;
  }
  .dialogue[data-chat] .dialogue-bubble {
    padding: 10px 14px;
    border-radius: 14px 14px 14px 4px;
  }
}
