/* ═══════════════════════════════════════════════════════════════
   SANCHAN AI — Code Review Platform
   styles.css
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg: #0a0e1a;
  --bg2: #0f1629;
  --bg3: #161d35;
  --surface: #1a2240;
  --surface2: #1e2850;
  --border: #2a3560;
  --border2: #3a4a80;
  --text: #e8eaf6;
  --text2: #9aa3c0;
  --text3: #6b7699;
  --accent: #6c63ff;
  --accent2: #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --green: #10b981;
  --yellow: #f59e0b;
  --orange: #f97316;
  --red: #ef4444;
  --critical: #dc2626;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #e8ecf5;
  --bg3: #dde3f0;
  --surface: #ffffff;
  --surface2: #f5f7ff;
  --border: #d0d8f0;
  --border2: #b8c4e8;
  --text: #1a2240;
  --text2: #4a5580;
  --text3: #8890b0;
  --accent: #5b54f0;
  --accent2: #7b74ff;
  --accent-glow: rgba(91, 84, 240, 0.15);
  --card-shadow: 0 4px 24px rgba(0,0,40,0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

[data-theme="light"] .navbar {
  background: rgba(240, 242, 248, 0.9);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.brand-name .accent { color: var(--accent); }
.brand-tagline { font-size: 11px; color: var(--text3); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text); }

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text2);
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--surface2); color: var(--accent); }

/* ── Hero Section ──────────────────────────────────────────── */
.hero-section {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  grid-column: 1 / -1;
}

.hero-content > *:not(.hero-visual) {
  grid-column: 1;
}

.hero-visual {
  grid-column: 2;
  grid-row: 1 / 5;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-badge i { color: var(--accent); }

.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--cyan), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 17px;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 36px;
}

.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: white;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
  color: white;
}

/* Code Window */
.code-window {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  max-width: 480px;
  margin-left: auto;
}

.window-header {
  background: var(--surface);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28ca41; }

.window-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text3);
}

.code-content { padding: 20px; font-family: var(--mono); font-size: 13px; line-height: 1.8; }

