/* ===== BUGTRACE CSS ===== */
:root {
  --bg: #0a0a14;
  --bg2: #0f0f1f;
  --card: #13132a;
  --card2: #1a1a35;
  --border: #2a2a50;
  --purple: #7c5cfc;
  --cyan: #00d4ff;
  --green: #00e676;
  --red: #ff4757;
  --yellow: #ffd700;
  --text: #e8e8f0;
  --muted: #8888aa;
  --font-head: 'Syne', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background grid effect */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124,92,252,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,92,252,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 3rem;
  background: rgba(10,10,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--cyan);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,230,118,0.1);
  border: 1px solid rgba(0,230,118,0.3);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--green);
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
}
.dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

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

.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), #5a3fd8);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px rgba(124,92,252,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(124,92,252,0.6);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-head);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--purple);
  background: rgba(124,92,252,0.1);
}

/* ===== STATS GRID ===== */
.stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--purple);
}

.stat-icon {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.stat-change {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--green);
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}
.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}
.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ===== FEATURES ===== */
.features {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto 5rem;
  padding: 0 2rem;
  text-align: center;
}
.features h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
}
.f-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ===== CTA ===== */
.cta-section {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(124,92,252,0.1), rgba(0,212,255,0.05));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.cta-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.cta-section p { color: var(--muted); margin-bottom: 2rem; }

/* ===== SCANNER PAGE ===== */
.scanner-section {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.scanner-header {
  text-align: center;
  margin-bottom: 3rem;
}
.scanner-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.scanner-header p { color: var(--muted); }

.scanner-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.scanner-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.lang-select {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  flex: 1;
}
.lang-select:focus { border-color: var(--purple); }

.code-input {
  width: 100%;
  height: 320px;
  background: var(--bg);
  color: var(--cyan);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}
.code-input:focus { border-color: var(--purple); }
.code-input::placeholder { color: var(--muted); }

.scan-btn {
  width: 100%;
  justify-content: center;
  padding: 16px;
  font-size: 1.1rem;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 2rem;
}
.loading.hidden { display: none; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; }

/* ===== SAMPLES ===== */
.samples { text-align: center; }
.samples-title {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.samples-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.sample-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.sample-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,212,255,0.05);
}

/* ===== RESULTS PAGE ===== */
.results-section {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.results-header h1 { font-size: 2rem; font-weight: 800; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
}
.critical-card { border-left: 4px solid var(--red); }
.warning-card { border-left: 4px solid var(--yellow); }
.info-card { border-left: 4px solid var(--cyan); }
.time-card { border-left: 4px solid var(--purple); }

.s-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 0.3rem;
}
.s-label { color: var(--muted); font-size: 0.8rem; }

/* ===== BUG CARDS ===== */
.results-list { margin-bottom: 3rem; }

.bug-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--border);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.bug-card.critical { border-left-color: var(--red); }
.bug-card.warning { border-left-color: var(--yellow); }
.bug-card.info { border-left-color: var(--cyan); }

.bug-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.bug-severity {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.severity-critical { background: rgba(255,71,87,0.15); color: var(--red); }
.severity-warning { background: rgba(255,215,0,0.15); color: var(--yellow); }
.severity-info { background: rgba(0,212,255,0.15); color: var(--cyan); }

.bug-title { font-size: 1rem; font-weight: 700; }
.bug-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.6; margin-bottom: 1rem; }

.bug-fix {
  background: rgba(0,230,118,0.05);
  border: 1px solid rgba(0,230,118,0.2);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.bug-fix-title {
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}
.bug-fix p { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }

.no-results {
  text-align: center;
  padding: 4rem;
  color: var(--muted);
}
.no-results p { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ===== HISTORY ===== */
.history-section { }
.history-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }

.history-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.history-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.history-row:hover { background: var(--card2); }
.history-row:last-child { border-bottom: none; }
.history-row .h-lang { color: var(--muted); font-family: var(--font-mono); }
.history-row .h-bugs { color: var(--red); font-weight: 700; }
.history-row .h-time { color: var(--muted); }

.no-history { padding: 2rem; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--purple); text-decoration: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 1rem 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 2rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
}
