/* ====== DEMO MODAL ====== */
.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.demo-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.demo-container {
  width: 90vw;
  max-width: 960px;
  height: 80vh;
  max-height: 620px;
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  transform: scale(0.95) translateY(20px);
  transition: transform 300ms ease;
}
.demo-overlay.active .demo-container {
  transform: scale(1) translateY(0);
}

/* Window chrome */
.demo-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1a2332;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.demo-dots {
  display: flex;
  gap: 6px;
}
.demo-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.demo-dots span:nth-child(1) { background: #ef4444; }
.demo-dots span:nth-child(2) { background: #f59e0b; }
.demo-dots span:nth-child(3) { background: #10b981; }
.demo-url {
  flex: 1;
  margin: 0 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 5px 12px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-family: 'Inter', monospace;
}
.demo-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms;
}
.demo-close:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

/* App layout */
.demo-app {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.demo-sidebar {
  width: 200px;
  background: #111827;
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.demo-sidebar-logo {
  padding: 0 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}
.demo-sidebar-logo span:first-child {
  font-size: 18px;
}
.demo-sidebar-logo span:last-child {
  color: white;
  font-size: 13px;
  font-weight: 600;
}
.demo-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-weight: 500;
  transition: all 150ms;
  border-left: 3px solid transparent;
}
.demo-nav-item.active {
  color: white;
  background: rgba(0, 105, 255, 0.1);
  border-left-color: #0069ff;
}
.demo-nav-icon {
  width: 16px;
  text-align: center;
  opacity: 0.6;
}
.demo-nav-item.active .demo-nav-icon { opacity: 1; }

/* Main content */
.demo-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Scenes */
.demo-scene {
  position: absolute;
  inset: 0;
  padding: 20px 24px;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 400ms ease, transform 400ms ease;
  overflow-y: auto;
}
.demo-scene.active {
  opacity: 1;
  transform: translateX(0);
}
.demo-scene.exit {
  opacity: 0;
  transform: translateX(-30px);
}

/* Scene header */
.demo-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.demo-scene-title {
  color: white;
  font-size: 18px;
  font-weight: 700;
}
.demo-scene-subtitle {
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  margin-top: 2px;
}
.demo-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.demo-btn-primary {
  background: #0069ff;
  color: white;
}
.demo-btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
}
.demo-btn-success {
  background: #10b981;
  color: white;
}

/* Cards */
.demo-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 200ms;
}
.demo-card:hover, .demo-card.highlight {
  border-color: rgba(0, 105, 255, 0.3);
}
.demo-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Stats row */
.demo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.demo-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px;
}
.demo-stat-value {
  color: white;
  font-size: 22px;
  font-weight: 700;
}
.demo-stat-label {
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.demo-stat-change {
  font-size: 10px;
  margin-top: 4px;
}
.demo-stat-change.up { color: #10b981; }

/* Bot cards */
.demo-bot-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.demo-bot-status.active { background: rgba(16,185,129,0.15); color: #10b981; }
.demo-bot-status.draft { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }

.demo-bot-name {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
}
.demo-bot-desc {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.4;
}
.demo-bot-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.demo-bot-meta span {
  color: rgba(255,255,255,0.3);
  font-size: 10px;
}

/* Flow builder */
.demo-flow {
  display: flex;
  gap: 20px;
  height: 100%;
}
.demo-flow-canvas {
  flex: 1;
  position: relative;
}
.demo-flow-panel {
  width: 240px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  flex-shrink: 0;
}
.demo-flow-panel-title {
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 12px;
}

.demo-node {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  min-width: 180px;
  transition: border-color 300ms, box-shadow 300ms;
}
.demo-node.highlight {
  border-color: #0069ff;
  box-shadow: 0 0 20px rgba(0, 105, 255, 0.2);
}
.demo-node-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.demo-node-label {
  color: white;
  font-size: 12px;
  font-weight: 500;
}
.demo-node-type {
  color: rgba(255,255,255,0.35);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-connector {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, #0069ff, #00bcd4);
  opacity: 0.3;
}

/* Channel grid */
.demo-channel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.demo-channel-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: all 300ms;
}
.demo-channel-card.deployed {
  border-color: rgba(16, 185, 129, 0.3);
}
.demo-channel-card.deploying {
  border-color: rgba(0, 105, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 105, 255, 0.1);
}
.demo-channel-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 16px;
}
.demo-channel-name {
  color: white;
  font-size: 12px;
  font-weight: 600;
}
.demo-channel-status {
  font-size: 10px;
  margin-top: 4px;
}
.demo-channel-status.live { color: #10b981; }
.demo-channel-status.pending { color: rgba(255,255,255,0.3); }
.demo-channel-status.deploying { color: #0069ff; }

/* Analytics */
.demo-chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 10px;
}
.demo-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: height 800ms ease;
  position: relative;
}
.demo-bar-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}

/* Progress bar */
.demo-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.demo-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 600ms ease;
}

/* Deploy animation */
.demo-deploy-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
}
.demo-checkmark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  animation: demo-pop 400ms ease;
}
@keyframes demo-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Narration bar */
.demo-narration {
  padding: 10px 20px;
  background: #1a2332;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.demo-narration-text {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
}
.demo-narration-step {
  display: flex;
  align-items: center;
  gap: 6px;
}
.demo-step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 200ms;
  cursor: pointer;
}
.demo-step-dot.active {
  background: #0069ff;
  box-shadow: 0 0 6px rgba(0, 105, 255, 0.5);
}
.demo-step-dot.done {
  background: rgba(0, 105, 255, 0.4);
}

/* Typing cursor effect */
.demo-typing::after {
  content: '|';
  animation: blink 800ms step-end infinite;
  color: #0069ff;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Pulse ring on highlight items */
.demo-pulse-ring {
  animation: demo-ring 1.5s ease infinite;
}
@keyframes demo-ring {
  0% { box-shadow: 0 0 0 0 rgba(0,105,255,0.3); }
  70% { box-shadow: 0 0 0 8px rgba(0,105,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,105,255,0); }
}

/* Responsive */
@media (max-width: 768px) {
  .demo-sidebar { display: none; }
  .demo-card-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-stats { grid-template-columns: repeat(2, 1fr); }
  .demo-channel-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-container { height: 85vh; max-height: none; border-radius: 12px; }
  .demo-flow { flex-direction: column; }
  .demo-flow-panel { width: 100%; }
}
