/* =======================
   DEMO PAGE — Morrison & Associates
   ======================= */

.demo-page { min-height: 100vh; background: var(--bg-primary); }

.demo-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.demo-nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.demo-nav-right { display: flex; align-items: center; gap: 12px; }
.demo-nav-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 20px;
  background: var(--teal-glow); border: 1px solid rgba(20,184,166,0.3);
  color: var(--teal-bright);
}
.demo-nav-cta {
  font-size: 13px; font-weight: 600; padding: 7px 16px;
  border-radius: 8px; border: none; cursor: pointer;
  background: var(--teal); color: white;
  transition: background 0.2s;
}
.demo-nav-cta:hover { background: var(--teal-bright); }

/* ---- HERO ---- */
.demo-hero {
  padding: 80px 40px 60px;
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  align-items: center;
}
.demo-hero-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--teal-bright); margin-bottom: 16px;
}
.demo-hero h1 {
  font-size: clamp(30px, 3.5vw, 48px); font-weight: 800;
  line-height: 1.1; margin-bottom: 16px; letter-spacing: -0.03em;
}
.demo-hero h1 span { color: var(--teal-bright); }
.demo-hero-sub {
  font-size: 16px; color: var(--text-secondary); line-height: 1.65;
  margin-bottom: 28px; max-width: 440px;
}
.demo-hero-stats {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.hero-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 18px; text-align: center;
}
.hero-stat .val { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; color: var(--teal-bright); }
.hero-stat .lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* ---- CHAT WIDGET ---- */
.chat-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
}
.chat-trigger {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(20,184,166,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-trigger:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(20,184,166,0.5); }
.chat-trigger svg { color: white; }

.chat-window {
  position: absolute; bottom: 72px; right: 0;
  width: 400px; max-height: 580px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  transform-origin: bottom right;
  animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.chat-window.hidden { display: none; }

.widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
}
.widget-header-left { display: flex; align-items: center; gap: 10px; }
.widget-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; font-weight: 700; font-family: 'Syne', sans-serif;
}
.widget-firm { font-size: 14px; font-weight: 600; color: var(--text-primary); font-family: 'Syne', sans-serif; }
.widget-status { font-size: 11px; color: var(--teal-bright); display: flex; align-items: center; gap: 4px; }
.widget-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-bright); box-shadow: 0 0 6px var(--teal-bright); animation: pulse 2s infinite; }
.widget-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
  transition: background 0.2s;
}
.widget-close:hover { background: var(--border); }

.widget-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 300px; max-height: 360px; }
.widget-messages::-webkit-scrollbar { width: 4px; }
.widget-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.bot-msg-wrap { display: flex; align-items: flex-start; gap: 8px; }
.bot-msg-wrap.user { flex-direction: row-reverse; }
.bot-mini-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  display: flex; align-items: center; justify-content: center; color: white;
  font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.w-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.55; color: var(--text-primary);
}
.w-bubble.bot { background: var(--bg-card-alt); border-bottom-left-radius: 4px; }
.w-bubble.user { background: var(--teal); color: white; border-bottom-right-radius: 4px; }
.w-bubble p { margin: 0; }
.w-bubble .suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestion-chip {
  font-size: 11px; padding: 5px 12px; border-radius: 20px;
  background: var(--teal-glow); border: 1px solid rgba(20,184,166,0.3);
  color: var(--teal-bright); cursor: pointer; transition: background 0.2s;
}
.suggestion-chip:hover { background: rgba(20,184,166,0.25); }

