/* FDT — styles.css */

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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --border-light: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container { max-width: 640px; margin: 0 auto; padding: 0 16px; width: 100%; }
.page { padding: 24px 0; flex: 1; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand svg { width: 24px; height: 24px; }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--primary); }

/* Cards / Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
}
.panel-body { padding: 20px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-hover); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--border-light); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover:not(:disabled) { opacity: 0.85; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }

/* Messages */
.message {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.message:last-child { border-bottom: none; }
.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.message-author { font-weight: 600; font-size: 0.875rem; }
.message-time { font-size: 0.75rem; color: var(--text-dim); }
.message-body { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.message-unread { border-left: 3px solid var(--primary); }

/* Message composer */
.composer {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.composer .form-input { flex: 1; }

/* Members list */
.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-name { font-weight: 500; }
.member-role { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; }

/* Token display */
.token-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--success);
  margin: 12px 0;
}

/* Invite code */
.invite-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary);
  text-align: center;
  padding: 16px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state p { margin-bottom: 16px; }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.8rem; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none; }

/* Section spacing */
.section + .section { margin-top: 24px; }

/* Responsive */
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .panel-body { padding: 16px; }
  .nav { padding: 10px 12px; }
}
