/* ── Design tokens (aligned with ui/dashboard.html) ─────── */
:root {
  --bg-1:  #2D1B4D;
  --bg-2:  #3D2B5F;
  --bg-3:  #1e1233;
  --surface-1:    rgba(61,43,95,0.5);
  --surface-2:    rgba(61,43,95,0.8);
  --surface-hover:rgba(71,53,105,0.7);
  --border:        #3D2B5F;
  --border-accent: rgba(255,127,80,0.4);
  --accent:        #FF7F50;
  --accent-2:      #FF8C32;
  --accent-glow:   rgba(255,140,50,0.15);
  --purple:        #C8C0D8;
  --blue:          #7cb3ff;
  --green:         #2ECC71;
  --yellow:        #FFC107;
  --red:           #FF3131;
  --text-1: #F8F9FA;
  --text-2: #C8C0D8;
  --text-3: #8a7fa0;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --purple-glow: rgba(168,85,247,0.1);
  --blue-glow:   rgba(59,130,246,0.1);
  --green-glow:  rgba(34,197,94,0.1);
  --sans:    "Inter", -apple-system, sans-serif;
  --heading: "Space Grotesk", sans-serif;
  --mono:    "JetBrains Mono", monospace;
}

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

[hidden] { display: none !important; }

html, body { min-height: 100%; }

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,127,80,0.3) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,127,80,0.3); border-radius: 3px; }

body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg-1);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(61,43,95,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(255,127,80,0.08) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

button, select, input { font: inherit; }

/* ── Announce bar ──────────────────────────────────────── */
.announce-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  background: linear-gradient(90deg, rgba(45,27,77,0.92) 0%, rgba(35,20,60,0.95) 50%, rgba(45,27,77,0.92) 100%);
  border-bottom: 1px solid var(--border-accent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-2);
  text-align: center;
  flex-wrap: wrap;
}

.announce-icon {
  font-size: 6px;
  color: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
  line-height: 1;
}

.announce-bar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.announce-bar a:hover { text-decoration: underline; }

.announce-cta {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-accent) !important;
  background: var(--accent-glow);
  font-size: 0.65rem !important;
  white-space: nowrap;
}

/* ── Shell ─────────────────────────────────────────────── */
.shell {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 33px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(45,27,77,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 26px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.15s;
  display: block;
}

.brand-logo-link:hover .brand-logo-img {
  opacity: 1;
}

.brand-sub {
  color: var(--text-3);
  font-size: 0.62rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.65rem;
  font-family: var(--mono);
  white-space: nowrap;
}

.pill-accent {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-glow);
}

.pill-link {
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.pill-link:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

/* Donate button */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.25); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.15); }
  56%       { transform: scale(1); }
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7f50 0%, #ff4f2b 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(255,127,80,0.4);
  box-shadow: 0 0 16px rgba(255,127,80,0.25);
  transition: box-shadow 0.2s, transform 0.2s;
}

.donate-btn:hover {
  box-shadow: 0 0 28px rgba(255,127,80,0.45);
  transform: translateY(-1px);
}

.donate-heart {
  display: inline-block;
  animation: heartbeat 1.4s ease-in-out infinite;
  font-size: 0.85rem;
  line-height: 1;
}

/* Status dot (pulsing green) */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.5); }
  50%       { box-shadow: 0 0 0 4px rgba(46,204,113,0); }
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Stats bar ──────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.stats-bar::-webkit-scrollbar { display: none; }

.stat-card {
  position: relative;
  flex: 1 1 0;
  min-width: 130px;
  background: var(--bg-1);
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.15s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent));
}

.stat-card:hover { background: var(--surface-hover); }

.stat-label {
  font-size: 0.57rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-family: var(--heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-1);
}

.stat-meta {
  font-size: 0.6rem;
  color: var(--text-3);
  margin-top: 1px;
}

/* ── Page layout ─────────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Panels ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.query-shell,
.results-shell {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  animation: fadeUp 0.35s ease-out;
}

/* ── Panel header ────────────────────────────────────────── */
.query-header,
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  font-family: var(--heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-sub {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.72rem;
}

.query-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  color: var(--text-2);
  font-size: 0.65rem;
  font-family: var(--mono);
  white-space: nowrap;
}

.result-lock {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-accent);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.65rem;
  font-family: var(--mono);
  white-space: nowrap;
}

/* ── Form fields ─────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field + .field { margin-top: 10px; }

.field-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

select {
  width: 100%;
  padding: 6px 32px 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: rgba(0,0,0,0.25);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23FF7F50' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 1.2em 1.2em;
  color: var(--text-1);
  font-size: 0.78rem;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.15s;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,127,80,0.18);
}

select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

option {
  background-color: var(--bg-2);
  color: var(--text-1);
}

/* ── reCAPTCHA v2 widget ─────────────────────────────────── */
.recaptcha-wrap {
  margin: 12px 0 4px;
  min-height: 78px; /* reserves space while the iframe loads */
}
.recaptcha-wrap:empty { min-height: 0; margin: 0; } /* dev mode: no space wasted */

/* ── Buttons ─────────────────────────────────────────────── */
.flow-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--sans);
  transition: all 0.2s ease;
  line-height: 1;
}

.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-2);
  box-shadow: 0 0 30px rgba(255,127,80,0.3);
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--surface-1);
  color: var(--text-2);
  border-color: var(--border);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Notice list ─────────────────────────────────────────── */
