/* ══════════════════════════════════════════════════════════════════════════
   PureFlow Mind — Premium Design System
   Brand: Gold (#D9A11E) + Deep Navy (#080D18)
   Aesthetic: Bentley / Rolls-Royce — space, restraint, warmth
   ══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400;500&display=swap');

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

:root {
  /* ── Backgrounds ── */
  --bg-deep:     #060A12;
  --bg-primary:  #0A0F1A;
  --bg-panel:    #0E1525;
  --bg-surface:  #121B2B;
  --bg-elevated: #162236;
  --bg-topbar:   #080D16;
  --bg-glass:    rgba(14, 21, 37, 0.65);

  /* ── Brand Gold ── */
  --gold:        #D4A745;
  --gold-light:  #E8C36A;
  --gold-dark:   #B08A2E;
  --gold-dim:    rgba(212, 167, 69, 0.08);
  --gold-subtle: rgba(212, 167, 69, 0.04);
  --gold-glow:   rgba(212, 167, 69, 0.20);
  --gold-border: rgba(212, 167, 69, 0.12);

  /* ── Accents ── */
  --teal:        #2BA882;
  --teal-dim:    rgba(43, 168, 130, 0.10);
  --red:         #D94444;
  --red-dim:     rgba(217, 68, 68, 0.08);

  /* ── Text ── */
  --text-primary:   #F0EDE6;
  --text-secondary: #8A8A8A;
  --text-tertiary:  #4D5566;
  --text-muted:     #3A4050;

  /* ── Borders ── */
  --border:       rgba(212, 167, 69, 0.10);
  --border-hover: rgba(212, 167, 69, 0.20);
  --border-accent:rgba(212, 167, 69, 0.16);
  --border-glass: rgba(255, 255, 255, 0.04);

  /* ── Typography ── */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* ── Spacing ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 36px;
  --space-2xl: 48px;

  /* ── Radius ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 50%;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar — thin, premium ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ══════════════════════════════════════════════════════════════════════════
   M MONOGRAM — The Brand Mark
   ══════════════════════════════════════════════════════════════════════════ */

