/* ═══════════════════════════════════════════════
   sim-styles.css  —  Disk Scheduling Simulator
   Themed to match v6 concept page
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,600;1,600&family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --bg:      #0b0c10;
  --s1:      #11121a;
  --s2:      #181925;
  --s3:      #1e2030;
  --border:  #262840;
  --border2: #343660;
  --accent:  #5b8dee;
  --accent2: #8db4f5;
  --orange:  #f07b3f;
  --teal:    #38d9a9;
  --red:     #ff6b6b;
  --yellow:  #ffd43b;
  --text:    #e4e6f0;
  --muted:   #5a5d7a;
  --serif:   'Lora', Georgia, serif;
  --mono:    'DM Mono', monospace;
  --sans:    'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
}

/* ── NAV ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11,12,16,0.92);
  backdrop-filter: blur(8px);
  z-index: 100;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--accent2); }

/* ── LAYOUT ── */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 1rem; }
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(91,141,238,0.3);
  background: rgba(91,141,238,0.08);
  padding: 3px 12px;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}
.page-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.page-title em { font-style: italic; color: var(--accent2); }
.page-lead {
  font-size: 1.05rem;
  color: #8a8db0;
  font-weight: 300;
  max-width: 500px;
}

/* ── CARDS ── */
.sim-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

/* ── CONTROLS ── */
.controls-row1 {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.controls-row2 {
  display: grid;
  grid-template-columns: 130px 130px 160px 1fr;
  gap: 1rem;
  align-items: end;
}
@media (max-width: 640px) {
  .controls-row2 { grid-template-columns: 1fr 1fr; }
  .btn-group     { grid-column: span 2; }
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-hint { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.field-input {
  background: var(--s2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.field-input:focus { border-color: var(--accent); }
.field-select { appearance: none; cursor: pointer; }
.field-select option { background: var(--s2); }

.run-btn {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
  width: 80%;
  justify-content: center;
}
.run-btn:hover { background: #4a7bde; transform: translateY(-1px); }
.run-btn:active { transform: translateY(0); }

.run-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text);
}
.run-btn-ghost:hover:not(:disabled) { background: var(--s2); border-color: var(--accent); color: var(--accent2); transform: translateY(-1px); }
.run-btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.run-btn-ghost.running { border-color: var(--orange); color: var(--orange); }

/* ── STAT ROW ── */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.stat-item {
  background: var(--s1);
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-val {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--teal);
  line-height: 1;
}
.stat-algo { font-size: 1.4rem; color: var(--accent2); }
.stat-unit { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ── CHART ── */
.chart-card { padding: 1.25rem; }
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.chart-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.chart-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.chart-wrap {
  position: relative;
  height: 400px;
  background: var(--s2);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── TABLE ── */
.table-card { padding: 1.5rem; overflow-x: auto; }
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 480px;
}
.calc-table th {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border2);
}
.calc-table th.right { text-align: right; }
.calc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(38,40,64,0.5);
  color: #9090b0;
  font-family: var(--mono);
  font-size: 12px;
  vertical-align: middle;
}
.calc-table tr:last-child td { border-bottom: none; }
.calc-table tr:hover td { background: rgba(91,141,238,0.03); }
.calc-table td.step-num { color: var(--muted); }
.calc-table td.path     { color: var(--text); font-weight: 500; }
.calc-table td.calc     { color: var(--muted); }
.calc-table td.dist     { color: var(--orange); font-weight: 500; text-align: right; }
.calc-table tr.total-row td {
  border-top: 2px solid var(--border2);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.calc-table td.total-label { color: var(--text); font-weight: 600; font-size: 13px; }
.calc-table td.total-sum   { color: var(--muted); font-size: 11px; line-height: 1.8; }
.calc-table td.total-val   {
  color: var(--teal);
  font-size: 1.6rem;
  font-weight: 500;
  text-align: right;
  text-shadow: 0 0 20px rgba(56,217,169,0.4);
}

/* ── UTILS ── */
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* ── FOOTER ── */
.sim-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}
.sim-footer p {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
