/* ===== CSS Variables ===== */
:root {
  --bg-primary: #08080d;
  --bg-secondary: #0f0f18;
  --bg-tertiary: #1a1a2e;
  --bg-card: #1c1c35;
  --bg-card-hover: #222245;
  --border-color: #353555;
  --border-hover: #4a4a70;
  --text-primary: #eaeaf0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a85;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-subtle: rgba(99, 102, 241, 0.08);
  --critical: #ef4444;
  --critical-bg: rgba(239, 68, 68, 0.1);
  --high: #f97316;
  --high-bg: rgba(249, 115, 22, 0.1);
  --medium: #eab308;
  --medium-bg: rgba(234, 179, 8, 0.1);
  --low: #3b82f6;
  --low-bg: rgba(59, 130, 246, 0.1);
  --info: #6b7280;
  --info-bg: rgba(107, 114, 128, 0.1);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f1f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f6fa;
  --border-color: #e2e4ea;
  --border-hover: #c8cad4;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #8888a0;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.15);
  --accent-subtle: rgba(79, 70, 229, 0.06);
  --critical: #dc2626;
  --critical-bg: rgba(220, 38, 38, 0.08);
  --high: #ea580c;
  --high-bg: rgba(234, 88, 12, 0.08);
  --medium: #ca8a04;
  --medium-bg: rgba(202, 138, 4, 0.08);
  --low: #2563eb;
  --low-bg: rgba(37, 99, 235, 0.08);
  --info: #6b7280;
  --info-bg: rgba(107, 114, 128, 0.06);
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 5px; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 5px; border: 2px solid var(--bg-secondary); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Firefox scrollbar */
* {
  scrollbar-width: auto;
  scrollbar-color: var(--border-hover) var(--bg-secondary);
}

/* ===== Animations ===== */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

.fade-in { animation: fade-in 0.4s ease-out forwards; }
.slide-up { animation: slide-up 0.5s ease-out forwards; }

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.header {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  background: rgba(17, 17, 24, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-hover), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 9px;
  padding: 3px 8px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--accent-hover);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.nav-link:hover { color: var(--text-primary); }

/* ===== Theme Toggle ===== */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Dark mode: show sun icon, hide moon */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

/* Light mode: show moon icon, hide sun */
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Light theme overrides for specific elements */
[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--border-color);
}

[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
}

[data-theme="light"] .logo-text {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, #1a1a2e 0%, #4a4a68 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .scan-btn {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

[data-theme="light"] .summary-card {
  box-shadow: var(--shadow-sm);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 0 50px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent-hover);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== Scanner Form ===== */
.scanner-section {
  padding: 20px 0 60px;
}

.scan-form {
  display: flex;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.url-input {
  width: 100%;
  padding: 16px 20px 16px 46px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 15px;
  transition: all var(--transition);
  outline: none;
}

.url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-tertiary);
}

.url-input:invalid {
  box-shadow: none;
}

