/* ==========================================================================
   demo.css — Light-Mode SaaS Full-Screen Slide-by-Slide Product Tour
   Matches the project's exact Slate & Emerald design system (theme.css)
   All selectors scoped to #demo-overlay so zero impact on existing app
   ========================================================================== */

#demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background:
    radial-gradient(circle at 12% 18%, rgba(16, 185, 129, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(59, 130, 246, 0.08) 0%, transparent 42%),
    #f1f5f9;
  color: #1f2937;
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

#demo-overlay.demo-closing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ==========================================================================
   TOP HEADER BAR (Matches index.html white topbar + slate-700 accents)
   ========================================================================== */
.demo-topbar {
  height: 68px;
  padding: 0 2rem;
  background: #ffffff;
  border-bottom: 1px solid #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  z-index: 20;
  flex-shrink: 0;
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.demo-brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #1f2937;
  line-height: 1.1;
}

.demo-brand-sub {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #10b981;
}

/* Step Navigation Pills in Topbar */
.demo-steps-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
}

.demo-step-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.demo-step-tab:hover {
  color: #1f2937;
  background: rgba(255, 255, 255, 0.6);
}

.demo-step-tab.active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  border: 1px solid #d1fae5;
}

.demo-step-tab.done {
  color: #10b981;
}

.demo-step-tab .tab-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  transition: all 0.25s ease;
}

.demo-step-tab.active .tab-num {
  background: #10b981;
  color: #ffffff;
}

.demo-step-tab.done .tab-num {
  background: #d1fae5;
  color: #059669;
}

/* Top Right Buttons */
.demo-top-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.demo-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.95rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.demo-btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.demo-btn-outline.paused-active {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.demo-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  background: #10b981;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.demo-btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* ==========================================================================
   FULL-SCREEN SINGLE-STEP SLIDE VIEWPORT
   ========================================================================== */
.demo-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2rem;
  overflow: hidden;
}

/* Individual Slide Container — Occupies full stage, one at a time */
.demo-slide {
  position: absolute;
  inset: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(110px) scale(0.98);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-slide.slide-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  z-index: 5;
}

.demo-slide.slide-exit-left {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-110px) scale(0.98);
  z-index: 2;
}

.demo-slide.slide-enter-left {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-110px) scale(0.98);
}

/* Slide Header Block */
.demo-slide-header {
  text-align: center;
  max-width: 720px;
  margin-bottom: 1.35rem;
}

.demo-slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  margin-bottom: 0.55rem;
}

.demo-slide-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
  font-weight: 800;
  color: #1f2937;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.demo-slide-subtitle {
  font-size: 0.92rem;
  color: #52525b;
  line-height: 1.5;
}

/* Main White Card inside each Slide (Matches project's .bg-white.border-[#e4e4e7].rounded-2xl) */
.demo-card-shell {
  width: 100%;
  max-width: 920px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.07),
              0 4px 10px -2px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.demo-card-topbar {
  background: #f8fafc;
  border-bottom: 1px solid #e4e4e7;
  padding: 0.85rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-window-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ==========================================================================
   SLIDE 1: WHATSAPP QR SCANNER (Matches #connect page)
   ========================================================================== */
.demo-s1-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
}

.demo-qr-stage {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s ease;
}

.demo-qr-stage.connected {
  background: #ecfdf5;
  border: 2px solid #10b981;
}

.demo-qr-frame {
  position: relative;
  width: 200px;
  height: 200px;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid #e4e4e7;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-qr-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, #059669, #10b981, transparent);
  box-shadow: 0 0 12px 2px rgba(16, 185, 129, 0.65);
  top: 10px;
  animation: demoQrScanLight 2.1s ease-in-out infinite alternate;
  z-index: 3;
}

@keyframes demoQrScanLight {
  0% { top: 12px; }
  100% { top: calc(100% - 14px); }
}

.demo-qr-stage.connected .demo-qr-laser-line {
  display: none;
}

.demo-qr-connected-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
  padding: 1rem;
  text-align: center;
}

.demo-qr-stage.connected .demo-qr-connected-overlay {
  opacity: 1;
  transform: scale(1);
}

.demo-timeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.demo-tl-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e4e4e7;
  transition: all 0.35s ease;
}

.demo-tl-item.tl-done {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.demo-tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.35s ease;
}

.demo-tl-item.tl-done .demo-tl-icon {
  background: #10b981;
  color: #ffffff;
}

/* ==========================================================================
   SLIDE 2 & SLIDE 4: LIGHT-MODE WHATSAPP WEB CONVERSATION (Matches #conversations)
   ========================================================================== */
.demo-wa-light-container {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.demo-wa-light-header {
  background: #f0f2f5;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-wa-light-body {
  flex: 1;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0);
  background-size: 20px 20px;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.demo-wa-bubble {
  max-width: 78%;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.48;
  color: #111b21;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  animation: demoLightBubbleIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes demoLightBubbleIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.demo-wa-bubble.incoming {
  align-self: flex-start;
  background: #ffffff;
  border-top-left-radius: 2px;
}

.demo-wa-bubble.outgoing {
  align-self: flex-end;
  background: #d9fdd3;
  border-top-right-radius: 2px;
}

.demo-wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: #667781;
  margin-top: 0.3rem;
}

.demo-wa-typing {
  align-self: flex-end;
  background: #d9fdd3;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border-top-right-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.demo-wa-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  animation: demoLightDot 1s infinite ease-in-out;
}
.demo-wa-typing span:nth-child(2) { animation-delay: 0.18s; }
.demo-wa-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes demoLightDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* ==========================================================================
   SLIDE 3: LIGHT-MODE ADMIN ORDERS DASHBOARD (Matches #orders & #dashboard)
   ========================================================================== */
.demo-s3-body {
  padding: 1.5rem;
  background: #f8fafc;
}

.demo-s3-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.demo-s3-kpi-card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s ease;
}

.demo-s3-kpi-card.kpi-highlight {
  border-color: #10b981;
  background: #ecfdf5;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}

/* Order Table Row Card */
.demo-s3-table-wrap {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  overflow: hidden;
}

.demo-s3-pipeline-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

.demo-s3-step {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 0.7rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  transition: all 0.4s ease;
}

.demo-s3-step.step-current {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
  transform: translateY(-2px);
}

.demo-s3-step.step-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* ==========================================================================
   BOTTOM CONTROL BAR (Prev / Pause-Play / Next / Progress / Enter Dashboard)
   ========================================================================== */
.demo-bottombar {
  background: #ffffff;
  border-top: 1px solid #e4e4e7;
  padding: 0.85rem 2rem;
  z-index: 20;
  flex-shrink: 0;
}

.demo-bottom-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.demo-playback-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-progress-container {
  flex: 1;
  min-width: 220px;
}

.demo-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: #52525b;
  margin-bottom: 0.35rem;
}

.demo-progress-rail {
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.demo-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.15s linear;
}

@media (max-width: 900px) {
  .demo-steps-bar {
    display: none;
  }
  .demo-s1-grid {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .demo-s3-kpis {
    grid-template-columns: 1fr;
  }
  .demo-s3-pipeline-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}