.notice-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notice-item {
  color: var(--text-3);
  font-size: 0.72rem;
  line-height: 1.5;
}

.notice-item::before {
  content: "· ";
}

/* ── Summary cards ───────────────────────────────────────── */
.results-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.summary-card {
  position: relative;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  overflow: hidden;
  transition: background 0.15s;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent));
}

.summary-card:hover { background: var(--surface-hover); }

.summary-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  margin-top: 4px;
  font-family: var(--heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.summary-meta {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 0.6rem;
}

/* ── Table container ─────────────────────────────────────── */
.results-table-wrap {
  border-radius: var(--radius-sm);
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  border: 1px solid var(--border);
}

/* ── Table ───────────────────────────────────────────────── */
.results-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.7rem;
}

.results-table thead tr { background: rgba(0,0,0,0.4); }

.results-table th {
  padding: 8px 12px;
  text-align: left;
  font-family: var(--heading);
  font-size: 0.57rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: #251640;
  user-select: none;
}

.results-table th[data-sort] { cursor: pointer; }
.results-table th[data-sort]:hover { color: var(--text-2); }
.results-table th[data-sort]::after { content: " ⇅"; opacity: 0.3; font-size: 0.85em; }
.results-table th[data-sort].sort-asc::after  { content: " ▲"; opacity: 1; color: var(--accent); }
.results-table th[data-sort].sort-desc::after { content: " ▼"; opacity: 1; color: var(--accent); }

.results-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 20;
}

.results-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(61,43,95,0.5);
  vertical-align: middle;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}

.results-table tr { transition: background 0.1s; }
.results-table tr:hover td { background: rgba(61,43,95,0.4); }

.results-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  font-weight: 550;
}

.results-table tr:hover td:first-child { background: var(--bg-2); }

/* ── Cell helpers ────────────────────────────────────────── */
.cell-fqdn  { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; color: var(--text-1); }
.cell-port  { font-family: var(--mono); font-size: 0.64rem; color: var(--text-3); }
.cell-title { font-size: 0.68rem; color: var(--text-2); line-height: 1.3; white-space: normal; }
.cell-warn  { font-size: 0.62rem; color: var(--yellow); margin-top: 2px; }
.no-data    { color: var(--text-3); font-size: 0.65rem; }

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

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

.badge-row { display: inline-flex; flex-wrap: wrap; gap: 3px; }

.badge.b-orange { background: var(--accent-glow);           color: var(--accent);  border-color: var(--border-accent); }
.badge.b-purple { background: var(--purple-glow);           color: var(--purple);  border-color: rgba(168,85,247,0.25); }
.badge.b-green  { background: var(--green-glow);            color: var(--green);   border-color: rgba(34,197,94,0.25); }
.badge.b-yellow { background: rgba(234,179,8,0.1);          color: var(--yellow);  border-color: rgba(234,179,8,0.25); }
.badge.b-red    { background: rgba(239,68,68,0.1);          color: var(--red);     border-color: rgba(239,68,68,0.25); }
.badge.b-blue   { background: var(--blue-glow);             color: var(--blue);    border-color: rgba(59,130,246,0.25); }

/* Status codes */
.badge.s2xx { background: var(--green-glow);           color: var(--green);  border-color: rgba(34,197,94,0.25); }
.badge.s3xx { background: rgba(234,179,8,0.1);         color: var(--yellow); border-color: rgba(234,179,8,0.25); }
.badge.s4xx { background: rgba(239,68,68,0.08);        color: #f87171;       border-color: rgba(239,68,68,0.2); }
.badge.s5xx { background: rgba(239,68,68,0.15);        color: var(--red);    border-color: rgba(239,68,68,0.3); }

/* ── Table footer ─────────────────────────────────────────── */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  font-size: 0.65rem;
  color: var(--text-3);
  font-family: var(--mono);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  border-top: 1px solid var(--border);
  background: rgba(45,27,77,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  height: 18px;
  width: auto;
  opacity: 0.5;
  display: block;
}

.footer-copy {
  font-size: 0.65rem;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 0.65rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────── */
/* ── Bounty panel ──────────────────────────────────────────────────────────── */
#bountyPanel:not(:empty) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 9px 14px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.bp-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.bp-link:hover { text-decoration: underline; }

.bp-sep {
  color: var(--border-accent);
  user-select: none;
}

.bp-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.bp-label {
  color: var(--text-3);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bp-value {
  color: var(--text-1);
  font-weight: 500;
}

.bp-vdp {
  background: rgba(255, 255, 255, 0.06);
  color: var(--blue);
  border: 1px solid rgba(99, 179, 237, 0.25);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.bp-bounty {
  color: var(--green);
  font-weight: 600;
}

@media (max-width: 860px) {
  .shell { padding: 0 12px 40px; }
  .stat-value { font-size: 1.15rem; }
  .stat-card { min-width: 110px; padding: 10px 12px 8px; }
}

@media (max-width: 600px) {
  .topbar { padding: 10px 0; }
  .topbar-pills { display: none; }
  .donate-btn span:last-child { display: none; }
  .donate-btn { padding: 5px 8px; }
  .results-summary { grid-template-columns: repeat(2, 1fr); }
  .query-header, .results-header { flex-wrap: wrap; }
  .results-table-wrap { max-height: calc(100vh - 280px); }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .announce-bar { font-size: 0.65rem; gap: 5px; }
  .announce-cta { display: none; }
}
