/* =========================================================
   Try the Receptionist Live — grid layout + Retell call UI
   ========================================================= */

/* Hide carousel-only chrome (dots + arrows) since we're a grid */
.demo-dots,
.demo-arrow {
  display: none !important;
}

/* Suppress the legacy "Swipe →" hint from mobile.css — we're a grid now */
.section--demos .section__header::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

/* Outer wrapper */
.demo-slider-wrap {
  position: relative;
}

/* Grid container (replaces .demo-slider carousel behavior) */
.demo-slider {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 980px) {
  .demo-slider {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .demo-slider {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Card */
.demo-slide {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  min-height: 100%;
}

.demo-slide:hover {
  border-color: rgba(0, 191, 255, 0.32);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 191, 255, 0.08);
}

/* When active (call in progress) — strong primary accent */
.demo-slide.demo-slide--active {
  border-color: rgba(0, 191, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 191, 255, 0.35), 0 10px 32px rgba(0, 191, 255, 0.18);
  background: linear-gradient(180deg, rgba(0,191,255,0.08) 0%, rgba(0,191,255,0.02) 100%);
}

.demo-slide-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
}

.demo-slide-top {
  flex: 1;
}

.demo-industry-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
  font-weight: 600;
}

.demo-biz-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.demo-biz-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.66);
  margin: 0 0 14px;
}

/* Persona row */
.demo-persona-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 6px;
}

.demo-persona-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 191, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.demo-persona-row > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.demo-persona-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.demo-persona-title {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

/* Status badge */
.demo-status-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.32);
  white-space: nowrap;
  flex-shrink: 0;
}

.demo-status-badge[data-state="connecting"] {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.36);
}

.demo-status-badge[data-state="live"] {
  background: rgba(0, 191, 255, 0.18);
  color: #38bdf8;
  border-color: rgba(0, 191, 255, 0.46);
  animation: demoPulse 1.6s ease-in-out infinite;
}

.demo-status-badge[data-state="ended"] {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
}

.demo-status-badge[data-state="error"] {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

@keyframes demoPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Call button */
.demo-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(180deg, #00bfff 0%, #0090d4 100%);
  color: #001a2c;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease, background 0.22s ease;
  box-shadow: 0 2px 10px rgba(0, 191, 255, 0.22);
}

.demo-call-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.demo-call-btn:active {
  transform: translateY(0);
}

.demo-call-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* End-call state */
.demo-call-btn--end {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.32);
}
.demo-call-btn--end:hover {
  filter: brightness(1.08);
}

/* Connecting state */
.demo-call-btn--connecting {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #2a1a00;
  pointer-events: none;
}
.demo-call-btn--connecting svg {
  animation: demoSpin 0.9s linear infinite;
}
@keyframes demoSpin {
  to { transform: rotate(360deg); }
}

.demo-mic-note {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin: 6px 0 0;
}

/* Live indicator bars (audio pulse) on active card */
.demo-live-bars {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 16px;
  margin: 4px 0 -2px;
}
.demo-slide--active .demo-live-bars {
  display: inline-flex;
}
.demo-live-bars span {
  display: inline-block;
  width: 3px;
  height: 14px;
  background: #38bdf8;
  border-radius: 2px;
  animation: demoBars 1s ease-in-out infinite;
}
.demo-live-bars span:nth-child(2) { animation-delay: 0.12s; }
.demo-live-bars span:nth-child(3) { animation-delay: 0.24s; }
.demo-live-bars span:nth-child(4) { animation-delay: 0.36s; }
.demo-live-bars span:nth-child(5) { animation-delay: 0.48s; }
@keyframes demoBars {
  0%, 100% { transform: scaleY(0.3); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Transcript */
.demo-transcript-wrap {
  margin: 24px auto 0;
  max-width: 720px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}

.demo-transcript-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.demo-transcript-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: demoLiveDot 1.4s ease-in-out infinite;
}
@keyframes demoLiveDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.demo-transcript-clear {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.demo-transcript-clear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.demo-transcript-body {
  padding: 12px 14px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}

.demo-transcript-line {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}
.demo-transcript-line strong {
  color: var(--color-primary, #00bfff);
  font-weight: 700;
  margin-right: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.demo-transcript-line--user strong {
  color: #4ade80;
}

/* Mic permission / error toast */
.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 30, 0.96);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.demo-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.demo-toast--ok { border-color: rgba(34, 197, 94, 0.5); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .demo-status-badge[data-state="live"],
  .demo-live-bars span,
  .demo-transcript-dot {
    animation: none !important;
  }
  .demo-call-btn--connecting svg { animation: none !important; }
}
