/* ── CyberCube – styles.css ───────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:           #070b12;
  --bg-2:         #0d1421;
  --bg-3:         #111927;
  --glass:        rgba(13, 20, 33, 0.7);
  --glass-border: rgba(0, 230, 255, 0.12);
  --accent:       #00e6ff;
  --accent-glow:  rgba(0, 230, 255, 0.25);
  --accent-2:     #7b61ff;
  --critical:     #ff2d55;
  --critical-bg:  rgba(255, 45, 85, 0.1);
  --high:         #ff6b35;
  --high-bg:      rgba(255, 107, 53, 0.1);
  --medium:       #ffd60a;
  --medium-bg:    rgba(255, 214, 10, 0.1);
  --low:          #34c759;
  --low-bg:       rgba(52, 199, 89, 0.1);
  --text:         #e8eaf0;
  --text-muted:   #6b7a99;
  --text-dim:     #3d4d6b;
  --green:        #00ff88;
  --radius:       14px;
  --radius-sm:    8px;
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ── Particle canvas ── */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Navbar ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(7, 11, 18, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--accent-glow);
}
.nav-logo-text {
  font-size: 1.15rem; font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--accent); }

.nav-badge {
  background: var(--accent-glow); border: 1px solid rgba(0,230,255,0.3);
  color: var(--accent); padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
}

/* ── Main wrapper ── */
main {
  position: relative; z-index: 1;
  padding-top: 64px;
  max-width: 1100px; margin: 0 auto;
  padding-left: 1.5rem; padding-right: 1.5rem;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--critical-bg); border: 1px solid rgba(255,45,85,0.25);
  color: var(--critical); border-radius: 20px;
  padding: 5px 14px; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.5px; margin-bottom: 1.5rem;
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,45,85,0); }
  50%       { box-shadow: 0 0 0 6px rgba(255,45,85,0); }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 1.2rem;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 580px; margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-features {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  justify-content: center; margin-bottom: 2rem;
}
.hero-feature-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.82rem; color: var(--text-muted);
}
.hero-feature-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent);
}

/* ── Upload Zone ── */
#upload-section { margin-bottom: 3rem; }

.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--glass);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.upload-zone::before {
  content: '';
  position: absolute; inset: -2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--critical), var(--accent));
  background-size: 300% 300%;
  border-radius: var(--radius);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition);
  animation: grad-spin 4s linear infinite;
}
@keyframes grad-spin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.upload-zone.dragover { border-color: var(--accent); background: rgba(0,230,255,0.05); }
.upload-zone.dragover::before { opacity: 1; }

.upload-icon {
  font-size: 3rem; margin-bottom: 1rem;
  filter: drop-shadow(0 0 16px var(--accent));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.upload-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem;
}
.upload-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.upload-types {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.type-badge {
  background: var(--bg-3); border: 1px solid var(--glass-border);
  color: var(--accent); padding: 3px 10px; border-radius: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;
}

/* Scan button */
#scan-btn {
  display: none;
  margin: 1.5rem auto 0;
  gap: 10px; align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000; border: none; border-radius: var(--radius-sm);
  padding: 13px 32px; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  box-shadow: 0 0 30px var(--accent-glow);
  font-family: 'Inter', sans-serif;
}
#scan-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 40px var(--accent-glow); }
#scan-btn.show { display: flex; }

.file-selected-info {
  display: none;
  margin-top: 1rem; align-items: center; justify-content: center; gap: 10px;
  color: var(--accent); font-size: 0.9rem; font-weight: 500;
}
.file-selected-info.show { display: flex; }
.file-icon { font-size: 1.1rem; }

/* ── Terminal ── */
#terminal-section {
  margin-bottom: 3rem; display: none;
  animation: slide-up 0.4s ease;
}
#terminal-section.show { display: block; }

