/* Demo page styles */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --accent: #f59e0b;
  --accent-dim: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --border: #30363d;
  --green: #3fb950;
  --green-dim: rgba(63, 185, 80, 0.1);
  --radius: 8px;
  --radius-lg: 14px;
}

.demo-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.demo-header {
  text-align: center;
  margin-bottom: 40px;
}

.demo-badge {
  display: inline-block;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.demo-title {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.demo-subtitle {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--fg);
}

.stat-missed { color: #f97316; }
.stat-green { color: var(--green); }

.stat-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--fg); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-section { margin-bottom: 24px; }
.panel-title {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.panel-desc { color: var(--fg-muted); font-size: 0.9rem; }

/* Chat */
.chat-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-messages {
  height: 380px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message-avatar {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.message-content {
  background: var(--surface-2);
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 80%;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-message.user {
  flex-direction: row-reverse;
}
.chat-message.user .message-content {
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
}
.chat-message.user .message-avatar { order: 1; }

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.quick-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-btn:hover { border-color: var(--accent); color: var(--accent); }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: var(--radius);
  outline: none;
}
#chat-input:focus { border-color: var(--accent); }

.send-btn {
  background: var(--accent);
  color: #000;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius);
  cursor: pointer;
}
.send-btn:hover { background: var(--accent-dim); }

/* Missed Call Simulator */
.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.simulator-left h3,
.simulator-right h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.sim-form label {
  display: block;
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  margin-top: 12px;
}

.sim-form input, .sim-form select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  outline: none;
  box-sizing: border-box;
}
.sim-form input:focus, .sim-form select:focus { border-color: var(--accent); }

.sim-btn {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 16px;
}
.sim-btn:hover { background: var(--accent-dim); }

.call-timeline {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: opacity 0.3s;
}

.tl-icon { font-size: 1.2rem; }
.tl-title { font-size: 0.85rem; font-weight: 500; }
.tl-time { font-size: 0.75rem; color: var(--fg-muted); }

/* Phone mockup */
.phone-mockup {
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.phone-header {
  background: #16213e;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phone-name { font-size: 0.8rem; font-weight: 600; color: var(--fg); }
.phone-time { font-size: 0.7rem; color: var(--fg-muted); }

.phone-body {
  padding: 16px;
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.5;
  background: #0f1729;
}

.sms-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 0 4px;
}

.sms-status {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}
.sms-status.delivered { background: var(--green-dim); color: var(--green); }

.sms-delay { font-size: 0.75rem; color: var(--fg-muted); }

/* CRM Pipeline */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  min-height: 400px;
}

.pipeline-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.col-header {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  text-align: center;
}
.col-header.new { background: rgba(59,130,246,0.15); color: #60a5fa; }
.col-header.contacted { background: rgba(168,85,247,0.15); color: #c084fc; }
.col-header.booked { background: var(--accent-glow); color: var(--accent); }
.col-header.completed { background: var(--green-dim); color: var(--green); }
.col-header.lost { background: rgba(239,68,68,0.1); color: #f87171; }

.col-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.lead-card:hover { border-color: var(--accent); }

.lead-name { font-size: 0.85rem; font-weight: 600; }
.lead-phone { font-size: 0.75rem; color: var(--fg-muted); }
.lead-source { font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }

.lead-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.lead-actions button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.lead-actions button:hover { border-color: var(--accent); color: var(--accent); }

.add-lead-btn {
  background: none;
  border: 1px dashed var(--border);
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
}
.add-lead-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Review */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.flow-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  flex: 1;
  min-width: 140px;
}

.step-icon { font-size: 1.4rem; }
.step-title { font-size: 0.85rem; font-weight: 600; }
.step-desc { font-size: 0.75rem; color: var(--fg-muted); }

.flow-arrow { font-size: 1.2rem; color: var(--fg-muted); }

.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
}

.review-name { font-size: 0.9rem; font-weight: 600; }
.review-service { font-size: 0.75rem; color: var(--fg-muted); margin-top: 2px; }

.trigger-btn {
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.trigger-btn:hover { background: var(--accent); color: #000; }

.empty-state {
  color: var(--fg-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 400px;
  max-width: 90vw;
}

.modal h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.modal-form label {
  display: block;
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  margin-top: 12px;
}

.modal-form input, .modal-form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  outline: none;
  box-sizing: border-box;
}
.modal-form input:focus, .modal-form select:focus { border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .simulator-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .pipeline-board { grid-template-columns: repeat(3, 1fr); }
  .flow-steps { flex-direction: column; align-items: stretch; }
  .flow-arrow { display: none; }
}