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

/* ─── THEME TOKENS ──────────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --bg-sub:       #f8f9fa;
  --bg-card:      #ffffff;
  --bg-card-hover:#f3f4f6;
  --bg-stats:     #f9fafb;
  --border:       #e5e7eb;
  --border-strong:#d1d5db;
  --text:         #111827;
  --text-sub:     #6b7280;
  --text-muted:   #9ca3af;
  --accent:       #16a34a;
  --accent-hover: #15803d;
  --accent-bg:    #f0fdf4;
  --accent-border:#bbf7d0;
  --nav-bg:       rgba(255,255,255,0.92);
  --shadow:       0 1px 3px rgba(0,0,0,0.07);
  --shadow-card:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --radius:       10px;
  --radius-lg:    14px;
  --badge-new-bg:    #eff6ff;
  --badge-new-text:  #1d4ed8;
  --badge-pop-bg:    #f0fdf4;
  --badge-pop-text:  #15803d;
}

[data-theme="dark"] {
  --bg:           #080808;
  --bg-sub:       #0d0d0d;
  --bg-card:      #0f0f0f;
  --bg-card-hover:#161616;
  --bg-stats:     #0d0d0d;
  --border:       #1f1f1f;
  --border-strong:#2a2a2a;
  --text:         #f0f0f0;
  --text-sub:     #6b7280;
  --text-muted:   #4a4a4a;
  --accent:       #22c55e;
  --accent-hover: #16a34a;
  --accent-bg:    #0d1f12;
  --accent-border:#1a3a1e;
  --nav-bg:       rgba(8,8,8,0.92);
  --shadow:       none;
  --shadow-card:  none;
  --shadow-md:    none;
  --badge-new-bg:    #0c1f2a;
  --badge-new-text:  #38bdf8;
  --badge-pop-bg:    #0d1f12;
  --badge-pop-text:  #22c55e;
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  transition: background 0.25s, color 0.25s;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-sub); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 24px; }

/* ─── NAV ────────────────────────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
}
.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.nav-logo-text { font-weight: 700; font-size: 15px; letter-spacing: -0.4px; }
.nav-logo-text span.accent { color: var(--accent); }
.nav-logo-text span.tld { color: var(--text-muted); font-size: 11px; font-weight: 400; }
.nav-links { display: flex; gap: 20px; font-size: 13px; }
.nav-links a { color: var(--text-sub); transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
  text-decoration: none;
}
.nav-user-btn:hover { background: var(--accent-hover); color: #fff; }
.nav-user-avatar {
  width: 28px; height: 28px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--accent);
  cursor: pointer;
}

/* ─── THEME TOGGLE ───────────────────────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-sub);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.toggle-track {
  width: 28px; height: 16px;
  background: var(--border-strong);
  border-radius: 8px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}
[data-theme="dark"] .toggle-track { background: var(--accent); }
.toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
[data-theme="dark"] .toggle-knob { left: 14px; background: #000; }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ─── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card:hover { background: var(--bg-card-hover); }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ─── FORMS ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-sub); }
.form-input {
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  transition: border 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.form-input::placeholder { color: var(--text-muted); }
.form-error { font-size: 12px; color: #ef4444; margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── BADGES ─────────────────────────────────────────────────── */
.badge {
  font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase;
  font-weight: 700; padding: 2px 7px; border-radius: 4px;
}
.badge-new { background: var(--badge-new-bg); color: var(--badge-new-text); }
.badge-popular { background: var(--badge-pop-bg); color: var(--badge-pop-text); }

/* ─── SECTION HEADINGS ───────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; }
.section-title { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.section-sub { font-size: 13px; color: var(--text-muted); }

/* ─── ALERTS ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: var(--accent-bg); border: 1px solid var(--accent-border); color: var(--accent); }
[data-theme="dark"] .alert-error { background: #1f0a0a; border-color: #7f1d1d; color: #f87171; }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 24px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 14px;
}
.footer-left { display: flex; align-items: center; gap: 8px; }
.footer-mark {
  width: 20px; height: 20px; background: var(--accent); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
}
.footer-copy { font-size: 12px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; font-size: 12px; }
.footer-links a { color: var(--text-muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

/* ─── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp 0.45s ease both; }
.fade-up-2 { animation: fadeUp 0.45s 0.1s ease both; }
.fade-up-3 { animation: fadeUp 0.45s 0.2s ease both; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
.blink { animation: blink 2.2s infinite; }

/* ─── UTILITIES ──────────────────────────────────────────────── */
.mono { font-family: 'DM Mono', monospace; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-sub    { color: var(--text-sub); }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.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; }
.mb-24  { margin-bottom: 24px; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hide-mobile { display: none; }
  .container { padding: 0 16px; }
}