.url-input::placeholder { color: var(--text-muted); }

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.scan-btn {
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Scan Profile Dropdown */
.scan-profile {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  min-width: 160px;
}

.scan-profile:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.scan-profile option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Copy Button in Findings */
.finding-copy-btn {
  padding: 5px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.finding-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.finding-copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
}

.scan-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.scan-btn:active:not(:disabled) {
  transform: translateY(0);
}

.scan-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.scan-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== Error Message ===== */
.error-message {
  padding: 14px 20px;
  background: var(--critical-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: var(--critical);
  font-size: 14px;
  margin-top: 20px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-message[hidden] {
  display: none !important;
}

.error-message::before { content: "⚠️"; }

/* ===== Progress ===== */
.progress-section {
  max-width: 680px;
  margin: 28px auto 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  animation: fade-in 0.3s ease-out;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-glow 1.2s ease-in-out infinite;
}

.progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.progress-timer {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.progress-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.progress-step {
  flex: 1;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-step.active {
  background: var(--accent);
}

.progress-step.completed {
  background: var(--success);
}

.progress-logs {
  max-height: 180px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 2;
}

.log-entry {
  color: var(--text-secondary);
  padding: 1px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-entry::before {
  content: "›";
  color: var(--accent);
  font-weight: bold;
}

.log-entry.complete::before {
  content: "✓";
  color: var(--success);
}

/* ===== Results ===== */
.results-section {
  padding: 50px 0 80px;
  animation: slide-up 0.5s ease-out;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.results-title {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-title svg { color: var(--accent); }

/* ===== Dashboard Grid ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Severity Chart ===== */
.severity-chart {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.donut-container {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.donut-container svg {
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .number {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.donut-center .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-count {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 20px;
  text-align: right;
}

/* ===== Category Breakdown ===== */
.category-breakdown {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.category-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-name {
  font-size: 12px;
  color: var(--text-secondary);
  width: 160px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease-out;
}

.category-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  width: 24px;
  text-align: right;
}

/* ===== Findings Toolbar ===== */
.findings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.findings-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.findings-tabs .tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.findings-tabs .tab:hover {
  color: var(--text-primary);
}

.findings-tabs .tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.findings-count {
  font-size: 12px;
  color: var(--text-muted);
}

.download-btn {
  padding: 12px 22px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Risk Score ===== */
.risk-score-section {
  margin-bottom: 28px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.risk-score-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.risk-score-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.risk-score-value {
  font-size: 28px;
  font-weight: 800;
}

.risk-score-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.risk-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Summary Grid ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.summary-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-align: center;
  transition: all var(--transition);
}

.summary-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.summary-card .count {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 4px;
}

.summary-card .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

.summary-card.critical .count { color: var(--critical); }
.summary-card.critical { border-color: rgba(239, 68, 68, 0.2); }
.summary-card.high .count { color: var(--high); }
.summary-card.high { border-color: rgba(249, 115, 22, 0.2); }
.summary-card.medium .count { color: var(--medium); }
.summary-card.medium { border-color: rgba(234, 179, 8, 0.2); }
.summary-card.low .count { color: var(--low); }
.summary-card.low { border-color: rgba(59, 130, 246, 0.2); }
.summary-card.info .count { color: var(--info); }
.summary-card.total .count { color: var(--text-primary); }

/* ===== Scan Info ===== */
.scan-info {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.scan-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scan-info-item strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== Findings ===== */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all var(--transition);
  animation: slide-up 0.4s ease-out forwards;
  opacity: 0;
}

.finding-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.severity-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.severity-badge.critical { background: var(--critical-bg); color: var(--critical); border: 1px solid rgba(239,68,68,0.2); }
.severity-badge.high { background: var(--high-bg); color: var(--high); border: 1px solid rgba(249,115,22,0.2); }
.severity-badge.medium { background: var(--medium-bg); color: var(--medium); border: 1px solid rgba(234,179,8,0.2); }
.severity-badge.low { background: var(--low-bg); color: var(--low); border: 1px solid rgba(59,130,246,0.2); }
.severity-badge.informational { background: var(--info-bg); color: var(--info); border: 1px solid rgba(107,114,128,0.2); }

.finding-type {
  font-size: 13px;
  font-weight: 600;
}

.finding-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

.finding-evidence {
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
}

.finding-remediation {
  padding: 10px 12px;
  background: var(--success-bg);
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--success);
  line-height: 1.6;
  display: flex;
  gap: 6px;
}

.finding-remediation::before {
  content: "💡";
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--success);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto;
}

/* ===== Scan History ===== */
.history-section {
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.history-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.history-title svg { color: var(--accent); }

.clear-history-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.clear-history-btn:hover {
  border-color: var(--critical);
  color: var(--critical);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.history-item-url {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-item-findings {
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
}

.history-item-findings.has-issues {
  background: var(--high-bg);
  color: var(--high);
}

.history-item-findings.clean {
  background: var(--success-bg);
  color: var(--success);
}

/* ===== Features ===== */
.features-section {
  padding: 80px 0;
  border-top: 1px solid var(--border-color);
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-hover);
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.feature-count {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  background: var(--accent-subtle);
  border-radius: 12px;
  font-size: 11px;
  color: var(--accent-hover);
  font-weight: 500;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
}

.toast.removing {
  animation: toast-out 0.3s ease-in forwards;
}

.toast.success {
  background: #0d3320;
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.toast.error {
  background: #3b1111;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--critical);
}

.toast.info {
  background: #1a1a3a;
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-hover);
}

/* ===== Action Buttons ===== */
.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary);
}

.secondary-btn:hover:not(:disabled) {
  border-color: var(--accent) !important;
  background: var(--bg-card);
}

/* ===== Finding Expand/Collapse ===== */
.finding-card {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  animation: slide-up 0.4s ease-out forwards;
  opacity: 0;
  cursor: pointer;
}

.finding-card:hover {
  border-color: var(--border-hover);
}

.finding-card .finding-body {
  display: none;
  margin-top: 10px;
}

.finding-card.expanded .finding-body {
  display: block;
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finding-toggle {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.finding-card.expanded .finding-toggle {
  transform: rotate(180deg);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-brand { font-weight: 600; }
.footer-divider { opacity: 0.3; }

.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero-subtitle { font-size: 15px; }
  .scan-form { flex-direction: column; }
  .scan-btn { justify-content: center; width: 100%; }
  .scan-profile { width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .results-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .results-actions { flex-wrap: wrap; width: 100%; }
  .action-btn { flex: 1; justify-content: center; min-width: 80px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .footer-content { flex-direction: column; gap: 8px; text-align: center; }
  .nav-links a.nav-link { display: none; }
  .theme-toggle { display: flex; }
  .severity-chart { flex-direction: column; }
  .findings-toolbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .findings-tabs { flex-wrap: wrap; }
  .findings-tabs .tab { padding: 6px 10px; font-size: 11px; }
  .category-name { width: 100px; }
  .finding-header { flex-wrap: wrap; gap: 8px; }
  .finding-copy-btn { padding: 6px 12px; font-size: 12px; }
  .scan-info { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 50px 0 30px; }
  .hero h1 { font-size: 26px; }
  .hero-badge { font-size: 11px; padding: 5px 12px; }
  .features-grid { grid-template-columns: 1fr; }
  .results-actions { flex-direction: column; width: 100%; }
  .action-btn { justify-content: center; width: 100%; }
  .finding-type { font-size: 13px; }
  .donut-container { width: 100px; height: 100px; }
  .container { padding: 0 16px; }
}
