/* ============================================================
   LUCID DDoS Simulator — stylesheet
   Aesthetic: Clean dark / minimal / developer-focused
   Fonts: Geist (display) + Geist Mono (code/data)
   ============================================================ */

:root {
  --bg:        #0a0a0a;
  --bg-panel:  #111111;
  --bg-card:   #1a1a1a;
  --bg-hover:  #252525;
  --border:    rgba(255,255,255,0.08);
  --border-hi: rgba(255,255,255,0.18);
  --accent:    #3080ff;
  --accent-2:  #54a2ff;
  --danger:    #e06c75;
  --warn:      #dea123;
  --blue:      #54a2ff;
  --green:     #00c758;
  --text:      #ededed;
  --text-dim:  #888888;
  --text-muted:#555555;
  --mono:      'Geist Mono Variable', 'Geist Mono', monospace;
  --display:   'Geist Variable', 'Geist', sans-serif;
}

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

html { scroll-behavior: smooth; background: var(--bg); }

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

/* ---- Background grid (Bonsplit-style) ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right,  rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black 0%, black 42%, transparent 55%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 42%, transparent 55%);
}

/* ---- Scan-line sweep ---- */
.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(48,128,255,0.0) 10%,
    rgba(48,128,255,0.5) 50%,
    rgba(48,128,255,0.0) 90%,
    transparent 100%
  );
  box-shadow: 0 0 8px 2px rgba(48,128,255,0.25);
  pointer-events: none;
  z-index: 50;
  animation: scanline 9s linear infinite;
  will-change: transform;
}
@keyframes scanline {
  0%   { transform: translateY(-2px); opacity: 0; }
  4%   { opacity: 1; }
  96%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-icon {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.logo-text {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .04em;
}
.logo-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: .06em;
  margin-left: 2px;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.header-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  transition: color .2s;
}
.header-nav a:hover { color: var(--accent); }
.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
}
.nav-cta:hover { background: rgba(255,255,255,0.06) !important; border-color: var(--border-hi) !important; }

/* ---- Hero ---- */
.hero {
  position: relative;
  z-index: 2;
  padding: 5rem 2rem 5rem;
  max-width: 1280px;
  margin: 0 auto;
}
.hero-inner { max-width: 700px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .04em;
  background: rgba(48,128,255,0.15);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .8;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* .hero-title replaced by #title-art block-art renderer in index.html */
.hero-accent { color: var(--accent); }

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 540px;
  margin-bottom: 2rem;
  font-family: var(--mono);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .01em;
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity .2s, transform .1s;
}
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-ghost {
  display: inline-block;
  color: var(--text-dim);
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .01em;
  padding: 10px 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.hstat {
  display: flex;
  flex-direction: column;
  padding: 0 24px;
}
.hstat:first-child { padding-left: 0; }
.hstat-n {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.hstat-l {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: .04em;
}
.hstat-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ---- Section commons ---- */
.sim-section, .about-section, .results-section {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: .75rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: .75rem;
  letter-spacing: -.02em;
}
.section-desc {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* ---- Simulator Layout ---- */
.sim-layout {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-center { order: -1; }
}

/* ---- Control Panel ---- */
.ctrl-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.panel-header {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-icon { font-size: 13px; }

.ctrl-group { margin-bottom: 1.1rem; }
.ctrl-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  letter-spacing: .04em;
}
.ctrl-val-display {
  color: var(--accent);
  font-weight: 700;
}

/* Segmented control */
.seg-ctrl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  background: rgba(255,255,255,0.03);
  border-radius: 7px;
  padding: 3px;
}
.seg-btn {
  padding: 6px 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg-card); color: var(--accent); }

/* Custom slider */
.slider-wrap { position: relative; }
.custom-slider {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  outline: none;
  cursor: pointer;
}
.custom-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,255,170,.5);
}
.custom-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Select */
.custom-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  outline: none;
}
.custom-select:focus { border-color: var(--border-hi); }

/* Command preview */
.cmd-preview {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
}
.cmd-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.cmd-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  word-break: break-all;
  line-height: 1.5;
}

/* Buttons */
.ctrl-buttons { display: flex; gap: 8px; margin-bottom: 1rem; }
.btn-launch, .btn-stop {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  border: 1px solid;
  transition: all .15s;
}
.btn-launch {
  background: rgba(48,128,255,0.12);
  border-color: rgba(48,128,255,0.35);
  color: var(--accent);
}
.btn-launch:hover:not(:disabled) { background: rgba(48,128,255,0.22); }
.btn-stop {
  background: rgba(255,68,68,0.08);
  border-color: rgba(255,68,68,0.3);
  color: #ff6666;
}
.btn-stop:hover:not(:disabled) { background: rgba(255,68,68,0.15); }
.btn-launch:disabled, .btn-stop:disabled { opacity: .35; cursor: default; }
.btn-icon { font-size: 10px; }

/* Status row */
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
}
.status-dot-wrap {
  width: 8px; height: 8px;
  position: relative;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background .3s;
}
.status-text { color: var(--text-dim); flex: 1; }
.status-time { color: var(--text-muted); }
.status-dot.active {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
  animation: blink .8s infinite;
}
.status-dot.done { background: var(--green); box-shadow: 0 0 6px var(--green); animation: none; }

