@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&family=Space+Mono:wght@400;700&display=swap");

/* ── RESET & TOKENS ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07101f;
  --surface: #0c1828;
  --card: #0f1e30;
  --border: #1a304f;
  --border-hi: rgba(0, 212, 168, 0.35);
  --accent: #00d4a8;
  --accent2: #4f9bff;
  --warn: #f5c842;
  --danger: #ff5a7e;
  --text: #ddeeff;
  --muted: #4d6e8a;
  --muted2: #7a9bb8;
  --font-sans: "DM Sans", sans-serif;
  --font-mono: "Space Mono", monospace;
  --radius: 14px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* ── GRID BACKGROUND ─────────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 212, 168, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 168, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ── SCAN LINE ───────────────────────────────────────────────── */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 168, 0.12),
    transparent
  );
  animation: scanline 7s linear infinite;
  pointer-events: none;
  z-index: 1;
  top: 0;
}
@keyframes scanline {
  from {
    top: -4px;
  }
  to {
    top: 100vh;
  }
}
/* ── HEADER BAR ──────────────────────────────────────────────── */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  border-bottom: 0.5px solid var(--border);
  background: rgba(7, 16, 31, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 32px;
  z-index: 500;
}

/* ── WORDMARK (Logo + Text) ─────────────────────────────────── */
.header-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--text);
}

.header-wordmark span {
  color: var(--accent);
}

/* ── LOGO ───────────────────────────────────────────────────── */
.mainLogo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* ── STATUS CHIP ────────────────────────────────────────────── */
.header-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.6px;
  padding: 4px 12px;
  border: 0.5px solid rgba(0, 212, 168, 0.2);
  border-radius: 20px;
  background: rgba(0, 212, 168, 0.04);
}

/* ── ONLINE DOT ─────────────────────────────────────────────── */
.header-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink-dot 2.2s ease-in-out infinite;
}

@keyframes blink-dot {
  0%,100% { opacity: 1; }
  50% { opacity: 0.25; }
}
/* ── CONTAINER ───────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 10;
  max-width: 860px;
  margin: 0 auto;
  padding: 96px 32px 60px;
}

/* ── PAGE TITLE ──────────────────────────────────────────────── */
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-eyebrow::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

.page-title {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  line-height: 1.25;
}
.page-title strong {
  font-weight: 500;
  color: var(--accent);
}

.page-sub {
  font-size: 13px;
  color: var(--muted2);
  margin-bottom: 36px;
}

/* ── UPLOAD FORM CARD ────────────────────────────────────────── */
.upload-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color 0.3s;
}
.upload-card::before,
.upload-card::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.5;
}
.upload-card::before {
  top: 12px;
  left: 12px;
  border-width: 1px 0 0 1px;
  border-radius: 2px 0 0 0;
}
.upload-card::after {
  bottom: 12px;
  right: 12px;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 2px 0;
}

/* Pulse ring behind the card when active */
.upload-card.processing {
  border-color: var(--border-hi);
}

/* Scanner animation */
.scanner-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.scanner {
  width: 64px;
  height: 64px;
  position: relative;
}
.scanner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 168, 0.3);
  animation: spin-ring 9s linear infinite;
}
.scanner-ring::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes spin-ring {
  to {
    transform: rotate(360deg);
  }
}

.scanner-ping {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 168, 0.15);
  animation: ping-out 2.8s ease-out infinite;
}
@keyframes ping-out {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.scanner-core {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: rgba(0, 212, 168, 0.07);
  border: 0.5px solid rgba(0, 212, 168, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-core svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-label {
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 4px;
}
.upload-hint {
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
  margin-bottom: 24px;
}

/* File input wrapper */
.file-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

input[type="file"] {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted2);
  background: rgba(0, 0, 0, 0.25);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
input[type="file"]:hover {
  border-color: var(--border-hi);
}
input[type="file"]::file-selector-button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  background: rgba(0, 212, 168, 0.08);
  color: var(--accent);
  border: 0.5px solid rgba(0, 212, 168, 0.3);
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.2s;
}
input[type="file"]::file-selector-button:hover {
  background: rgba(0, 212, 168, 0.16);
}

/* Submit button */
button[type="submit"] {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  background: var(--accent);
  color: #07101f;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s,
    transform 0.1s;
}
button[type="submit"]:hover {
  background: #00b890;
}
button[type="submit"]:active {
  transform: scale(0.97);
}

.accepted-formats {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 14px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ── STATUS BAR ──────────────────────────────────────────────── */
#status {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--accent);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 0.5px solid transparent;
  margin-bottom: 8px;
  transition: all 0.3s;
  min-height: 0;
}
#status:not(:empty) {
  background: rgba(0, 212, 168, 0.04);
  border-color: rgba(0, 212, 168, 0.15);
}

/* ── RESULTS WRAPPER ─────────────────────────────────────────── */
#results {
  display: none;
  margin-top: 28px;
  animation: fade-up 0.5s ease both;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.results-eyebrow::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

/* 3-column block grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Each result block */
.result-block {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fade-up 0.5s ease both;
}
.result-block:nth-child(1) {
  animation-delay: 0.05s;
}
.result-block:nth-child(2) {
  animation-delay: 0.12s;
}
.result-block:nth-child(3) {
  animation-delay: 0.19s;
}
.result-block:hover {
  border-color: rgba(0, 212, 168, 0.2);
  transform: translateY(-2px);
  transition:
    transform 0.2s,
    border-color 0.2s;
}

/* Block header strip */
.block-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
}
.block-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.block-icon svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.block-title {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 1px;
}
.block-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.6px;
}

/* Block content area */
.block-body {
  flex: 1;
  padding: 14px 16px;
  overflow: hidden;
}

/* pre inside blocks */
.block-body pre {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted2);
  background: rgba(0, 0, 0, 0.2);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.block-body pre::-webkit-scrollbar {
  width: 4px;
}
.block-body pre::-webkit-scrollbar-track {
  background: transparent;
}
.block-body pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── BOTTOM CERT BAR ─────────────────────────────────────────── */
.cert-bar {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}
.cert-badges {
  display: flex;
  gap: 8px;
}
.cert-badge {
  padding: 3px 8px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ── SAMPLE LINK ─────────────────────────────────────────────── */
.sample-link {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}
.sample-link a {
  color: var(--accent);
  text-decoration: none;
}
.sample-link a:hover {
  text-decoration: underline;
}