.terminal-header {
  display: flex; align-items: center; gap: 8px;
  background: #0a0e16; border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 16px; border: 1px solid var(--glass-border); border-bottom: none;
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red   { background: #ff5f57; }
.term-dot.yellow{ background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-title { color: var(--text-muted); font-size: 0.8rem; margin-left: auto;
  font-family: 'JetBrains Mono', monospace; }

.terminal-body {
  background: #05080f;
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  line-height: 1.75;
}
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

.term-line { display: flex; gap: 10px; }
.term-line.cmd { color: var(--green); }
.term-line.info { color: var(--accent); }
.term-line.warn { color: var(--medium); }
.term-line.success { color: #00ff88; }
.term-line.header { color: #fff; font-weight: 700; }
.term-line.dim { color: var(--text-dim); }

.cursor {
  display: inline-block; width: 8px; height: 1em;
  background: var(--green); margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Results ── */
#results-section {
  display: none;
  animation: slide-up 0.5s ease;
}
#results-section.show { display: block; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 18px 20px;
  text-align: center; transition: transform var(--transition);
  backdrop-filter: blur(12px);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card.critical { border-color: rgba(255,45,85,0.3); background: var(--critical-bg); }
.stat-card.high     { border-color: rgba(255,107,53,0.3); background: var(--high-bg); }
.stat-card.medium   { border-color: rgba(255,214,10,0.3); background: var(--medium-bg); }
.stat-card.low      { border-color: rgba(52,199,89,0.3);  background: var(--low-bg); }

.stat-number {
  font-size: 2.2rem; font-weight: 800; line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}
.stat-card.critical .stat-number { color: var(--critical); text-shadow: 0 0 20px rgba(255,45,85,0.5); }
.stat-card.high     .stat-number { color: var(--high);     text-shadow: 0 0 20px rgba(255,107,53,0.5); }
.stat-card.medium   .stat-number { color: var(--medium);   text-shadow: 0 0 20px rgba(255,214,10,0.5); }
.stat-card.low      .stat-number { color: var(--low);      text-shadow: 0 0 20px rgba(52,199,89,0.5); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }

/* Section header */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-hdr h2 { font-size: 1.25rem; font-weight: 700; }
.section-hdr span { color: var(--text-muted); font-size: 0.85rem; }

/* Export button */
#export-btn {
  background: var(--bg-2); border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 7px 16px; font-size: 0.82rem; cursor: pointer;
  transition: all var(--transition); font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 6px;
}
#export-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Finding cards */
.findings-list { display: flex; flex-direction: column; gap: 0.75rem; }

.finding-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
  animation: slide-up 0.4s ease both;
}
.finding-card:nth-child(1) { animation-delay: 0.05s; }
.finding-card:nth-child(2) { animation-delay: 0.1s; }
.finding-card:nth-child(3) { animation-delay: 0.15s; }
.finding-card:nth-child(4) { animation-delay: 0.2s; }
.finding-card:nth-child(5) { animation-delay: 0.25s; }
.finding-card:nth-child(n+6) { animation-delay: 0.3s; }

.finding-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.finding-card.critical { border-left: 3px solid var(--critical); }
.finding-card.high     { border-left: 3px solid var(--high); }
.finding-card.medium   { border-left: 3px solid var(--medium); }
.finding-card.low      { border-left: 3px solid var(--low); }

.finding-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; user-select: none;
}
.finding-header:hover { background: rgba(255,255,255,0.02); }

.sev-badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 4px; flex-shrink: 0;
  text-transform: uppercase;
}
.sev-badge.Critical { background: rgba(255,45,85,0.2);  color: var(--critical);  border: 1px solid rgba(255,45,85,0.3); }
.sev-badge.High     { background: rgba(255,107,53,0.2); color: var(--high);      border: 1px solid rgba(255,107,53,0.3); }
.sev-badge.Medium   { background: rgba(255,214,10,0.2); color: var(--medium);    border: 1px solid rgba(255,214,10,0.3); }
.sev-badge.Low      { background: rgba(52,199,89,0.2);  color: var(--low);       border: 1px solid rgba(52,199,89,0.3); }

.finding-id { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; }
.finding-title { font-weight: 600; font-size: 0.92rem; flex: 1; }
.finding-count { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.finding-chevron { color: var(--text-dim); transition: transform var(--transition); font-size: 0.9rem; margin-left: 4px; }
.finding-card.open .finding-chevron { transform: rotate(180deg); }

.finding-body {
  border-top: 1px solid var(--glass-border);
  padding: 18px 18px 20px;
  display: none;
}
.finding-card.open .finding-body { display: block; }

.finding-desc { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.88rem; line-height: 1.7; }

.finding-occurrences { margin-bottom: 1rem; }
.finding-occurrences h4 { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.6rem; }

.occurrence-item {
  background: #05080f; border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
}
.occurrence-line { color: var(--accent); font-size: 0.72rem; margin-bottom: 4px; }
.occurrence-snippet { color: #7ec8e3; white-space: pre-wrap; word-break: break-all; }

.remediation-block {
  background: rgba(0,230,255,0.04); border: 1px solid rgba(0,230,255,0.12);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.remediation-block h4 {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 0.5rem;
}
.remediation-block p { font-size: 0.87rem; color: var(--text-muted); line-height: 1.7; }

/* Tags */
.finding-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.85rem; }
.finding-tag {
  background: var(--bg-3); border: 1px solid var(--glass-border);
  color: var(--text-dim); padding: 2px 8px; border-radius: 4px;
  font-size: 0.7rem; font-family: 'JetBrains Mono', monospace;
}

/* Empty state */
.empty-results {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-results h3 { font-size: 1.2rem; color: var(--low); margin-bottom: 0.5rem; }

/* Re-scan button */
#rescan-btn {
  display: block; margin: 2rem auto 0;
  background: transparent; border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 10px 24px; font-size: 0.88rem; cursor: pointer;
  transition: all var(--transition); font-family: 'Inter', sans-serif;
}
#rescan-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,230,255,0.05); }

/* ── Footer ── */
footer {
  position: relative; z-index: 1;
  text-align: center; padding: 3rem 1rem;
  color: var(--text-dim); font-size: 0.82rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 4rem;
}
footer span { color: var(--accent); }

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

/* ── Responsive ── */
@media (max-width: 700px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 1rem; }
  .hero { padding: 60px 0 40px; }
  .finding-header { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .nav-links a:not(.nav-badge) { display: none; }
}
