.demo {
  background: var(--color-bg);
  position: relative;
  overflow: hidden;
}

.demo-bg-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(30, 64, 175, 0.1) 0%, rgba(5, 150, 105, 0.04) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.demo .container {
  position: relative;
  z-index: 1;
}

.demo-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.demo-window {
  max-width: 900px;
  margin: 0 auto;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-glow-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.demo-titlebar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-sm);
}

.demo-titlebar-dots {
  display: flex;
  gap: 6px;
}

.demo-titlebar-text {
  flex: 1;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.demo-sidebar {
  width: 48px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) 0;
  gap: var(--space-lg);
}

.demo-sidebar-icon {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  opacity: 0.5;
}

.demo-sidebar-icon.active {
  color: var(--color-primary-light);
  opacity: 1;
}

.demo-body {
  display: flex;
  padding-bottom: var(--space-lg);
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.demo-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Log entry mockups */
.demo-log {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  transition: background var(--transition-fast);
}

.demo-log:hover {
  background: rgba(255, 255, 255, 0.03);
}

.demo-log-time {
  color: var(--color-text-muted);
  white-space: nowrap;
  min-width: 70px;
}

.demo-log-level {
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 52px;
  text-align: center;
}

.demo-log-level--info {
  background: rgba(55, 148, 255, 0.15);
  color: var(--color-info);
}

.demo-log-level--warn {
  background: rgba(204, 167, 0, 0.15);
  color: var(--color-warn);
}

.demo-log-level--error {
  background: rgba(241, 76, 76, 0.15);
  color: var(--color-error);
}

.demo-log-level--debug {
  background: rgba(113, 113, 122, 0.15);
  color: var(--color-debug);
}

.demo-log-msg {
  color: var(--color-text);
  word-break: break-word;
}

/* Insight mockup in demo */
.demo-insight {
  background: rgba(30, 64, 175, 0.06);
  border: 1px solid rgba(30, 64, 175, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-sm) 0;
}

.demo-insight-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.demo-insight-icon {
  color: var(--color-primary-light);
}

.demo-insight-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary-light);
}

.demo-insight-body {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.demo-insight-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
  font-size: 11px;
  color: var(--color-primary-light);
  font-weight: 600;
}

/* Chat panel mockup */
.demo-chat {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.demo-chat-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-heading);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.demo-chat-header i {
  color: var(--color-primary-light);
}

.demo-chat-messages {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.demo-chat-msg {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  line-height: 1.5;
  max-width: 90%;
}

.demo-chat-msg--user {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.demo-chat-msg--ai {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.demo-chat-input {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.demo-chat-input-field {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-family: var(--font-sans);
}

@media (max-width: 768px) {
  .demo-sidebar { display: none; }
  .demo-chat { display: none; }
  .demo-log-time { display: none; }
  .demo-body { padding-bottom: var(--space-md); }
  .demo-content { padding: var(--space-md); }
  .demo-titlebar-text {
    font-size: var(--text-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .demo-window {
    border-radius: var(--radius-lg);
    max-width: 100%;
  }
  .demo-log {
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-size: 10px;
  }
  .demo-log-msg { min-width: 0; word-break: break-word; }
  .demo-insight-body,
  .demo-insight-title { font-size: 10px; }
}

@media (max-width: 480px) {
  .hero-demo-wrapper {
    padding: 0 var(--space-sm);
    margin-top: var(--space-xl);
  }
  .demo-titlebar { padding: var(--space-sm) var(--space-md); }
  .demo-content { padding: var(--space-sm); }
  .demo-log { padding: var(--space-xs) var(--space-sm); }
  .demo-log-level { min-width: 44px; font-size: 9px; }
}
