/* demo.css — Dental clinic demo chat UI. Uses the LeadLoop design tokens from theme.css */

:root {
  --bg: #F7F6F3;
  --bg-card: #FFFFFF;
  --fg: #0A0A0A;
  --fg-muted: #6B6B6B;
  --accent: #FF4D00;
  --accent-dim: rgba(255, 77, 0, 0.08);
  --border: #E2E0DB;
  --success: #00994D;
  --success-dim: rgba(0, 153, 77, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.demo-nav {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.demo-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.demo-nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.demo-nav-logo span { color: var(--accent); }
.demo-nav-badge {
  font-size: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(255, 77, 0, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
  font-weight: 500;
}

/* MAIN LAYOUT */
.demo-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 768px) {
  .demo-layout { grid-template-columns: 1fr; }
}

/* CHAT PANEL */
.chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: 580px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.06);
}

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-avatar svg { width: 20px; height: 20px; }
.chat-header-info h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}
.chat-header-info p {
  font-size: 12px;
  color: var(--fg-muted);
}
.chat-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}
.chat-status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.msg.ai { align-self: flex-start; }
.msg.user { align-self: flex-end; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.ai .msg-bubble {
  background: #F0EFED;
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-time {
  font-size: 10px;
  color: var(--fg-muted);
  margin-top: 4px;
  padding: 0 4px;
}
.msg.user .msg-time { text-align: right; }

/* Typing indicator */
.msg-typing .msg-bubble {
  background: #F0EFED;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
}
.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--fg-muted);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Chat Input */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 120px;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--fg-muted); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:active { transform: scale(0.95); }

/* Booking confirmed card inside chat */
.msg-booking-card {
  background: var(--success-dim);
  border: 1px solid rgba(0, 153, 77, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  width: 100%;
  max-width: 280px;
}
.msg-booking-card .bc-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--success);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.msg-booking-card .bc-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: flex-start;
}
.msg-booking-card .bc-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.msg-booking-card .bc-text { color: var(--fg); font-size: 13px; }

/* SIDEBAR */
.demo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}
.sidebar-card h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.service-list { display: flex; flex-direction: column; gap: 8px; }
.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}
.service-name { font-weight: 500; }
.service-price { color: var(--accent); font-weight: 600; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-val {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl { font-size: 11px; color: var(--fg-muted); }

.hours-list { display: flex; flex-direction: column; gap: 6px; }
.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.hours-day { font-weight: 500; }
.hours-time { color: var(--fg-muted); }

.contact-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}
.contact-icon { font-size: 16px; }
.contact-val { color: var(--fg-muted); }

/* Demo badge */
.demo-badge-wrap {
  text-align: center;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.demo-badge-wrap p {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.demo-badge-wrap a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.demo-badge-wrap a:hover { text-decoration: underline; }

/* Scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }