/* ================================================================
   CVE Analysis Tool — shared.css
   Base styles shared across all pages: index, user-guide,
   technical-doc, changelog.
   ================================================================ */

/* ---- Google Fonts are loaded via <link> in each HTML file ---- */

/* ----------------------------------------------------------------
   CSS VARIABLES
   ---------------------------------------------------------------- */
:root {
  --bg:         #EEEEF2;
  --card:       #FFFFFF;
  --card-hover: #F5F6FB;
  --text:       #090F1E;
  --text-muted: #5B6880;
  --border:     #D8DCE8;
  --accent:     #0A5CFF;
  --accent-hover:#0047D4;
  --radius:     6px;
  --radius-sm:  3px;
  --shadow:     0 1px 2px rgba(0,0,0,.06), 0 3px 12px rgba(0,0,0,.05);
  --font-mono:  'JetBrains Mono', monospace;
  --font-sans:  'IBM Plex Sans', sans-serif;
  --cvss-none:     #8896AA;
  --cvss-low:      #1A9E5C;
  --cvss-medium:   #0A5CFF;
  --cvss-high:     #D97000;
  --cvss-critical: #D42B2B;
}

[data-theme="dark"] {
  --bg:         #060C16;
  --card:       #0B1422;
  --card-hover: #0F1D30;
  --text:       #D8E2F0;
  --text-muted: #6E8AAA;
  --border:     #192840;
  --accent:     #2E7FFF;
  --accent-hover:#5A9AFF;
  --shadow:     0 1px 3px rgba(0,0,0,.4), 0 4px 18px rgba(0,0,0,.3);
  --cvss-low:      #17875A;
  --cvss-medium:   #2E7FFF;
  --cvss-high:     #C46800;
  --cvss-critical: #C02828;
}

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

/* ----------------------------------------------------------------
   BASE
   ---------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background .2s, color .2s;
  display: flex;
  flex-direction: column;
}

/* ----------------------------------------------------------------
   HEADER — two-row layout
   Row 1 : logo · nav links · controls (theme button)
   Row 2 : search bar + filter (main page only, injected via .header-search-row)
   ---------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, #4F9FFF 55%, #6B7DFF 100%);
  opacity: .9;
}

/* ── Row 1 ── */
.header-top {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  height: 48px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 16px;
}
.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: white;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.header-logo h1 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 48px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  border-radius: 0;
}
.nav-link:hover { background: transparent; color: var(--text); border-bottom-color: var(--border); }

.nav-link.active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
[data-theme="dark"] .nav-link.active { background: transparent; }
.nav-link .nav-icon { font-size: 13px; opacity: .7; }

/* Header right-side controls (row 1) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Row 2 — search bar (main page only) ── */
.header-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.search-bar input {
  flex: 1;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  min-width: 0;
}
.search-bar input:focus {
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,92,255,.12);
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ----------------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------------- */
.btn {
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn:active { opacity: .85; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(10,92,255,.18);
}
.btn-primary:disabled { opacity: .38; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: var(--text-muted); }

/* ----------------------------------------------------------------
   MAIN CONTENT WRAPPER
   ---------------------------------------------------------------- */
.main {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
}

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 20px;
  font-size: 11px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.footer-logo-icon {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  color: white;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.footer-brand-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.footer-sep { color: var(--border); flex-shrink: 0; }
.footer-disclaimer {
  font-size: 10px;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer-links { display: flex; gap: 10px; flex-shrink: 0; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
}
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-github { display: inline-flex; align-items: center; }
.github-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 700px) {
  .header-logo h1 { display: none; }
  .nav-link .nav-icon { margin: 0; }
  .nav-link span:not(.nav-icon) { display: none; }
  .header-top { padding: 0 12px; }
  .header-search-row { padding: 8px 12px; }
  .main { padding: 14px 12px; }
}
@media (max-width: 480px) {
  .header-nav { gap: 0; }
}

/* ----------------------------------------------------------------
   SHARED UTILITY — used in content pages
   ---------------------------------------------------------------- */
.badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
}
.badge-cvelist  { background: #475569; }
.badge-cisa-adp { background: #1d4ed8; }
.badge-nvd      { background: #0369a1; }
.badge-redhat   { background: #b91c1c; }
.badge-suse     { background: #166534; }
.badge-debian   { background: #fd2e6c; }
.badge-ubuntu   { background: #e55300; }
.badge-microsoft{ background: #66a7dd; }
.badge-amazon   { background: #ff9900; color: #000; }
.badge-libreoffice{background:#18a303;}
.badge-postgresql{background:#336791;}
.badge-oracle   { background: #c74634; }
.badge-cisa     { background: #003366; }
.badge-xen      { background: #787879; }
.badge-enisa    { background: #003f87; }