/* ---- Topology Canvas ---- */
.sim-center {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.topo-canvas {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 340px;
  position: relative;
  overflow: hidden;
}

/* SVG styles */
.topo-node rect, .topo-node .diamond-fill {
  fill: var(--bg-card);
  stroke: var(--border);
  stroke-width: 1;
  transition: stroke .3s, fill .3s;
}
.topo-node.attacker rect { stroke: rgba(255,68,68,.3); }
.topo-node.router .diamond-fill { stroke: rgba(255,136,0,.35); }
.topo-node.victim rect { stroke: rgba(0,212,255,.3); }
.topo-node.lucid rect { stroke: rgba(0,255,170,.3); }

.topo-node.lit-red rect  { stroke: var(--danger)!important; fill: rgba(255,68,68,.08)!important; }
.topo-node.lit-green rect { stroke: var(--green)!important; fill: rgba(0,221,136,.06)!important; }
.topo-node.lit-green .diamond-fill { stroke: var(--green)!important; fill: rgba(0,221,136,.06)!important; }

.node-title {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  fill: var(--text);
  letter-spacing: .08em;
}
.node-sub {
  font-family: var(--mono);
  font-size: 8px;
  fill: var(--text-dim);
}
.node-ip {
  font-family: var(--mono);
  font-size: 7px;
  fill: var(--text-muted);
}
.zone-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  font-weight: 700;
  opacity: .6;
}

/* ---- Metrics strip ---- */
.metrics-strip {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.mstripe-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ms-val {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.ms-val.danger { color: var(--danger); }
.ms-val.success { color: var(--green); }
.ms-val.warn { color: var(--warn); }
.ms-lbl {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}
.mstripe-sep {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* ---- Right panels ---- */
.sim-right { display: flex; flex-direction: column; gap: 1rem; }
.right-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

/* Metric bars */
.metric-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mbar-row { display: flex; align-items: center; gap: 8px; }
.mbar-lbl {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  min-width: 56px;
}
.mbar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.mbar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}
.mbar-fill.blue   { background: var(--blue); }
.mbar-fill.green  { background: var(--green); }
.mbar-fill.teal   { background: var(--accent); }
.mbar-fill.red    { background: var(--danger); }
.mbar-fill.orange { background: var(--warn); }
.mbar-val {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  min-width: 38px;
  text-align: right;
}

.threshold-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.thr-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}
.thr-status {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: .06em;
}
.thr-status.inactive {
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.thr-status.triggered {
  color: var(--danger);
  background: rgba(255,68,68,.1);
  border: 1px solid rgba(255,68,68,.3);
  animation: blink .6s infinite;
}

/* Chart */
.chart-panel .panel-header { margin-bottom: 10px; }
.chart-wrap { position: relative; height: 110px; }

/* Log */
.log-panel .panel-header {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  letter-spacing: .04em;
}
.clear-btn:hover { color: var(--text-dim); }
.log-scroll {
  height: 160px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
}
.log-scroll::-webkit-scrollbar { width: 3px; }
.log-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.log-entry { padding: 1px 0; }
.log-entry.atk   { color: var(--danger); }
.log-entry.det   { color: var(--green); }
.log-entry.warn  { color: var(--warn); }
.log-entry.info  { color: var(--accent-2); }

/* ---- About Section ---- */
.about-section {
  border-top: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0;
}
.about-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color .2s;
}
.about-card:hover { border-color: var(--border-hi); }
.about-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: .6;
  line-height: 1;
  margin-bottom: .75rem;
}
.about-card h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .5rem;
}
.about-card p {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
}
.about-card em { color: var(--accent); font-style: normal; }

/* ---- Results Section ---- */
.results-section {
  border-top: 1px solid var(--border);
}
.results-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
}
.rtab {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.rtab:hover { color: var(--text); border-color: var(--border-hi); }
.rtab.active {
  background: rgba(48,128,255,.1);
  border-color: rgba(48,128,255,0.35);
  color: var(--accent);
}
.results-table-wrap { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.results-table th {
  padding: 10px 14px;
  text-align: left;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  letter-spacing: .04em;
  font-size: 11px;
}
.results-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(0,255,170,.05);
  color: var(--text);
}
.results-table tr:hover td { background: rgba(255,255,255,0.04); }
.row-head td {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
  font-weight: 600;
}
.results-table td.good { color: var(--green); font-weight: 700; }
.results-table td.mid  { color: var(--accent-2); }
.results-table td.bad  { color: var(--danger); }
.hidden { display: none; }

/* ---- Footer ---- */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: rgba(255,255,255,0.015);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-left .logo { margin-bottom: 1rem; }
.footer-left p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 340px;
}
.footer-links { display: flex; gap: 3rem; }
.flink-col { display: flex; flex-direction: column; gap: 8px; }
.flink-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.flink-col a, .flink-col span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s;
}
.flink-col a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center;
  padding: 1rem 2rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .header-nav a:not(.nav-cta) { display: none; }
  .hero { padding: 4rem 1.25rem 3rem; }
  .hstat { padding: 0 12px; }
  .sim-section, .about-section, .results-section { padding: 3rem 1.25rem; }
  .metrics-strip { gap: 8px; }
}
