/* ──────────────────────────────────────────────────────────── */
/* OpenAnt — Styles                                           */
/* ──────────────────────────────────────────────────────────── */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-card-hover: #22222f;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --text-primary: #e8e8f0;
  --text-secondary: #9898a8;
  --text-muted: #6868788;
  --accent: #6c5ce7;
  --accent-light: #8b7cf0;
  --accent-dim: rgba(108, 92, 231, 0.15);

  --critical: #ff4757;
  --critical-bg: rgba(255, 71, 87, 0.12);
  --high: #ff6b35;
  --high-bg: rgba(255, 107, 53, 0.12);
  --medium: #ffa502;
  --medium-bg: rgba(255, 165, 2, 0.12);
  --low: #3498db;
  --low-bg: rgba(52, 152, 219, 0.12);
  --info: #2ed573;
  --info-bg: rgba(46, 213, 115, 0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Header ──────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon { font-size: 1.5rem; }

.github-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.github-link:hover { color: var(--text-primary); text-decoration: none; }

/* ─── Views ───────────────────────────────────────────────── */

.view { display: none; }
.view.active { display: block; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: calc(100vh - 140px);
}

/* ─── Hero ─────────────────────────────────────────────────── */

.hero {
  padding: 5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.accent { color: var(--accent-light); }

.subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* ─── Scan Form ────────────────────────────────────────────── */

.scan-form {
  max-width: 700px;
  margin: 0 auto 3rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.email-group {
  margin-bottom: 0.75rem;
}

.email-group .input-wrapper input {
  font-family: var(--font);
  font-size: 0.875rem;
}

.email-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--accent-dim);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.email-notice strong {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── Features ─────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

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

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Progress View ────────────────────────────────────────── */

.progress-container {
  max-width: 600px;
  margin: 4rem auto;
}

.progress-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.progress-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.progress-repo {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-light);
}

.progress-steps {
  position: relative;
  padding-left: 2rem;
}

.progress-steps::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.step {
  position: relative;
  padding: 0.75rem 0;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.step.active, .step.completed { opacity: 1; }

.step-indicator {
  position: absolute;
  left: -2rem;
  top: 1rem;
  width: 1.125rem;
  height: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--border-light);
  transition: all 0.3s ease;
}

.step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
  animation: pulse 2s infinite;
}

.step.completed .step-dot {
  background: var(--info);
  box-shadow: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-dim); }
  50% { box-shadow: 0 0 0 8px rgba(108, 92, 231, 0.08); }
}

.step-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.step-content p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.timer {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.timer span { color: var(--text-primary); font-weight: 500; }

.units-info {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.bookmark-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.875rem 1rem;
  background: var(--accent-dim);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--accent-light);
}

/* ─── Results View ─────────────────────────────────────────── */

.results-container {
  max-width: 900px;
  margin: 3rem auto;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.results-repo {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-light);
}

.results-summary {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.severity-critical { background: var(--critical-bg); color: var(--critical); border: 1px solid rgba(255,71,87,0.25); }
.severity-high     { background: var(--high-bg);     color: var(--high);     border: 1px solid rgba(255,107,53,0.25); }
.severity-medium   { background: var(--medium-bg);   color: var(--medium);   border: 1px solid rgba(255,165,2,0.25); }
.severity-low      { background: var(--low-bg);      color: var(--low);      border: 1px solid rgba(52,152,219,0.25); }

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── Finding Card ─────────────────────────────────────────── */

.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.finding-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

.finding-severity {
  flex-shrink: 0;
  width: 4px;
  height: 2.5rem;
  border-radius: 2px;
}

.finding-severity.critical { background: var(--critical); }
.finding-severity.high     { background: var(--high); }
.finding-severity.medium   { background: var(--medium); }
.finding-severity.low      { background: var(--low); }

.finding-info {
  flex: 1;
  min-width: 0;
}

.finding-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.125rem;
}

.finding-location {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finding-tags {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tag {
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-xs);
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.tag-verified { background: var(--critical-bg); color: var(--critical); border-color: rgba(255,71,87,0.25); }
.tag-poc      { background: var(--info-bg);     color: var(--info);     border-color: rgba(46,213,115,0.25); }

.finding-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.finding-card.expanded .finding-chevron {
  transform: rotate(90deg);
}

.finding-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.finding-card.expanded .finding-body {
  display: block;
}

.finding-section {
  margin-top: 1rem;
}

.finding-section h5 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.finding-section p,
.finding-section pre {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.finding-section pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.875rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.exploit-path {
  display: grid;
  gap: 0.5rem;
}

.exploit-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-xs);
}

.exploit-step-num {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-light);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exploit-step-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Results Footer ───────────────────────────────────────── */

.results-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ttl-notice {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── Error View ───────────────────────────────────────────── */

.error-container {
  text-align: center;
  padding: 5rem 0;
}

.error-icon { font-size: 3rem; margin-bottom: 1rem; }
.error-container h2 { margin-bottom: 0.75rem; }
.error-container p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Footer ───────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 3rem 0 2rem; }
  .subtitle { font-size: 1rem; }

  .input-group {
    flex-direction: column;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .results-header {
    flex-direction: column;
  }

  .finding-header {
    flex-wrap: wrap;
  }

  .finding-tags {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* ─── Loading Spinner ──────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── No Results ───────────────────────────────────────────── */

.no-findings {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.no-findings .check-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.no-findings h3 {
  color: var(--info);
  margin-bottom: 0.5rem;
}
