/* =========================================================
   NeuroPredict – stylesheet
   Dark dashboard theme. Colours are kept in CSS variables so
   the whole look can be changed from one place.
   ========================================================= */
:root {
  --bg: #0b1020;
  --bg-2: #111832;
  --card: #151d3b;
  --card-2: #1b2550;
  --line: #26315f;
  --text: #e8ecff;
  --muted: #9aa6d1;
  --accent: #5b8cff;      /* blue  – main accent / positive weights */
  --accent-2: #22d3ee;    /* cyan  – activations */
  --pink: #f472b6;        /* pink  – negative weights / backprop */
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, #1b2a6b 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 30%, #0f3a4f 0%, transparent 55%),
              var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
code, .mono { font-family: var(--mono); }

/* ---------------- Navigation ---------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
  background: rgba(11, 16, 32, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); }
.brand-logo { width: 34px; height: 34px; }
.brand span b { color: var(--accent-2); }
.nav-links { display: flex; gap: 4px; list-style: none; flex-wrap: wrap; }
.nav-links a {
  padding: 8px 12px; border-radius: 10px; color: var(--muted);
  font-size: .92rem; font-weight: 500; transition: .2s;
}
.nav-links a:hover { color: var(--text); background: var(--card); }
.nav-links a.active { color: #fff; background: var(--accent); }
.nav-status { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 1.1rem; cursor: pointer; }

/* ---------------- Layout ---------------- */
main { max-width: 1220px; margin: 0 auto; padding: 28px 24px 60px; }
.page { display: none; animation: fadeUp .45s ease; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); max-width: 760px; }
.eyebrow { color: var(--accent-2); font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }

.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }

.card {
  background: linear-gradient(180deg, var(--card) 0%, #131a36 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .94rem; }
.card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.card-title h3 { margin: 0; }
.hint { font-size: .8rem; color: var(--muted); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 18px; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
  font-family: inherit; color: #fff; background: var(--card-2);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #7c5cff); box-shadow: 0 6px 18px rgba(91, 140, 255, .35); }
.btn-cyan { background: linear-gradient(135deg, #0ea5b7, var(--accent-2)); color: #04212a; }
.btn-danger { background: #3a1830; border-color: #6b2448; color: #ffc2d9; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Home ---------------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding: 30px 0 10px; }
.hero h1 { font-size: 3.2rem; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .tagline { font-size: 1.25rem; color: var(--accent-2); margin: 10px 0 14px; font-weight: 600; }
.hero p.lead { color: var(--muted); font-size: 1.04rem; margin-bottom: 22px; max-width: 560px; }
.hero-visual { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.section-title { font-size: 1.35rem; margin: 38px 0 14px; font-weight: 700; }
.feature .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(91, 140, 255, .14); color: var(--accent); font-size: 1.3rem; margin-bottom: 10px; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 52px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 18px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}

/* ---------------- Stats ---------------- */
.stat .label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font-size: 1.9rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: .82rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge.untrained { background: #2a2f4a; color: var(--muted); }
.badge.training { background: rgba(251, 191, 36, .16); color: var(--amber); }
.badge.trained { background: rgba(52, 211, 153, .16); color: var(--green); }
.badge.stopped { background: rgba(244, 114, 182, .16); color: var(--pink); }
.badge.offline { background: rgba(248, 113, 113, .16); color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
td.num { font-family: var(--mono); }
.ok-text { color: var(--green); font-weight: 700; }
.bad-text { color: var(--red); font-weight: 700; }

/* ---------------- Network SVG ---------------- */
.net-svg { width: 100%; height: auto; display: block; }
.net-svg .edge { transition: stroke-width .25s, stroke .25s, opacity .25s; }
.net-svg .node circle.body { stroke-width: 2.5; transition: fill .3s; }
.net-svg text { fill: var(--text); font-family: var(--font); }
.net-svg .layer-label { fill: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.net-svg .val { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.net-svg .bias { fill: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.net-svg .wlabel { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.net-svg .bias, .net-svg .wlabel { paint-order: stroke; stroke: #131a36; stroke-width: 4px; stroke-linejoin: round; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 22px; height: 4px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.training-glow { animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 6px rgba(34, 211, 238, .8)); } }

.input-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.input-pick button { font-family: var(--mono); }
.input-pick button.sel { background: var(--accent); }

/* ---------------- Forms / simulator ---------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
select, input[type=number] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: .95rem; font-family: inherit;
}
select:focus, input:focus { outline: 2px solid var(--accent); }
.progress { height: 12px; background: var(--bg-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.log { font-family: var(--mono); font-size: .8rem; color: var(--muted); max-height: 170px; overflow: auto; background: var(--bg-2); border-radius: 10px; padding: 10px; border: 1px solid var(--line); }
.log div { padding: 2px 0; }
.log .t { color: var(--accent-2); }

/* ---------------- Prediction ---------------- */
.bit-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bit-toggle button { width: 64px; height: 54px; font-size: 1.4rem; font-family: var(--mono); font-weight: 700; background: var(--bg-2); color: var(--muted); border: 0; cursor: pointer; transition: .2s; }
.bit-toggle button.on { background: var(--accent); color: #fff; }
.result-big { font-size: 3.4rem; font-weight: 800; font-family: var(--mono); line-height: 1; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; font-size: .95rem; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { font-family: var(--mono); font-weight: 700; text-align: right; }
.conf-bar { height: 14px; border-radius: 99px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); margin-top: 6px; }
.conf-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--amber), var(--green)); transition: width .5s; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: .9rem; border: 1px solid; margin-bottom: 14px; }
.notice.warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .4); color: #fde68a; }
.notice.err { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .4); color: #fecaca; }
.notice.info { background: rgba(91, 140, 255, .08); border-color: rgba(91, 140, 255, .4); color: #c7d6ff; }
.hidden { display: none !important; }

/* ---------------- Graph boxes ---------------- */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 220px; }
.ring { width: 170px; height: 170px; margin: 8px auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent-2) calc(var(--p, 0) * 1%), var(--bg-2) 0); transition: background .3s; }
.ring > div { width: 130px; height: 130px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; }

/* ---------------- Learning centre ---------------- */
.topic { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 10px; overflow: hidden; }
.topic summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 12px; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary .n { width: 30px; height: 30px; border-radius: 9px; background: rgba(91, 140, 255, .16); color: var(--accent); display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.topic summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.3rem; transition: transform .2s; }
.topic[open] summary::after { transform: rotate(45deg); }
.topic .body { padding: 0 18px 18px 60px; color: var(--muted); }
.topic .body p { margin-bottom: 8px; }
.topic .body .example { background: var(--bg-2); border-left: 3px solid var(--accent-2); padding: 10px 14px; border-radius: 8px; margin: 10px 0; color: var(--text); font-size: .92rem; }
.topic .body svg { max-width: 460px; width: 100%; height: auto; margin-top: 6px; }
.formula { font-family: var(--mono); background: var(--bg-2); padding: 6px 10px; border-radius: 8px; color: var(--accent-2); display: inline-block; margin: 4px 0; }

/* ---------------- About ---------------- */
.placeholder { color: var(--amber); font-style: italic; }
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-list span { background: var(--bg-2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 99px; font-size: .85rem; }

footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 26px; border-top: 1px solid var(--line); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1050px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .nav-status { display: none; }
}
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav-links { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); padding: 10px; border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero h1 { font-size: 2.4rem; }
  main { padding: 18px 14px 40px; }
  .topic .body { padding-left: 18px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .navbar { padding: 12px 16px; }
}