.code-line { display: flex; align-items: center; gap: 12px; }
.ln { color: var(--text3); min-width: 20px; text-align: right; font-size: 11px; }
.kw { color: #c792ea; }
.fn { color: #82aaff; }
.str { color: #c3e88d; }
.cm { color: var(--text3); }

.issue-line { position: relative; background: rgba(245, 158, 11, 0.08); border-radius: 4px; padding: 0 4px; }
.issue-badge {
  margin-left: auto;
  font-size: 10px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.error-badge {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}
.ok-line { background: rgba(16, 185, 129, 0.08); }

/* ── Languages Section ─────────────────────────────────────── */
.languages-section {
  padding: 32px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner { max-width: 1200px; margin: 0 auto; }

.lang-label {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lang-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  border: 1px solid;
}

.pill.js  { background: rgba(247,220,111,0.1); color: #f7dc6f; border-color: rgba(247,220,111,0.3); }
.pill.ts  { background: rgba(58,124,195,0.1);  color: #3a7cc3; border-color: rgba(58,124,195,0.3); }
.pill.py  { background: rgba(53,159,244,0.1);  color: #359ff4; border-color: rgba(53,159,244,0.3); }
.pill.java{ background: rgba(247,130,0,0.1);   color: #f78200; border-color: rgba(247,130,0,0.3); }
.pill.react{background: rgba(97,219,251,0.1);  color: #61dbfb; border-color: rgba(97,219,251,0.3); }
.pill.next{ background: rgba(255,255,255,0.08);color: #ddd;    border-color: rgba(255,255,255,0.15); }
.pill.go  { background: rgba(0,173,216,0.1);   color: #00add8; border-color: rgba(0,173,216,0.3); }
.pill.php { background: rgba(119,123,179,0.1); color: #777bb3; border-color: rgba(119,123,179,0.3); }
.pill.ruby{ background: rgba(204,52,45,0.1);   color: #cc342d; border-color: rgba(204,52,45,0.3); }
.pill.css { background: rgba(38,77,228,0.1);   color: #264de4; border-color: rgba(38,77,228,0.3); }
.pill.html{ background: rgba(228,77,38,0.1);   color: #e44d26; border-color: rgba(228,77,38,0.3); }
.pill.sh  { background: rgba(30,215,96,0.1);   color: #1ed760; border-color: rgba(30,215,96,0.3); }
.pill.sql { background: rgba(255,170,0,0.1);   color: #ffaa00; border-color: rgba(255,170,0,0.3); }
.pill.yaml{ background: rgba(207,100,54,0.1);  color: #cf6436; border-color: rgba(207,100,54,0.3); }
.pill.cpp    { background: rgba(0,89,157,0.1);    color: #00599d; border-color: rgba(0,89,157,0.3); }
.pill.docker { background: rgba(13,183,237,0.1);  color: #0db7ed; border-color: rgba(13,183,237,0.3); }
.pill.tf     { background: rgba(94,52,189,0.1);   color: #5e34bd; border-color: rgba(94,52,189,0.3); }
.pill.cf     { background: rgba(255,153,0,0.1);   color: #ff9900; border-color: rgba(255,153,0,0.3); }
.pill.ansible{ background: rgba(238,0,0,0.1);     color: #ee0000; border-color: rgba(238,0,0,0.3); }
.pill.dart   { background: rgba(84,182,240,0.1);  color: #54b6f0; border-color: rgba(84,182,240,0.3); }
.pill.scala  { background: rgba(220,50,47,0.1);   color: #dc322f; border-color: rgba(220,50,47,0.3); }
.pill.r      { background: rgba(39,109,195,0.1);  color: #276dc3; border-color: rgba(39,109,195,0.3); }
.pill.json   { background: rgba(180,180,180,0.1); color: #aaa;    border-color: rgba(180,180,180,0.3); }
.pill.xml    { background: rgba(243,156,18,0.1);  color: #f39c12; border-color: rgba(243,156,18,0.3); }
.pill.kotlin { background: rgba(169,123,255,0.1); color: #a97bff; border-color: rgba(169,123,255,0.3); }
.pill.swift  { background: rgba(250,83,4,0.1);    color: #fa5304; border-color: rgba(250,83,4,0.3); }
.pill.csharp { background: rgba(104,33,122,0.1);  color: #68217a; border-color: rgba(104,33,122,0.3); }
.pill.rust   { background: rgba(222,165,132,0.1); color: #dea584; border-color: rgba(222,165,132,0.3); }
.pill.md     { background: rgba(255,255,255,0.06);color: #bbb;    border-color: rgba(255,255,255,0.12); }
.pill.toml   { background: rgba(144,238,144,0.1); color: #90ee90; border-color: rgba(144,238,144,0.3); }

/* ── Rule Breakdown Table ──────────────────────────────────── */
.rule-breakdown-table { margin: 32px 0 8px; overflow-x: auto; }
.rbt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rbt thead tr { background: rgba(255,255,255,0.04); }
.rbt thead th { padding: 10px 14px; text-align: left; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rbt tbody tr { border-bottom: 1px solid rgba(255,255,255,0.05); transition: background .15s; }
.rbt tbody tr:hover { background: rgba(255,255,255,0.03); }
.rbt td { padding: 10px 14px; color: var(--text2); line-height: 1.5; }
.rbt td:first-child { color: var(--accent); font-weight: 700; font-size: 12px; white-space: nowrap; }
.rbt td:nth-child(2) strong { color: var(--text1); }
.rbt-count { text-align: right; font-weight: 700; color: var(--accent); white-space: nowrap; min-width: 60px; }
.rbt-total { font-size: 15px; color: #4ade80 !important; }
.rbt tfoot td { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text1); }

/* ── Upload Section ────────────────────────────────────────── */
.upload-section {
  padding: 80px 24px;
  background: var(--bg);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 16px;
  color: var(--text2);
  max-width: 600px;
  margin: 0 auto;
}

.upload-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

/* Upload Tabs */
.upload-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  font-family: var(--font);
}

.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }

.tab-content { display: none; padding: 32px; }
.tab-content.active { display: block; }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg2);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.05);
}

.drop-icon { font-size: 48px; color: var(--accent); margin-bottom: 16px; }

.drop-text strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.drop-text span {
  font-size: 13px;
  color: var(--text3);
}

.drop-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text3);
  background: var(--surface);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Selected File */
.selected-file {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon { font-size: 24px; color: var(--accent); }
.file-details { flex: 1; }
.file-name { display: block; font-weight: 600; font-family: var(--mono); font-size: 14px; }
.file-size { font-size: 12px; color: var(--text3); }

.remove-file {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}
.remove-file:hover { background: rgba(239,68,68,0.1); color: var(--red); }

/* Paste Tab */
.paste-container { display: flex; flex-direction: column; gap: 12px; }

.paste-header {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.lang-selector, .paste-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.lang-select, .filename-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--font);
  transition: border-color var(--transition);
}

.lang-select:focus, .filename-input:focus {
  outline: none;
  border-color: var(--accent);
}

.code-editor {
  width: 100%;
  min-height: 300px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--transition);
}

.code-editor:focus { outline: none; border-color: var(--accent); }

.paste-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
}

.clear-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  font-family: var(--font);
}
.clear-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Review Options */
.review-options {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.options-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.option-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: color var(--transition);
}

.option-check:hover { color: var(--text); }
.option-check input { display: none; }

.checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  background: var(--bg);
}

.option-check input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.option-check input:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.option-check span:last-child i { color: var(--accent); margin-right: 4px; }

/* Review Button */
.review-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: white;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.review-btn:hover { filter: brightness(1.1); }
.review-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Progress Overlay ──────────────────────────────────────── */
.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  text-align: center;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

.progress-icon {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 24px;
}

.spinner-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress-code-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent);
}

.progress-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-card p {
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 24px;
}

.progress-bar-wrap {
  height: 6px;
  background: var(--bg2);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0;
}

.progress-steps {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.pstep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text3);
  transition: color var(--transition);
}

.pstep i { font-size: 18px; }
.pstep.active { color: var(--accent); }
.pstep.done { color: var(--green); }

/* ── Results Section ───────────────────────────────────────── */
.results-section {
  padding: 60px 24px;
  background: var(--bg);
}

/* Report-only mode — when viewing a report via ?report=id */
body.report-mode .hero-section,
body.report-mode .languages-section,
body.report-mode .upload-section,
body.report-mode .features-section,
body.report-mode .engine-section,
body.report-mode .reports-section { display: none !important; }
body.report-mode .results-section { display: block !important; padding-top: 30px; }

.report-back-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.report-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-family: var(--font); cursor: pointer;
  text-decoration: none; transition: all .15s;
}
.report-back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Score Header */
.score-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--card-shadow);
}

.score-card {
  display: flex;
  align-items: center;
  gap: 24px;
}

.score-circle-wrap {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
}

.score-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-track { fill: none; stroke: var(--bg2); stroke-width: 8; }
.score-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#scoreValue {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.score-max { font-size: 11px; color: var(--text3); }

.score-grade {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.score-label { font-size: 13px; color: var(--text3); margin-bottom: 16px; }

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.sb-item i { width: 16px; }
.sb-item.critical { color: var(--critical); }
.sb-item.error { color: var(--red); }
.sb-item.warning { color: var(--yellow); }
.sb-item.info { color: var(--blue); }

/* Report Meta */
.report-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}

.meta-item i { color: var(--accent); width: 16px; }

/* Report Actions */
.report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--red), #b91c1c);
  color: white;
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

.action-btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.action-btn.secondary {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
}

.action-btn.secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Result Tabs — sticky so user can switch without scrolling back up */
.result-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.rtab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-family: var(--font);
}

.rtab:hover { border-color: var(--accent); color: var(--text); }
.rtab.active { background: var(--accent); border-color: var(--accent); color: white; }

.badge {
  background: var(--bg2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
}

.rtab.active .badge { background: rgba(255,255,255,0.2); color: white; }
.badge-critical { background: rgba(220,38,38,0.2); color: var(--critical); }
.badge-security { background: rgba(239,68,68,0.2); color: var(--red); }

/* Issues List — fixed height, scrollable inside */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding: 16px 4px 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.issues-list::-webkit-scrollbar { width: 6px; }
.issues-list::-webkit-scrollbar-track { background: transparent; }
.issues-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.issues-list::-webkit-scrollbar-thumb:hover { background: var(--border2); }

.issue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: all var(--transition);
}

.issue-card:hover { border-color: var(--border2); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

.issue-card.severity-critical { border-left-color: var(--critical); }
.issue-card.severity-error { border-left-color: var(--red); }
.issue-card.severity-warning { border-left-color: var(--yellow); }
.issue-card.severity-info { border-left-color: var(--blue); }

.issue-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.issue-severity {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sev-critical { background: rgba(220,38,38,0.15); color: var(--critical); }
.sev-error { background: rgba(239,68,68,0.15); color: var(--red); }
.sev-warning { background: rgba(245,158,11,0.15); color: var(--yellow); }
.sev-info { background: rgba(59,130,246,0.15); color: var(--blue); }

.issue-rule {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--mono);
}

.issue-category {
  font-size: 11px;
  color: var(--text3);
  background: var(--bg2);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
  margin-left: auto;
}

.issue-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.issue-desc {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 10px;
  line-height: 1.6;
}

.issue-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text3);
  font-family: var(--mono);
}

.issue-location i { color: var(--accent); }

.issue-fix {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--green);
}

.issue-fix strong { display: block; margin-bottom: 2px; }

.issue-code {
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  overflow-x: auto;
  white-space: pre;
}

/* Summary Panel */
.summary-panel { display: none; padding-top: 20px; }
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.summary-card.full-width { grid-column: 1 / -1; }
.summary-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text2); }
.summary-card h4 i { color: var(--accent); margin-right: 8px; }

.cat-bar-item { margin-bottom: 12px; }
.cat-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.cat-bar-track { height: 6px; background: var(--bg2); border-radius: 100px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 100px; transition: width 1s ease; }

.sev-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sev-bar-name { font-size: 13px; min-width: 80px; }
.sev-bar-track { flex: 1; height: 8px; background: var(--bg2); border-radius: 100px; overflow: hidden; }
.sev-bar-fill { height: 100%; border-radius: 100px; transition: width 1s ease; }
.sev-bar-count { font-size: 13px; font-weight: 600; min-width: 30px; text-align: right; }

.files-table table { width: 100%; border-collapse: collapse; }
.files-table th { text-align: left; font-size: 12px; color: var(--text3); padding: 6px 12px; border-bottom: 1px solid var(--border); }
.files-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.files-table tr:last-child td { border-bottom: none; }
.files-table tr:hover td { background: var(--bg2); }

/* ── Features Section ──────────────────────────────────────── */
.features-section {
  padding: 80px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.fc-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.fc-icon.security { background: rgba(239,68,68,0.1); color: var(--red); }
.fc-icon.quality { background: rgba(108,99,255,0.1); color: var(--accent); }
.fc-icon.performance { background: rgba(245,158,11,0.1); color: var(--yellow); }
.fc-icon.bestpractice { background: rgba(16,185,129,0.1); color: var(--green); }

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-card li {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-card li::before { content: '→'; color: var(--accent); font-size: 11px; }

/* ── Reports Section ───────────────────────────────────────── */
.reports-section {
  padding: 80px 24px;
  background: var(--bg);
}

.reports-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 440px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.reports-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.reports-table th:nth-child(1) { width: 35%; }
.reports-table th:nth-child(2) { width: 14%; }
.reports-table th:nth-child(3) { width: 13%; }
.reports-table th:nth-child(4) { width: 12%; }
.reports-table th:nth-child(5) { width: 13%; }
.reports-table th:nth-child(6) { width: 13%; text-align: center; }

.reports-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.reports-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.reports-table td:nth-child(6) { text-align: center; }

.reports-table tr:last-child td { border-bottom: none; }
.reports-table tr:hover td { background: var(--bg2); }

.empty-row td {
  text-align: center;
  color: var(--text3);
  padding: 60px;
}

.empty-row i { margin-right: 8px; font-size: 20px; }

.score-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.score-A { background: rgba(16,185,129,0.15); color: var(--green); }
.score-B { background: rgba(59,130,246,0.15); color: var(--blue); }
.score-C { background: rgba(245,158,11,0.15); color: var(--yellow); }
.score-D { background: rgba(249,115,22,0.15); color: var(--orange); }
.score-F { background: rgba(239,68,68,0.15); color: var(--red); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-desc { font-size: 12px; color: var(--text3); }
.footer-copy { font-size: 12px; color: var(--text3); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--blue); }

/* ── Git URL Tab ───────────────────────────────────────────── */
.git-url-container { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.git-url-header { display: flex; align-items: flex-start; gap: 16px; }
.git-url-header strong { display: block; font-size: 15px; font-weight: 700; color: var(--text1); margin-bottom: 4px; }
.git-url-header span { font-size: 13px; color: var(--text3); }
.git-url-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.git-example { font-family: var(--mono); font-size: 11px; background: var(--surface2); color: var(--accent); padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); }
.git-input-group { display: flex; flex-direction: column; gap: 6px; }
.git-label { font-size: 12px; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.git-optional { font-weight: 400; color: var(--text3); font-size: 11px; }
.git-url-input, .git-token-input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface2); color: var(--text1); font-size: 13px; font-family: var(--mono); outline: none; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.git-url-input:focus, .git-token-input:focus { border-color: var(--accent); }
.git-url-input.field-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.git-token-hint { font-size: 11px; color: var(--text3); }
.git-token-help {
  margin-top: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.git-token-help-row {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}
.git-token-help-row i { width: 14px; color: var(--accent); margin-right: 4px; }
.git-token-help-row code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}
.git-field-err { display:none; font-size:12px; color:var(--red); margin-top:5px; padding-left:2px; }
.git-field-err.show { display:block; }
.field-req { color:var(--red); margin-left:2px; }
.drop-zone.field-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.10); }
.code-editor.field-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.10); }
.git-platform-icons { display: flex; gap: 20px; }
.git-plat { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text3); font-weight: 500; }
.git-plat i { font-size: 16px; }

/* ── No Issues State ───────────────────────────────────────── */
.no-issues {
  text-align: center;
  padding: 60px;
  color: var(--text3);
}

.no-issues i {
  font-size: 48px;
  color: var(--green);
  margin-bottom: 16px;
  display: block;
}

/* ── Responsive ────────────────────────────────────────────── */

/* Prevent horizontal overflow at all sizes */
html, body { overflow-x: hidden; max-width: 100vw; }

@media (max-width: 1100px) {
  .hero-content { gap: 32px; }
  .hero-visual { max-width: 420px; }
}

@media (max-width: 900px) {
  .hero-section { padding: 60px 20px; }
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    grid-column: 1;
    grid-row: auto;
    max-width: 100%;
  }
  .score-header {
    grid-template-columns: 1fr;
  }
  .score-card { flex-direction: column; text-align: center; }
  .summary-grid { grid-template-columns: 1fr; }
  .section-inner { padding: 0 16px; }
}

@media (max-width: 600px) {
  .hero-stats { gap: 12px; flex-wrap: wrap; }
  .stat-num { font-size: 22px; }
  .tab-content { padding: 16px; }
  .review-options { padding: 16px; }
  .options-grid { grid-template-columns: 1fr 1fr; }
  .result-tabs { gap: 6px; flex-wrap: wrap; }
  .rtab { padding: 8px 12px; font-size: 12px; }
  .nav-links a { display: none; }
  .navbar { padding: 0 12px; }
  .rule-breakdown-table { overflow-x: auto; }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-section, .issue-card {
  animation: fadeIn 0.4s ease;
}

/* ─── ANALYSIS ENGINE SECTION ─────────────────────────────── */
.engine-section {
  padding: 80px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* Platform comparison badges */
.engine-platforms {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 24px 0 32px;
}
.ep-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px;
  background: rgba(108,99,255,.1);
  border: 1px solid rgba(108,99,255,.3);
  color: var(--accent2);
}
.ep-badge i { color: #10b981; font-size: 11px; }

.engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.engine-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color .2s, transform .15s;
}
.engine-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.engine-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.ec-security { background: rgba(239,68,68,.1);  color: var(--red); }
.ec-quality  { background: rgba(108,99,255,.1); color: var(--accent); }
.ec-ast      { background: rgba(59,130,246,.1); color: #60a5fa; }
.ec-ci       { background: rgba(20,184,166,.1); color: #2dd4bf; }
.ec-perf     { background: rgba(245,158,11,.1); color: var(--yellow); }

.engine-body { flex: 1; min-width: 0; }
.engine-name {
  font-size: 14px; font-weight: 700;
  margin-bottom: 5px; color: var(--text);
}
.engine-desc {
  font-size: 12px; color: var(--text2);
  line-height: 1.5; margin-bottom: 10px;
}
.engine-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.engine-tags span {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  background: var(--bg2); color: var(--text2);
  border: 1px solid var(--border);
  letter-spacing: .3px;
}
