/* ============================================
   AUDIT RESULTS SITE — SHARED STYLES
   Theme: Dark Ops / Data Console
   Fonts: Outfit (display), IBM Plex Mono (data)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

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

:root {
  --bg-base: #07070d;
  --bg-surface: #0e0e18;
  --bg-elevated: #161625;
  --bg-card: #1a1a2c;
  --border: #2a2a44;
  --border-bright: #3a3a5e;
  --text-primary: #e8e8f0;
  --text-secondary: #9090aa;
  --text-muted: #5e5e7a;

  /* Repo colors */
  --cyan: #22d3ee;
  --cyan-bg: rgba(34,211,238,0.08);
  --gold: #eab308;
  --gold-bg: rgba(234,179,8,0.08);
  --purple: #a78bfa;
  --purple-bg: rgba(167,139,250,0.08);
  --green: #4ade80;
  --green-bg: rgba(74,222,128,0.08);
  --orange: #fb923c;
  --orange-bg: rgba(251,146,60,0.08);

  /* Score colors */
  --score-excellent: #22c55e;
  --score-good: #4ade80;
  --score-medium: #eab308;
  --score-low: #f97316;
  --score-poor: #ef4444;
  --score-critical: #dc2626;

  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1400px;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.page-wrap { min-height: 100vh; }

/* --- NAVIGATION --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,7,13,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--cyan);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-link.active { color: var(--cyan); background: var(--cyan-bg); }
.nav-sep { color: var(--text-muted); font-size: 12px; }

/* --- PAGE HEADER --- */
.page-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.page-header .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}
.page-header .meta-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* --- REPO BADGES --- */
.repo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid;
}
.repo-badge.cyan { color: var(--cyan); background: var(--cyan-bg); border-color: rgba(34,211,238,0.2); }
.repo-badge.gold { color: var(--gold); background: var(--gold-bg); border-color: rgba(234,179,8,0.2); }
.repo-badge.purple { color: var(--purple); background: var(--purple-bg); border-color: rgba(167,139,250,0.2); }
.repo-badge.green { color: var(--green); background: var(--green-bg); border-color: rgba(74,222,128,0.2); }
.repo-badge.orange { color: var(--orange); background: var(--orange-bg); border-color: rgba(251,146,60,0.2); }

/* --- SCORE BADGES --- */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.score-excellent { color: #15803d; background: rgba(34,197,94,0.12); }
.score-good { color: var(--score-good); background: rgba(74,222,128,0.12); }
.score-medium { color: var(--score-medium); background: rgba(234,179,8,0.12); }
.score-low { color: var(--score-low); background: rgba(249,115,22,0.12); }
.score-poor { color: var(--score-poor); background: rgba(239,68,68,0.12); }
.score-critical { color: var(--score-critical); background: rgba(220,38,38,0.15); }

/* --- CARDS --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- TABLES --- */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: var(--bg-elevated);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-bright);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }
tbody tr:hover { background: rgba(255,255,255,0.03); }
td.mono { font-family: var(--font-mono); font-size: 12px; }
td.score-cell { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
td.pass { color: var(--score-good); }
td.partial { color: var(--score-medium); }
td.fail { color: var(--score-poor); }

/* --- COLLAPSIBLE SECTIONS --- */
details {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
details[open] { border-color: var(--border-bright); }
summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: '+';
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  transition: transform 0.2s;
}
details[open] > summary::before { content: '-'; color: var(--cyan); }
.details-content { padding: 0 18px 18px; }

/* --- GRID --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --- SCORE OVERVIEW CARDS (Index) --- */
.score-overview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.score-overview .big-score {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  margin: 8px 0;
}
.score-overview .domain-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}
.score-overview .grade {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- PROGRESS BARS --- */
.progress-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* --- LINKS --- */
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- COMPARISON COLUMNS --- */
.compare-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.compare-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.compare-col h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 900px) {
  .compare-columns { grid-template-columns: 1fr; }
}

/* --- SECTION HEADERS --- */
.section-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.section-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- TAGS / CHIPS --- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.tag-critical { background: rgba(220,38,38,0.15); color: var(--score-critical); }
.tag-high { background: rgba(239,68,68,0.12); color: var(--score-poor); }
.tag-medium { background: rgba(234,179,8,0.12); color: var(--score-medium); }
.tag-low { background: rgba(74,222,128,0.12); color: var(--score-good); }

/* --- VERDICT BOX --- */
.verdict-box {
  background: var(--bg-elevated);
  border-left: 4px solid var(--cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin: 20px 0;
}
.verdict-box.winner { border-left-color: var(--score-good); }
.verdict-box.caution { border-left-color: var(--score-medium); }
.verdict-box.danger { border-left-color: var(--score-poor); }
.verdict-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.verdict-box p { color: var(--text-secondary); font-size: 14px; }

/* --- STAT BLOCK --- */
.stat-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- LINK GRID (Index) --- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.link-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none !important;
  transition: all 0.15s;
}
.link-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}
.link-card .lc-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.link-card .lc-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.link-card .lc-score {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

/* --- UTILITIES --- */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* --- HIGHLIGHT ROWS --- */
.row-winner td { background: rgba(74,222,128,0.04) !important; }
.row-worst td { background: rgba(239,68,68,0.03) !important; }

/* --- FOOTER --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 48px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --- SITE INDEX HERO --- */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin: 32px 0;
}
.hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  border-top: 3px solid;
}
.hero-card.cyan-border { border-top-color: var(--cyan); }
.hero-card.gold-border { border-top-color: var(--gold); }
.hero-card.purple-border { border-top-color: var(--purple); }
.hero-card.green-border { border-top-color: var(--green); }
.hero-card.orange-border { border-top-color: var(--orange); }
.hero-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.hero-card .repo-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.hero-card .skills-count {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.hero-card .skills-label {
  font-size: 11px;
  color: var(--text-secondary);
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* --- INLINE LIST --- */
ul.inline-list {
  list-style: none;
  padding: 0;
}
ul.inline-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
ul.inline-list li:last-child { border-bottom: none; }

/* --- CODE BLOCKS --- */
pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- COMPARISON BAR CHART --- */
.bar-chart { margin: 16px 0; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.bar-label {
  font-size: 12px;
  font-family: var(--font-mono);
  width: 140px;
  flex-shrink: 0;
  text-align: right;
  color: var(--text-secondary);
}
.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--bg-base);
  min-width: 36px;
}
