/* ============================================================
   Demo 1 — Asistente Agéntico de Ventas & Calificación de Leads
   Simulación 100% front-end (sin IA real, sin backend). Piezas
   específicas de esta demo (browser mock + chat). Lo compartido
   con otras demos (hero, split, arch, metrics, stack, switcher)
   vive en demo-shared.css, enlazado antes que este archivo.
   ============================================================ */

/* LIVE DEMO SECTION */
.demo1-demo { padding-block: 24px 80px; }
.demo1-demo > .section-heading { margin-top: 8px; }
.demo1-demo > .section-sub { margin-bottom: 40px; }

.demo1-stage {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr;
  gap: 32px;
  align-items: start;
}

/* Fake browser frame */
.demo1-browser {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}
.demo1-browser__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.demo1-browser__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.demo1-browser__url {
  margin-left: 10px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 12px;
}
.demo1-browser__page {
  position: relative;
  min-height: 560px;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(var(--accent-rgb), 0.06), transparent 40%),
    var(--bg);
}
.demo1-fake-block {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.demo1-fake-block--lg { height: 84px; margin-bottom: 16px; }
.demo1-fake-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.demo1-fake-grid .demo1-fake-block { height: 90px; }

/* Chat panel embedded in the fake page */
.demo1-chat {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  max-width: 340px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px -15px rgba(var(--accent-rgb), 0.3);
  overflow: hidden;
}
.demo1-chat__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.demo1-chat__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.demo1-chat__title { font-family: var(--font-heading); font-weight: 600; font-size: 14px; }
.demo1-chat__status {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-secondary);
}
.demo1-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3ecf8e;
  box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6);
  animation: demo1-pulse-ring 2s ease-out infinite;
}

/* Step progress dots sit in the chat header, right-aligned */
.demo1-progress { margin-left: auto; flex-shrink: 0; }

.demo1-chat__body {
  position: relative;
  height: 340px;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* This demo overlays the "Continuar" nudge over the bottom of the
   conversation, with a gradient scrim so it reads as floating above
   the messages rather than pushing the panel taller. */
.demo1-continue {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 16px 12px;
  background: linear-gradient(180deg, transparent, var(--card) 42%);
}

.demo1-chat__footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

/* Bubbles */
.demo1-bubble {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  animation: demo1-bubble-in 0.28s ease;
}
.demo1-bubble--bot {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.demo1-bubble--user {
  align-self: flex-end;
  background: var(--accent-soft);
  border-bottom-right-radius: 4px;
}
/* Typing indicator */
.demo1-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 11px 13px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  border-bottom-left-radius: 4px;
}
.demo1-typing span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: demo1-typing-bounce 1.1s ease-in-out infinite;
}
.demo1-typing span:nth-child(2) { animation-delay: 0.15s; }
.demo1-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes demo1-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Mini contact-capture form bubble */
.demo1-form {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  animation: demo1-bubble-in 0.28s ease;
}
.demo1-form__field { display: flex; flex-direction: column; gap: 3px; }
.demo1-form__field label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.demo1-form__value {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  min-height: 18px;
  position: relative;
}
.demo1-form__value.is-typing::after {
  content: '';
  display: inline-block;
  width: 2px; height: 13px;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: demo1-caret-blink 0.9s step-end infinite;
}
/* Result cards */
.demo1-results { display: flex; flex-direction: column; gap: 20px; }
.demo1-result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.5s cubic-bezier(.2,.8,.2,1), transform 0.5s cubic-bezier(.2,.8,.2,1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.demo1-result-card.is-visible {
  opacity: 1;
  transform: none;
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 16px 40px -20px rgba(var(--accent-rgb), 0.35);
}
.demo1-result-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.demo1-result-card__title { font-family: var(--font-heading); font-weight: 600; font-size: 14px; }
.demo1-result-card.is-visible .demo1-check svg { stroke-dashoffset: 0; }

.demo1-result-card__list { display: flex; flex-direction: column; gap: 8px; }
.demo1-result-card__list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.demo1-result-card__list dt { color: var(--text-muted); }
.demo1-result-card__list dd { color: var(--text-primary); font-weight: 500; text-align: right; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .demo1-status-dot,
  .demo1-typing span,
  .demo1-form__value.is-typing::after { animation: none; }
  .demo1-result-card { transition: none; }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .demo1-stage { grid-template-columns: 1fr; }
  .demo1-chat { position: static; max-width: 100%; margin-top: 20px; }
  .demo1-browser__page { min-height: auto; padding-bottom: 16px; }
}

@media (max-width: 640px) {
  .demo1-fake-grid { grid-template-columns: repeat(2, 1fr); }
}
