@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Exo+2:wght@300;400;600;700;900&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:        #060b12;
  --bg2:       #0c1520;
  --bg3:       #101d2e;
  --border:    #1a3a5c;
  --accent:    #00c8ff;
  --accent2:   #0070a8;
  --text:      #c8dce8;
  --text-dim:  #5a7a96;
  --critical:  #ff3b3b;
  --high:      #ff8c00;
  --medium:    #f5c518;
  --low:       #22c55e;
  --unknown:   #6b7280;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Exo 2', sans-serif;
  --radius:    6px;
  --glow:      0 0 16px rgba(0, 200, 255, 0.18);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Scanline overlay ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6,11,18,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 2rem;
  height: 58px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 2px;
}
.nav-logo svg { width: 28px; height: 28px; }
.nav-links {
  display: flex; gap: 0; margin-left: auto;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 0 1.1rem;
  height: 58px; line-height: 58px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Page wrapper ── */
.page { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── Section heading ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
h1, h2, h3 { font-family: var(--font-body); font-weight: 700; }
h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); color: #fff; }
h2 { font-size: 1.4rem; color: #fff; }

/* ── Inputs ── */
input[type="text"],
input[type="email"],
select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: var(--glow);
}
select option { background: var(--bg2); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-transform: uppercase;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}
.btn-primary:hover { background: #30d5ff; box-shadow: 0 0 20px rgba(0,200,255,0.4); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: transparent;
  border: 1px solid var(--critical);
  color: var(--critical);
}
.btn-danger:hover { background: rgba(255,59,59,0.1); }

/* ── Card ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--accent2); box-shadow: var(--glow); }

/* ── Severity badge ── */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
}
.badge-CRITICAL { background: rgba(255,59,59,0.15); color: var(--critical); border: 1px solid var(--critical); }
.badge-HIGH     { background: rgba(255,140,0,0.15);  color: var(--high);     border: 1px solid var(--high); }
.badge-MEDIUM   { background: rgba(245,197,24,0.15); color: var(--medium);   border: 1px solid var(--medium); }
.badge-LOW      { background: rgba(34,197,94,0.15);  color: var(--low);      border: 1px solid var(--low); }
.badge-UNKNOWN  { background: rgba(107,114,128,0.15);color: var(--unknown);  border: 1px solid var(--unknown); }

/* ── Score bar ── */
.score-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.score-track {
  flex: 1; height: 5px; background: var(--bg3);
  border-radius: 99px; overflow: hidden;
}
.score-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.score-num { font-family: var(--font-mono); font-size: 0.9rem; min-width: 30px; text-align: right; }

/* ── Grid layouts ── */
.cve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

/* ── CVE Card ── */
.cve-card { display: flex; flex-direction: column; gap: 10px; }
.cve-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cve-id { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); font-weight: 700; }
.cve-desc { font-size: 0.88rem; color: var(--text); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cve-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cve-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.cve-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%; max-width: 640px;
  max-height: 85vh; overflow-y: auto;
  padding: 2rem;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 1.4rem; line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--critical); }
.modal-section { margin-bottom: 1.2rem; }
.modal-section h3 { font-size: 0.75rem; font-family: var(--font-mono); color: var(--accent); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.modal-section p  { font-size: 0.9rem; line-height: 1.6; }
.ref-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ref-list a { color: var(--accent); font-family: var(--font-mono); font-size: 0.78rem; word-break: break-all; }
.ref-list a:hover { text-decoration: underline; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.7rem 1.1rem;
  font-family: var(--font-mono); font-size: 0.82rem;
  animation: slideIn 0.25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-color: var(--low); color: var(--low); }
.toast.error   { border-color: var(--critical); color: var(--critical); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Spinner ── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 0.9rem; letter-spacing: 1px;
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }

/* ── Search bar row ── */
.search-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}
.search-row .search-input-wrap { flex: 1; min-width: 200px; }
.search-row select { width: auto; }

/* ── Stats strip ── */
.stats-strip {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.stat-box {
  flex: 1; min-width: 100px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 1rem;
  text-align: center;
}
.stat-box .stat-num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-box .stat-lbl { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ── Utility ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.dimtext { color: var(--text-dim); font-size: 0.85rem; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .nav-links a { padding: 0 0.65rem; font-size: 0.72rem; }
  .page { padding: 1.25rem 1rem 3rem; }
  .cve-grid { grid-template-columns: 1fr; }
}