.typing-indicator { display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.typing-dots { display: flex; gap: 4px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%,100%{transform:translateY(0);opacity:0.5} 50%{transform:translateY(-5px);opacity:1} }
.typing-label { font-size: 11px; color: var(--text-muted); }

/* ---- FORMS ---- */
.lead-form { display: flex; flex-direction: column; gap: 8px; }
.form-row { display: flex; gap: 8px; }
.w-input {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}
.w-input:focus { outline: none; border-color: var(--teal); }
.w-input::placeholder { color: var(--text-muted); }
.w-select { appearance: none; cursor: pointer; }
.w-textarea { resize: none; min-height: 60px; }
.w-btn {
  padding: 9px 16px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.w-btn-primary { background: var(--teal); color: white; }
.w-btn-primary:hover { background: var(--teal-bright); }
.w-btn-primary:active { transform: scale(0.97); }

/* ---- SCHEDULE ---- */
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.schedule-day { display: flex; flex-direction: column; gap: 4px; }
.schedule-date {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px;
}
.slot-btn {
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  font-size: 11px; cursor: pointer; text-align: center; transition: all 0.2s;
}
.slot-btn:hover { border-color: var(--teal); color: var(--teal-bright); }
.slot-btn.selected { background: var(--teal-glow); border-color: rgba(20,184,166,0.5); color: var(--teal-bright); }

/* ---- APPOINTMENT CONFIRMED ---- */
.appt-confirmed {
  background: rgba(20,184,166,0.1); border: 1px solid rgba(20,184,166,0.3);
  border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.appt-confirmed-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(20,184,166,0.2); display: flex; align-items: center; justify-content: center; color: var(--teal-bright); flex-shrink: 0; }
.appt-confirmed-info .appt-title { font-size: 12px; font-weight: 600; color: var(--teal-bright); font-family: 'Syne', sans-serif; }
.appt-confirmed-info .appt-detail { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.appt-check-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--teal-bright); color: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- WIDGET INPUT ---- */
.widget-input-bar {
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--bg-card-alt); display: flex; align-items: center; gap: 8px;
}
.widget-input-bar input {
  flex: 1; padding: 8px 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; font-family: 'DM Sans', sans-serif;
}
.widget-input-bar input:focus { outline: none; border-color: var(--teal); }
.widget-input-bar input::placeholder { color: var(--text-muted); }
.widget-send {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: white;
  transition: background 0.2s;
}
.widget-send:hover { background: var(--teal-bright); }

/* ---- LEAD TAGS ---- */
.lead-tags-wrap { padding: 8px 16px; border-top: 1px solid var(--border); background: var(--bg-card); display: flex; align-items: center; justify-content: space-between; }
.lead-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.tags { display: flex; gap: 4px; }

/* ---- DASHBOARD SECTION ---- */
.demo-dashboard {
  padding: 60px 40px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}
.demo-dashboard-inner { max-width: 1200px; margin: 0 auto; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-bright); margin-bottom: 24px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.dashboard-header h2 { font-size: 28px; font-weight: 700; }
.dashboard-header p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.refresh-btn { font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.refresh-btn:hover { border-color: var(--teal); color: var(--teal-bright); }

.leads-table { width: 100%; border-collapse: collapse; }
.leads-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.leads-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.leads-table tr:hover td { background: var(--bg-card); }
.leads-table .name-cell { color: var(--text-primary); font-weight: 500; }
.leads-table .case-type { font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 600; }
.urgency-badge { font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.urgency-badge.hot { background: var(--green-tag); color: var(--green-tag-text); }
.urgency-badge.warm { background: var(--amber-tag); color: var(--amber-tag-text); }
.urgency-badge.medium { background: var(--surface); color: var(--text-secondary); }
.urgency-badge.cold { background: var(--bg-card-alt); color: var(--text-muted); }
.status-badge { font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.status-badge.confirmed { background: var(--green-tag); color: var(--green-tag-text); }
.status-badge.pending { background: var(--amber-tag); color: var(--amber-tag-text); }
.status-badge.none { color: var(--text-muted); }
.appt-cell { font-size: 12px; }

/* ---- DEMO LOGO ---- */
.m-demo-logo {
  font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .demo-hero { grid-template-columns: 1fr; gap: 32px; padding: 60px 20px 40px; }
  .demo-page .chat-window { width: calc(100vw - 32px); right: -10px; }
  .leads-table { display: block; overflow-x: auto; }
  .demo-nav { padding: 0 20px; }
}