/* BadgeStatus — base: tokens, reset, navigation, layout, shared UI */

:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: rgba(17, 17, 19, 0.86);
  --panel-2: #18181b;
  --line: rgba(39, 39, 42, 0.8);   /* zinc-800/80 */
  --line-2: #3f3f46;               /* zinc-700 */
  --text: #f4f4f5;                 /* zinc-100 */
  --text-2: #a1a1aa;               /* zinc-400 */
  --text-3: #71717a;               /* zinc-500 */
  --green: #34d399;
  --green-bg: rgba(2, 44, 34, 0.5);
  --green-line: rgba(6, 78, 59, 0.5);
  --red: #f87171;
  --red-bg: rgba(69, 10, 10, 0.5);
  --red-line: rgba(127, 29, 29, 0.5);
  --amber: #fbbf24;
  --amber-bg: rgba(69, 26, 3, 0.5);
  --amber-line: rgba(120, 53, 15, 0.5);
  --sky: #38bdf8;
  --sky-bg: rgba(8, 47, 73, 0.5);
  --sky-line: rgba(12, 74, 110, 0.5);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  scrollbar-width: thin;
  scrollbar-color: #27272a transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #3f3f46; color: #fff; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
b { font-weight: 600; color: var(--text); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.muted { color: var(--text-3); }
.small { font-size: 11px; }
.red { color: var(--red); }
.green { color: var(--green); }

.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { border-radius: 4px; }
.nav-sep { color: #27272a; user-select: none; }
.nav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-left { min-width: 0; }
.nav-link { padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: rgba(39, 39, 42, 0.6); }
.nav-link.is-active { color: var(--text); background: #27272a; }
@media (max-width: 720px) {
  .nav-sep { display: none; }
  .nav-left { gap: 10px; }
  .nav-link { padding: 4px 7px; font-size: 12px; }
}
@media (max-width: 440px) { .brand span { display: none; } }

.search { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 320px; }
.search-field {
  flex: 1; min-width: 0; display: flex; align-items: center;
  background: rgba(24, 24, 27, 0.9); border: 1px solid #27272a; border-radius: 6px;
  padding: 5px 10px; transition: border-color .15s;
}
.search-field:focus-within { border-color: #52525b; }
.search-prefix { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); user-select: none; }
.search-field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 12px; color: var(--text); }
.search-field input::placeholder { color: var(--text-3); }
.search-clear { background: none; border: 0; color: var(--text-3); font-size: 15px; line-height: 1; padding: 0 0 0 6px; }
.search-clear:hover { color: var(--text); }

.btn-white, .btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 500; border-radius: 6px; padding: 6px 14px;
  border: 1px solid transparent; transition: background .15s, opacity .15s; white-space: nowrap;
}
.btn-white { background: #f4f4f5; color: #09090b; min-width: 68px; }
.btn-white:hover { background: #fff; }
.btn-white:disabled { opacity: .5; }
.btn-dark { background: #18181b; color: var(--text); border-color: #27272a; }
.btn-dark:hover { background: #27272a; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(113, 113, 122, .35); border-top-color: currentColor;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.main { flex: 1; display: flex; flex-direction: column; gap: 24px; padding-top: 20px; padding-bottom: 48px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }

.error-box {
  background: rgba(69, 10, 10, .3); border: 1px solid var(--red-line); color: var(--red);
  font-size: 12px; font-weight: 500; padding: 10px 14px; border-radius: 6px; text-align: center;
}

/* ---------- Sections ---------- */
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
}
@keyframes pulse { 50% { opacity: .45; } }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:not(:disabled):hover { color: var(--text); border-color: var(--line-2); }
.chip:disabled { opacity: .4; }
.chip.is-active { color: #09090b; background: #f4f4f5; border-color: #f4f4f5; }

/* ---------- Pills ---------- */
.pills { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-block; font-size: 10px; font-weight: 500; line-height: 1.5;
  padding: 1px 7px; border-radius: 4px; border: 1px solid; white-space: nowrap;
}
.pill-upper { text-transform: uppercase; letter-spacing: .06em; }
.pill-free, .pill-owned { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.pill-paid, .pill-urgent { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.pill-missing { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.pill-soon { color: var(--sky); background: var(--sky-bg); border-color: var(--sky-line); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner { height: 48px; display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: #f4f4f5; color: #09090b; font-size: 12px; font-weight: 500; padding: 8px 14px; border-radius: 6px;
}

/* ---------- Small labels ---------- */
.block-label { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Animated background (assets/js/lib/background.js) ---------- */
.bg-waves { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-waves canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* Darken towards the bottom so content stays readable */
.bg-waves::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.15) 50%, rgba(9, 9, 11, 0.45) 100%);
}

/* ---------- Text links ---------- */
.box-link { font-size: 11.5px; color: var(--text-3); font-weight: 500; transition: color .15s; }
.box-link:hover { color: var(--text); }

/* ---------- Mono meta line (e.g. "21 available | 10 upcoming") ---------- */
.meta-line { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.meta-line > span { padding-right: 12px; margin-right: 12px; border-right: 1px solid #27272a; line-height: 1; }
.meta-line > span:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.meta-line b { color: var(--text); font-weight: 600; }
.meta-line .timer { font-size: 11px; }

/* ---------- Page header (title + meta on the left, action on the right) ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 0 4px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.meta-line b.green { color: var(--green); }
.meta-line b.red { color: var(--red); }
.meta-line b.amber { color: var(--amber); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 32px 0; color: var(--text-3); font-size: 12px; border: 1px dashed var(--line); border-radius: 8px; }
