:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #484f58;
  --accent: #00d084;
  --accent-dim: #0d5c37;
  --blue: #388bfd;
  --blue-dim: #1f3a6e;
  --orange: #f78166;
  --purple: #bc8cff;
  --yellow: #d29922;
  --red: #f85149;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── Navbar ── */
nav {
  background: rgba(13,17,23,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo-icon { color: var(--accent); font-size: 22px; }
.logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: color .15s, background .15s;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg3);
  text-decoration: none;
}
.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,208,132,.4); }
  50% { opacity: .7; box-shadow: 0 0 0 6px rgba(0,208,132,0); }
}

/* ── Hero ── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 500px;
  background: radial-gradient(ellipse at center, rgba(0,208,132,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--accent); }
.hero p.subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Stat cards hero ── */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-card .num {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
}
.num.green  { color: var(--accent); }
.num.blue   { color: var(--blue); }
.num.purple { color: var(--purple); }
.num.orange { color: var(--orange); }
.num.yellow { color: var(--yellow); }

/* ── Section ── */
section { padding: 60px 0; }
section + section { border-top: 1px solid var(--border); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
}
.section-title small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ── Filter bar ── */
.filter-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.filter-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  font-weight: 600;
}
select, input[type=number], input[type=text] {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
select:focus, input:focus { border-color: var(--accent); }
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Proxy table ── */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.proxy-table {
  width: 100%;
  border-collapse: collapse;
}
.proxy-table th {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.proxy-table th:hover { color: var(--text); }
.proxy-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.proxy-table tr:last-child td { border-bottom: none; }
.proxy-table tr:hover td { background: rgba(255,255,255,.02); }
.proxy-table td.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.badge-socks5   { background: rgba(188,140,255,.15); color: var(--purple); }
.badge-socks4   { background: rgba(56,139,253,.15);  color: var(--blue); }
.badge-http     { background: rgba(247,129,102,.15); color: var(--orange); }
.badge-https    { background: rgba(0,208,132,.15);   color: var(--accent); }
.badge-elite    { background: rgba(0,208,132,.15);   color: var(--accent); }
.badge-anonymous { background: rgba(56,139,253,.15); color: var(--blue); }
.badge-transparent { background: rgba(210,153,34,.15); color: var(--yellow); }
.badge-alive    { background: rgba(0,208,132,.12);   color: var(--accent); }
.badge-dead     { background: rgba(248,81,73,.12);   color: var(--red); }
.badge-untested { background: rgba(139,148,158,.12); color: var(--text-muted); }

/* ── Score bar ── */
.score-wrap { display: flex; align-items: center; gap: 8px; }
.score-bar {
  flex: 1;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  min-width: 48px;
}
.score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}
.score-num { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 28px; }

/* ── Latency ── */
.latency-good  { color: var(--accent); }
.latency-ok    { color: var(--yellow); }
.latency-slow  { color: var(--red); }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.page-btns { display: flex; gap: 4px; }

/* ── Copy button ── */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 11px;
  transition: color .15s;
}
.copy-btn:hover { color: var(--accent); }
.copy-btn.copied { color: var(--accent); }

/* ── Auto-refresh ── */
.refresh-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.refresh-progress {
  width: 80px;
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.refresh-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear;
}

/* ── How We Rate ── */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.rating-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.rating-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.rating-weight {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rating-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.rating-bar-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  margin-bottom: 12px;
}
.rating-bar-fill {
  height: 100%;
  border-radius: 2px;
}
.rating-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.rating-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

/* ── Anonymity tiers ── */
.anon-tiers { margin-top: 8px; }
.anon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.anon-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.anon-elite    { border-top: 3px solid var(--accent); }
.anon-anonymous{ border-top: 3px solid var(--blue); }
.anon-transparent { border-top: 3px solid var(--yellow); }
.anon-badge { margin-bottom: 10px; }
.anon-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.anon-card p  { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.anon-card code { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.anon-verdict {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}

/* ── Features section ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: block;
}
.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ── Protocol info ── */
.proto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.proto-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.proto-card .proto-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.proto-card p { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.proto-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proto-card ul li::before { content: '✓ '; color: var(--accent); }
.proto-card ul li { font-size: 12px; color: var(--text-muted); }

/* ── API section ── */
.api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) { .api-grid { grid-template-columns: 1fr; } }
.api-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.api-card-header {
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.method {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
}
.method-get  { background: rgba(0,208,132,.2);  color: var(--accent); }
.method-post { background: rgba(56,139,253,.2); color: var(--blue); }
.api-card code {
  display: block;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
footer p { margin-bottom: 4px; }

/* ── Loading / empty states ── */
.loading-row td { text-align: center; color: var(--text-muted); padding: 40px; }
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status dot ── */
@keyframes statusglow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,208,132,.55); }
  60%       { box-shadow: 0 0 0 5px rgba(0,208,132,0); }
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}
.status-dot-alive {
  background: var(--accent);
  animation: statusglow 1.6s ease-in-out infinite;
}
.status-dot-dead {
  background: var(--red);
  opacity: .7;
}
.status-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 11px;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 999;
  max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: var(--accent); color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .nav-links { display: none; }
  .proxy-table th:nth-child(n+5),
  .proxy-table td:nth-child(n+5) { display: none; }
}
@media (max-width: 480px) {
  .proxy-table th:nth-child(n+4),
  .proxy-table td:nth-child(n+4) { display: none; }
}
