/* ========== DARK THEME (default) ========== */
[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-card: #141925;
  --bg-card-hover: #1a2035;
  --bg-surface: #111628;
  --bg-header: rgba(11, 15, 26, 0.85);
  --border: #1e2640;
  --text: #e8ecf4;
  --text-muted: #8892a8;
  --text-dim: #5a6480;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-hover: #2563eb;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --orange: #f59e0b;
  --orange-soft: rgba(245, 158, 11, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ========== LIGHT THEME ========== */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f3f9;
  --bg-surface: #edf0f7;
  --bg-header: rgba(244, 246, 251, 0.88);
  --border: #dfe3ed;
  --text: #1a1f2e;
  --text-muted: #5c6578;
  --text-dim: #8b93a5;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-hover: #1d4ed8;
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.1);
  --orange: #d97706;
  --orange-soft: rgba(217, 119, 6, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

:root {
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

main { flex: 1; }

a { color: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.header__logo-img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
}

.header__search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header__search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.header__search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.header__search input::placeholder { color: var(--text-dim); }
.header__search input:focus { border-color: var(--accent); }

.header__nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.header__toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.header__toggle i { font-size: 1rem; }

.header__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.3rem;
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

.header__link:hover { color: var(--text); }

.header__link--back {
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ========== FOOTER ========== */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  transition: border-color var(--transition);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer__credit a {
  color: var(--accent);
  text-decoration: none;
}

.footer__credit a:hover { text-decoration: underline; }

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

@keyframes statsFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
