/* public/css/brainfire.css */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

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

:root {
  --bg: #0f0e17;
  --surface: #1a1928;
  --surface2: #22213a;
  --border: rgba(255,255,255,0.07);
  --text: #fffffe;
  --muted: #8a8aaa;
  --claudette: #ff8c69;
  --claudette-bg: rgba(255,140,105,0.08);
  --googz: #5b7af9;
  --googz-bg: rgba(91,122,249,0.08);
  --sammy: #19c37d;
  --sammy-bg: rgba(25,195,125,0.08);
  --board: #13121f;
  --accent: #ffe66d;
  --danger: #ff6b6b;
  --success: #51cf66;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* NAV */
.nav {
  display: flex;
  align-items: center;
  padding: 18px 40px;
  border-bottom: 1px solid var(--border);
  gap: 32px;
  position: sticky;
  top: 0;
  background: rgba(15,14,23,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.nav-logo-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn {
  border: none;
  border-radius: 8px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-primary { background: var(--accent); color: #0f0e17; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }

/* USER AVATAR in nav */
.user-avatar-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 12px 5px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 0.82rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}
.user-avatar-btn:hover { border-color: rgba(255,255,255,0.2); }
.user-avatar-img {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0f0e17;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar-img img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none;
  z-index: 200;
}
.user-dropdown.open { display: block; animation: fadeUp 0.15s ease; }
.dropdown-item {
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dropdown-item:hover { background: var(--surface2); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-usage {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--muted);
}
.usage-bar-wrap {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  margin-top: 4px;
}
.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.15s;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 440px;
  max-width: 95vw;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--surface2);
  border: none;
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.modal p { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-label { font-size: 0.78rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.06em; }
.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: rgba(255,230,109,0.4); }
.form-input::placeholder { color: rgba(138,138,170,0.5); }

.form-error {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #ff8a80;
  margin-bottom: 14px;
  display: none;
}
.form-error.show { display: block; }

.google-btn {
  width: 100%;
  background: white;
  color: #333;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.15s;
  margin-bottom: 16px;
}
.google-btn:hover { opacity: 0.9; }

.divider-text {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 16px;
  position: relative;
}
.divider-text::before, .divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

.auth-switch { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 16px; }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: none; }

/* SETTINGS PANEL */
.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  width: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
}
.settings-panel.open { display: block; animation: fadeUp 0.15s ease; }
.settings-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.settings-row {
  margin-bottom: 12px;
}
.settings-row label { font-size: 0.78rem; color: var(--muted); display: block; margin-bottom: 5px; }
.settings-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  outline: none;
}
.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle-switch {
  width: 36px; height: 20px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch.on::after { transform: translateX(16px); background: #0f0e17; }

/* PROMPT USAGE BAR */
.usage-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--muted);
}
.usage-indicator .bar {
  width: 80px; height: 4px;
  background: var(--surface2);
  border-radius: 2px;
}
.usage-indicator .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}
.usage-indicator.warning .bar-fill { background: var(--danger); }

/* PAGE CONTENT */
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 40px;
}
.page-hero {
  margin-bottom: 48px;
}
.page-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.page-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 600px;
}
.section { margin-bottom: 48px; }
.section h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.section p { color: var(--muted); line-height: 1.75; margin-bottom: 12px; font-size: 0.95rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.info-card .icon { font-size: 24px; margin-bottom: 10px; }
.info-card h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.info-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ─── NAV HAMBURGER (hidden on desktop) ─── */
.nav-hamburger { display: none; align-items: center; justify-content: center; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; padding: 6px; line-height: 1; margin-left: auto; flex-shrink: 0; }

/* ─── MOBILE NAV DRAWER ─── */
.mobile-nav { display: none; position: fixed; top: 57px; left: 0; right: 0; background: rgba(15,14,23,0.97); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 99; padding: 4px 20px 20px; flex-direction: column; }
.mobile-nav.open { display: flex; }
.mobile-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 14px 0; border-bottom: 1px solid var(--border); display: block; }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a.active { color: var(--text); }

/* ─── MOBILE (≤768px) ─── */
@media (max-width: 768px) {
  .nav { padding: 12px 16px; gap: 12px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .page-container { padding: 0 16px 48px; }
}
