:root {
  --bg-dark: #080c14;
  --bg-card: #0f172a;
  --border-color: #1e293b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
}

.top-nav {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-group { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.badge-audit {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}
.nav-controls { display: flex; align-items: center; gap: 1rem; }
.lang-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn.active {
  background: rgba(139, 92, 246, 0.25);
  color: #c084fc;
}
.nav-link-home {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}
.nav-link-home:hover { color: var(--accent-purple); }

/* Main */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.hero-section { text-align: center; margin-bottom: 2.5rem; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(139, 92, 246, 0.1);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  line-height: 1.25;
}
.hero-desc {
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Calc Card */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 800px) {
  .input-grid { grid-template-columns: 1fr; }
}
.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.col-title { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.code-box {
  width: 100%;
  background: #090e1a;
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  outline: none;
  resize: vertical;
}
.action-bar { display: flex; justify-content: center; }
.btn-diff {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #3b82f6 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-diff:hover { filter: brightness(1.15); }

/* Vulnerability Box */
.audit-summary-box {
  margin-top: 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}
.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}
.vuln-count { font-weight: 800; font-size: 1.05rem; }
.diff-count { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); }
.text-danger { color: var(--accent-red); }
.vuln-item {
  font-size: 0.85rem;
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Diff View */
.diff-output-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.diff-viewer {
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 450px;
  overflow-y: auto;
}
.diff-added { background: rgba(16, 185, 129, 0.2); color: #34d399; display: block; }
.diff-removed { background: rgba(239, 68, 68, 0.2); color: #f87171; display: block; text-decoration: line-through; }
.diff-common { color: #94a3b8; display: block; }
