/* ==============================================
   Recall.ai Meeting Skill — Demo Styles
   2nth.ai Design System — Light Mode
   Matches dev.20crm-2nth-ai.pages.dev
   ============================================== */

:root {
  --brand: #06b6d4;
  --brand-dark: #0891b2;
  --brand-light: #ecfeff;
  --brand-glow: rgba(6, 182, 212, 0.06);
  --brand-border: rgba(6, 182, 212, 0.15);

  --bg: #fafafa;
  --white: #ffffff;
  --surface: #ffffff;
  --surface2: #f5f5f4;
  --surface3: #e7e5e4;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.12);
  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.06);
  --yellow: #d97706;
  --yellow-dim: rgba(217, 119, 6, 0.06);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.06);
  --blue: #06b6d4;
  --blue-dim: rgba(6, 182, 212, 0.06);
  --purple: #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.06);
  --radius: 8px;
  --radius-sm: 6px;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-sans: 'Barlow', system-ui, -apple-system, sans-serif;
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-secondary);
  min-height: 100vh;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

code, .mono { font-family: var(--font-mono); }

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

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

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

.logo-icon { color: var(--brand); }

.logo h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text);
  text-transform: uppercase;
}

.logo h1 .brand-accent { color: var(--brand); }

.header-dim {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.header-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.mode-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 3px;
  font-weight: 600;
}

.mode-badge.demo {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(217, 119, 6, 0.15);
}

.mode-badge.live {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(5, 150, 105, 0.15);
}

/* ---- Banner ---- */
.banner {
  background: var(--brand-glow);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.banner strong { color: var(--text); font-weight: 600; }

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full-width { grid-column: 1 / -1; }

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

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-hover); }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.card-title svg { color: var(--brand); opacity: 0.7; }

/* ---- Form ---- */
.form-group { margin-bottom: 12px; }

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

input[type="text"]::placeholder { color: var(--text-muted); opacity: 0.5; }

.input-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--text);
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { padding: 4px 10px; font-size: 10px; border-radius: 3px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  padding: 4px 10px;
}

.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.btn-danger:hover { background: rgba(220, 38, 38, 0.1); }

/* ---- Quick URLs ---- */
.quick-urls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.quick-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.chip {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-glow); }

/* ---- Bot List ---- */
.bot-list { display: flex; flex-direction: column; gap: 8px; }

.bot-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.bot-item:hover { border-color: var(--border-hover); }
.bot-item.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.bot-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.bot-item-name { font-size: 13px; font-weight: 600; color: var(--text); }

.bot-item-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-item-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Status ---- */
.status-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-joining { background: var(--blue-dim); color: var(--brand-dark); }
.status-waiting { background: var(--yellow-dim); color: var(--yellow); }
.status-recording { background: var(--red-dim); color: var(--red); animation: pulse 2s ease-in-out infinite; }
.status-permission { background: var(--green-dim); color: var(--green); }
.status-processing { background: var(--brand-glow); color: var(--brand-dark); }
.status-done { background: var(--green-dim); color: var(--green); }
.status-error { background: var(--red-dim); color: var(--red); }
.status-other { background: var(--surface2); color: var(--text-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state svg { color: var(--text-muted); }
.empty-state p { margin-top: 10px; line-height: 1.6; }

/* ---- Detail Panel ---- */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-header-left { display: flex; align-items: center; gap: 10px; }
.detail-header-left strong { color: var(--text); }

.detail-section { margin-bottom: 16px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-section h3 {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface3);
  transition: background 0.3s;
}

.timeline-item:last-child::before { background: var(--brand); box-shadow: 0 0 6px rgba(6, 182, 212, 0.3); }

.timeline-item .status-code { color: var(--text); }
.timeline-item .ts { color: var(--text-muted); font-size: 10px; }

/* ---- Transcript ---- */
.transcript-lines { display: flex; flex-direction: column; gap: 4px; }

.transcript-line {
  display: grid;
  grid-template-columns: 48px 130px 1fr;
  gap: 12px;
  font-size: 13px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.transcript-line:hover { border-color: var(--border); }

.transcript-ts {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.transcript-speaker {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.transcript-text { color: var(--text-secondary); line-height: 1.6; }

/* ---- IDs ---- */
.id-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px;
}

.id-item {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
}

.id-label { color: var(--text-muted); white-space: nowrap; font-weight: 500; }
.id-value { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }

/* ---- Event Log ---- */
.event-log {
  max-height: 240px;
  overflow-y: auto;
}

.event-log-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  animation: fadeIn 0.3s var(--ease);
}

.event-log-item:last-child { border-bottom: none; }

.event-log-ts {
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-log-type {
  color: var(--brand-dark);
  font-weight: 600;
  min-width: 160px;
}

.event-log-detail {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Footer ---- */
.footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer a { color: var(--brand-dark); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }
.footer-dim { color: var(--text-muted); font-size: 11px; margin-top: 4px; opacity: 0.6; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .app { padding: 16px; }
  .header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .header-right { align-self: flex-end; }
  .transcript-line { grid-template-columns: 1fr; gap: 4px; }
  .transcript-ts { display: none; }
}
