/* ================================================================
   Shared design tokens and base styles for all Bonk pages
================================================================ */

/* ---- Design tokens (dark / light theme) ---- */
:root, [data-theme="dark"] {
  --bg:               #0f1117;
  --bg-surface:       #1a1b26;
  --bg-surface-hover: #1e1f2e;
  --border:           #3b3b4f;
  --text-primary:     #e1e1e6;
  --text-secondary:   #9ca3af;
  --text-muted:       #6b7280;
  --accent:           #7dd3fc;
  --accent-hover:     #5bbce6;
  --accent-subtle:    rgba(125,211,252,0.05);
  --accent-active-bg: rgba(125,211,252,0.12);
  --accent-hover-bg:  rgba(125,211,252,0.10);
  --spinner-track:    #3b3b4f;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:               #f8f9fb;
  --bg-surface:       #ffffff;
  --bg-surface-hover: #f0f4f8;
  --border:           #d1d5db;
  --text-primary:     #111318;
  --text-secondary:   #6b7280;
  --text-muted:       #9ca3af;
  --accent:           #0369a1;
  --accent-hover:     #0284c7;
  --accent-subtle:    rgba(3,105,161,0.05);
  --accent-active-bg: rgba(3,105,161,0.12);
  --accent-hover-bg:  rgba(3,105,161,0.08);
  --spinner-track:    #d1d5db;
  color-scheme: light;
}

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

/* ---- Body ---- */
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s, color 0.25s;
  overflow-x: hidden;
}

/* ---- Header ---- */
header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: background-color 0.25s, border-color 0.25s;
}
header .logo { height: 28px; margin-right: auto; }
header a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
header a:hover { text-decoration: underline; }

/* ---- Auth area ---- */
.auth-area { display: flex; align-items: center; gap: 0.5rem; }
.auth-area .user-email { font-size: 0.78rem; color: var(--text-secondary); }

.btn-auth {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.btn-auth:hover { border-color: var(--accent); background: var(--accent-hover-bg); text-decoration: none; }

/* ---- Theme toggle button ---- */
.btn-theme {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  white-space: nowrap;
}
.btn-theme:hover { border-color: var(--accent); color: var(--text-primary); }

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Burger / responsive nav ---- */
.burger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  margin-left: auto;
}
.burger-btn:hover { border-color: var(--accent); color: var(--text-primary); }

.nav-links { display: flex; align-items: center; gap: 1rem; }

@media (max-width: 600px) {
  .burger-btn { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0.5rem 1.5rem;
  }
  .nav-links a, .nav-links button { padding: 0.5rem 0; width: 100%; margin: 0.15rem 0; }
  header.nav-open .nav-links { display: flex; }
}
