/* =========================================
   T-TECH AI — AI Receptionist Demo Styles
   ========================================= */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #111113;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --amber-glow: rgba(245, 158, 11, 0.08);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.1);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --border: rgba(255,255,255,0.06);
  --border-amber: rgba(245,158,11,0.2);
}

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

html, body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === HEADER === */
.demo-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-mark {
  color: var(--amber);
  font-size: 1.1rem;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #ef4444;
  letter-spacing: 0.06em;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.header-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.header-cta {
  background: var(--amber);
  color: #000;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.header-cta:hover { opacity: 0.85; }

/* === MAIN LAYOUT === */
.demo-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 28px;
  align-items: start;
}

/* === PANEL LABELS === */
.panel-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-tag {
  font-family: 'Sora', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
  text-transform: uppercase;
}

.panel-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === PHONE FRAME === */
.phone-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.phone-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-amber);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-amber), 0 20px 60px rgba(245,158,11,0.06);
}

.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(245,158,11,0.04);
  border-bottom: 1px solid var(--border);
}

.caller-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.caller-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--amber-dim);
  border: 1px solid var(--border-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
}

.caller-name {
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.caller-number {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.call-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--green);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 2s infinite;
}

/* === WAVEFORM === */
.waveform-area {
  padding: 14px 20px;
  background: rgba(245,158,11,0.03);
  border-bottom: 1px solid var(--border);
}

.waveform-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  margin-bottom: 6px;
}

.waveform-bars span {
  display: block;
  width: 3px;
  height: 6px;
  background: var(--amber);
  border-radius: 2px;
  opacity: 0.3;
  transition: height 0.1s, opacity 0.1s;
}

.transcript-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* === CONVERSATION === */
.conversation {
  height: 280px;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation::-webkit-scrollbar { width: 4px; }
.conversation::-webkit-scrollbar-track { background: transparent; }
.conversation::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg-ai, .msg-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msg-in 0.25s ease-out;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-ai {
  align-items: flex-start;
}

.msg-user {
  align-items: flex-end;
}

.msg-text {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.msg-ai .msg-text {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.msg-user .msg-text {
  background: var(--amber);
  color: #000;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Typing indicator */
.typing .msg-text {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
}

.dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dots span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dot-bounce 1.2s infinite;
}

.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(1); opacity: 0.4; }
  40% { transform: scale(1.3); opacity: 1; }
}

/* === OPTIONS === */
.options {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.opt-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--border-amber);
  background: rgba(245,158,11,0.04);
}

.opt-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === INPUT AREA === */
.input-area {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.input-area input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
}

.input-area input:focus { border-color: var(--border-amber); }
.input-area input::placeholder { color: var(--text-muted); }

.send-btn {
  background: var(--amber);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  transition: opacity 0.2s;
}

.send-btn:hover { opacity: 0.8; }

/* === CAPTURED CARD === */
.captured-card {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}

.captured-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.captured-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cap-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cap-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cap-value {
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* === DASHBOARD === */
.dash-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Stats row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-num {
  font-family: 'Sora', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-num.amber { color: var(--amber); }
.stat-num.green { color: var(--green); }

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Log table */
.log-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.log-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.log-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.log-table tbody tr:last-child { border-bottom: none; }
.log-table tbody tr:hover { background: rgba(255,255,255,0.01); }

.log-table td {
  padding: 12px 16px;
  vertical-align: top;
}

.log-time {
  color: var(--text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
  width: 50px;
}

.log-speaker {
  font-weight: 600;
  white-space: nowrap;
  width: 80px;
}

.log-ai .log-speaker { color: var(--amber); }
.log-user .log-speaker { color: var(--text-primary); }

.log-msg {
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 500px;
}

/* Lead form */
.lead-form {
  background: var(--bg-card);
  border: 1px solid var(--border-amber);
  border-radius: 14px;
  padding: 20px;
  display: none;
}

.lead-form-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 16px;
}

.lead-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.lead-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lead-field label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lead-field span {
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.lead-action {
  display: flex;
  gap: 10px;
}

.cal-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--amber);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: opacity 0.2s;
}

.cal-btn:hover { opacity: 0.85; }

.reset-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: border-color 0.2s;
}

.reset-btn:hover { border-color: var(--border-amber); }

/* Recent leads */
.recent-leads {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.recent-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-title span { color: var(--text-muted); font-weight: 400; }

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-leads {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

.lead-item {
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-item-name {
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.lead-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
}

.lead-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-amber);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  font-family: 'Sora', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cal-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.cal-logo {
  font-size: 1.4rem;
  color: var(--amber);
}

.cal-preview strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.cal-preview span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.booking-demo-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.modal-cancel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.modal-open {
  background: var(--amber);
  color: #000;
  text-decoration: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: opacity 0.2s;
}

.modal-open:hover { opacity: 0.85; }

/* === CONFETTI === */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

/* === RESPONSIVE === */
@media (max-width: 1100px) {
  .demo-main {
    grid-template-columns: 1fr;
  }
  .phone-panel { order: 1; }
  .dash-panel { order: 2; }
}

@media (max-width: 600px) {
  .demo-main { padding: 20px 16px; gap: 20px; }
  .header-cta { display: none; }
  .header-label { display: none; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .captured-fields { grid-template-columns: 1fr; }
  .lead-fields { grid-template-columns: 1fr; }
}