/* ---- DEMO DASHBOARD ---- */

.demo-page {
  min-height: 100vh;
  padding: 7rem 2rem 4rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(245, 158, 11, 0.06), transparent 60%),
    var(--bg);
}

.demo-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
.demo-header {
  margin-bottom: 3rem;
}

.demo-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.demo-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.demo-subtitle {
  font-size: 1.05rem;
  color: var(--fg-muted);
  max-width: 580px;
  line-height: 1.65;
}

/* Trigger panel */
.demo-trigger-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.trigger-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.trigger-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.trigger-select {
  flex: 1;
  min-width: 180px;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.trigger-select:focus {
  outline: none;
  border-color: var(--accent);
}

.trigger-select option {
  background: #1a1a1f;
}

.btn-trigger {
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #0a0a0b;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-trigger:hover {
  opacity: 0.9;
}

.btn-trigger:active {
  transform: scale(0.97);
}

.btn-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Flow stages */
.demo-flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.flow-stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  opacity: 0.35;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s;
}

.flow-stage.active {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(245, 158, 11, 0.3);
}

.flow-stage.complete {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.03);
}

.stage-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stage-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.flow-stage.complete .stage-icon {
  background: rgba(34, 197, 94, 0.15);
}

.stage-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stage-status {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.flow-stage.complete .stage-status {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.stage-body {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Caller card inside stage 1 */
.caller-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-raised);
  border-radius: 8px;
}

.caller-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.caller-details {
  flex: 1;
}

.caller-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.caller-phone {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.caller-business {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--accent-dim);
  border-radius: 100px;
  white-space: nowrap;
}

/* SMS bubble */
.sms-bubble {
  display: inline-block;
  padding: 0.85rem 1.2rem;
  background: var(--bg-raised);
  border-radius: 14px 14px 14px 4px;
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 420px;
  border: 1px solid var(--border);
}

.sms-meta {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* Appointment card */
.appt-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 10px;
}

.appt-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.appt-detail-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.appt-detail-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #4ade80;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(245, 158, 11, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Recent activity feed */
.demo-history {
  margin-top: 3rem;
}

.history-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.history-empty {
  padding: 2rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
  background: var(--bg-raised);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.history-item:hover {
  border-color: rgba(245, 158, 11, 0.2);
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-dot.booked { background: #4ade80; }
.history-dot.replied { background: var(--accent); }
.history-dot.incoming { background: var(--fg-muted); }

.history-caller {
  flex: 1;
}

.history-caller-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.history-caller-biz {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.history-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-status.booked {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.history-status.replied {
  background: var(--accent-dim);
  color: var(--accent);
}

.history-status.incoming {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-muted);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 320px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-accent {
  color: var(--accent);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
  .demo-page {
    padding: 6rem 1.25rem 3rem;
  }

  .trigger-row {
    flex-direction: column;
  }

  .trigger-select,
  .btn-trigger {
    width: 100%;
  }

  .caller-card {
    flex-wrap: wrap;
  }

  .toast {
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
  }
}