.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  background: linear-gradient(145deg, var(--gold-dark), var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

/* Sizes */
.monogram--xs  { width: 28px;  height: 28px;  font-size: 14px; border-radius: var(--radius-sm); }
.monogram--sm  { width: 36px;  height: 36px;  font-size: 16px; border-radius: var(--radius-md); }
.monogram--md  { width: 52px;  height: 52px;  font-size: 22px; border-radius: var(--radius-lg); }
.monogram--lg  { width: 80px;  height: 80px;  font-size: 34px; border-radius: var(--radius-xl); }
.monogram--xl  { width: 120px; height: 120px; font-size: 50px; border-radius: 50%; }
.monogram--2xl { width: 160px; height: 160px; font-size: 66px; border-radius: 50%; }

/* With ring — the luxury emblem treatment */
.monogram--ring {
  border: 2px solid rgba(212, 167, 69, 0.4);
  box-shadow:
    0 0 0 1px rgba(212, 167, 69, 0.08),
    0 0 20px rgba(212, 167, 69, 0.15),
    inset 0 0 12px rgba(212, 167, 69, 0.06);
  /* Reset the gradient-text from base .monogram — ring uses ::before for the M */
  background: var(--bg-panel);
  background-clip: border-box;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.monogram--ring::before {
  content: 'M';
  font-family: var(--font-display);
  font-weight: 600;
  background: linear-gradient(145deg, var(--gold-dark), var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* When using --ring, the M comes from ::before */
.monogram--ring { font-size: 0; }
.monogram--xs.monogram--ring::before  { font-size: 14px; }
.monogram--sm.monogram--ring::before  { font-size: 16px; }
.monogram--md.monogram--ring::before  { font-size: 22px; }
.monogram--lg.monogram--ring::before  { font-size: 34px; }
.monogram--xl.monogram--ring::before  { font-size: 50px; }
.monogram--2xl.monogram--ring::before { font-size: 66px; }

/* Room monogram variants — all gold family, same luxury ring treatment */

/* Forensics */
.monogram--forensics.monogram--ring::before { content: 'F'; }

/* Suits */
.monogram--suits.monogram--ring::before { content: 'S'; }

/* Shield */
.monogram--shield.monogram--ring::before { content: 'S'; }

/* Website */
.monogram--website.monogram--ring::before { content: 'W'; }

/* Glow variant — for hero/voice mode */
.monogram--glow {
  box-shadow:
    0 0 0 1px rgba(212, 167, 69, 0.06),
    0 0 60px rgba(212, 167, 69, 0.15),
    0 0 120px rgba(212, 167, 69, 0.06);
}

/* Pulse animation for active/thinking states */
.monogram--pulse {
  animation: monogramPulse 3s ease-in-out infinite;
}
@keyframes monogramPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(212,167,69,0.06), 0 0 40px rgba(212,167,69,0.08); }
  50%      { box-shadow: 0 0 0 1px rgba(212,167,69,0.12), 0 0 60px rgba(212,167,69,0.18); }
}


/* ══════════════════════════════════════════════════════════════════════════
   WORDMARK — PUREFLOW Mind
   ══════════════════════════════════════════════════════════════════════════ */

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.wordmark__pure {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wordmark__mind {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.wordmark--lg .wordmark__pure { font-size: 24px; }
.wordmark--lg .wordmark__mind { font-size: 24px; }
.wordmark--md .wordmark__pure { font-size: 18px; }
.wordmark--md .wordmark__mind { font-size: 18px; }
.wordmark--sm .wordmark__pure { font-size: 14px; }
.wordmark--sm .wordmark__mind { font-size: 14px; }

.wordmark__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--text-tertiary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
}


/* ══════════════════════════════════════════════════════════════════════════
   GLASS PANELS — Frosted, layered surfaces
   ══════════════════════════════════════════════════════════════════════════ */

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.glass--gold {
  border-color: var(--gold-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(212, 167, 69, 0.04);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.card--elevated {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border);
}

.card--premium {
  background: linear-gradient(170deg, var(--bg-panel) 0%, var(--bg-surface) 100%);
  border-color: var(--gold-border);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(212, 167, 69, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}


/* ══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════════════════════════════════ */

.heading-xl {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  line-height: 1.3;
}

.heading-lg {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.heading-md {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.body { font-size: 14px; line-height: 1.7; color: var(--text-primary); }
.body--sm { font-size: 13px; }
.body--xs { font-size: 11px; }
.text-muted { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.text-teal { color: var(--teal); }


/* ══════════════════════════════════════════════════════════════════════════
   FORM INPUTS — Refined, premium
   ══════════════════════════════════════════════════════════════════════════ */

.input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim), 0 0 20px rgba(212, 167, 69, 0.05);
}

.input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

.input--sm {
  padding: 10px 14px;
  font-size: 13px;
}

.input-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.select {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.select:focus { border-color: var(--gold-border); }


/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS — Premium, restrained
   ══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn--primary {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-deep);
  font-size: 14px;
  font-weight: 600;
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 167, 69, 0.25);
}

.btn--primary:active { transform: translateY(0); }

.btn--primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}

.btn--ghost:hover {
  border-color: var(--gold-border);
  color: var(--gold);
  background: var(--gold-dim);
}

.btn--sm {
  padding: 7px 14px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn--danger {
  border-color: rgba(217, 68, 68, 0.15);
  color: var(--red);
}
.btn--danger:hover {
  background: var(--red-dim);
  border-color: rgba(217, 68, 68, 0.3);
  color: var(--red);
}


/* ══════════════════════════════════════════════════════════════════════════
   BADGES & PILLS
   ══════════════════════════════════════════════════════════════════════════ */

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

.badge--gold {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.badge--teal {
  background: var(--teal-dim);
  color: var(--teal);
}

.badge--muted {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-tertiary);
}

.role-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.role-badge.admin { background: var(--gold-dim); color: var(--gold); }
.role-badge.user  { background: var(--teal-dim); color: var(--teal); }


/* ══════════════════════════════════════════════════════════════════════════
   TABLE — Clean, luxurious
   ══════════════════════════════════════════════════════════════════════════ */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(212, 167, 69, 0.04);
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

tr:hover td {
  background: var(--gold-subtle);
  color: var(--text-primary);
}


/* ══════════════════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════════════════ */

.alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 400;
  display: none;
}

.alert.show { display: block; }
.alert.success { background: var(--teal-dim); border: 1px solid rgba(43,168,130,0.15); color: var(--teal); }
.alert.error   { background: var(--red-dim);  border: 1px solid rgba(217,68,68,0.15);  color: var(--red); }


/* ══════════════════════════════════════════════════════════════════════════
   MODAL — Premium overlay
   ══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: linear-gradient(170deg, var(--bg-panel) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 167, 69, 0.04);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.modal__actions {
  display: flex;
  gap: 12px;
  margin-top: var(--space-lg);
}


/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR — Shared across chat and admin
   ══════════════════════════════════════════════════════════════════════════ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-topbar);
}

.topbar__left  { display: flex; align-items: center; gap: 16px; }
.topbar__right { display: flex; align-items: center; gap: 10px; }

.topbar__breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}


/* ══════════════════════════════════════════════════════════════════════════
   STATUS INDICATOR
   ══════════════════════════════════════════════════════════════════════════ */

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal-dim);
  animation: statusPulse 3s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}


/* ══════════════════════════════════════════════════════════════════════════
   ANIMATIONS — Smooth, premium
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.animate-fade-up { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-fade-in { animation: fadeIn 0.4s ease; }
.animate-slide-up { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1); }


/* ══════════════════════════════════════════════════════════════════════════
   SECURITY / FOOTER NOTES
   ══════════════════════════════════════════════════════════════════════════ */

.security-notes {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: rgba(43, 168, 130, 0.03);
  border: 1px solid rgba(43, 168, 130, 0.08);
  border-radius: var(--radius-lg);
}

.security-notes h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--teal);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.security-notes li {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 2;
  margin-left: 16px;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: center;
}
