/* ═══════════════════════════════════════════════════════════
   FIRMWARE UPDATE GUIDE — style.css
   Thème ambre industriel  •  IBM Plex
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --accent:  #F59E0B;
  --accent2: #FCD34D;
  --bg:      #07090e;
  --bg2:     #0d1117;
  --bg3:     #111827;
  --surface: #141b24;
  --surface2:#1c2536;
  --border:  #1f2d3d;
  --border2: #2a3f55;
  --text:    #e2eaf5;
  --text2:   #7a9ab5;
  --text3:   #3a5472;
  --ok:      #22c55e;
  --warn:    #f59e0b;
  --danger:  #ef4444;
  --info:    #38bdf8;
  --font:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:'IBM Plex Mono', monospace;
  /* vendor colors */
  --cisco:   #1ba0d7;
  --hp:      #0096D6;
  --juniper: #84a100;
  --fortinet:#ee0000;
  --paloalto:#fa582d;
  --arista:  #00b0e8;
  --extreme: #6a0dad;
  --all:     #F59E0B;
}
[data-theme="light"] {
  --bg:      #f5f7fa;
  --bg2:     #ffffff;
  --bg3:     #eef1f6;
  --surface: #ffffff;
  --surface2:#f0f4f8;
  --border:  #d4dde8;
  --border2: #bfcbda;
  --text:    #0e1929;
  --text2:   #4a6580;
  --text3:   #8aa0b5;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%; z-index: 1000;
  transition: width .15s;
}

/* ── Layout ── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
#sidebar {
  width: 280px; min-width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  transition: transform .25s;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #000; flex-shrink: 0;
  font-family: var(--font-mono);
}
.logo-text { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.2; }
.logo-text accent { color: var(--accent); font-style: normal; }

/* Search */
.search-wrap { padding: 14px 14px 0; position: relative; }
.search-wrap input {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px; padding: 8px 12px;
  color: var(--text); font-family: var(--font-mono);
  font-size: 12px; outline: none;
  transition: border-color .2s;
}
.search-wrap input:focus { border-color: var(--accent); }
#search-results {
  display: none; position: absolute; left: 14px; right: 14px; top: 100%;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 6px; z-index: 200; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#search-results.open { display: block; }
.search-item {
  padding: 9px 14px; font-size: 12px; cursor: pointer;
  color: var(--text2); display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface2); color: var(--text); }
.search-item strong {
  font-family: var(--font-mono); font-size: 10px; color: var(--accent);
  background: rgba(245,158,11,.12); padding: 1px 5px; border-radius: 3px;
  flex-shrink: 0;
}

/* Nav sections */
.nav-section { padding: 14px 14px 0; }
.nav-section-title {
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text3); font-weight: 600; padding: 0 4px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 6px; margin-bottom: 1px;
  color: var(--text2); font-size: 12.5px; cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: rgba(245,158,11,.12); color: var(--accent); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 9px;
  background: var(--surface2); color: var(--text3);
  padding: 1px 5px; border-radius: 9px; font-family: var(--font-mono);
}
.nav-item.active .nav-badge { background: rgba(245,158,11,.2); color: var(--accent); }

/* ── Main content ── */
#main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ── Topbar ── */
#topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg2); position: sticky; top: 0; z-index: 100;
}
#hamburger {
  display: none; background: none; border: none;
  color: var(--text2); cursor: pointer; font-size: 18px; padding: 4px;
}
.topbar-title { font-size: 13px; color: var(--text2); flex: 1; }
#theme-toggle {
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text2); border-radius: 5px; padding: 5px 10px;
  cursor: pointer; font-size: 14px; transition: border-color .2s;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── Chapter ── */
.chapter { max-width: 900px; margin: 0 auto; padding: 32px 28px 64px; }

.ch-hero { margin-bottom: 32px; }
.ch-eyebrow {
  font-size: 11px; font-family: var(--font-mono);
  color: var(--accent); text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 8px;
}
.chapter h1 {
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  margin-bottom: 14px; color: var(--text);
}
.ch-hero p { color: var(--text2); font-size: 15px; max-width: 700px; line-height: 1.7; }

.chapter h2 {
  font-size: 1.05rem; font-weight: 700; margin: 36px 0 14px;
  color: var(--text); display: flex; align-items: center; gap: 10px;
}
.h2-tag {
  font-size: 9.5px; font-family: var(--font-mono); font-weight: 600;
  background: rgba(245,158,11,.12); color: var(--accent);
  padding: 2px 7px; border-radius: 4px; letter-spacing: .06em;
}
.chapter h3 { font-size: .95rem; font-weight: 600; color: var(--text); margin: 20px 0 10px; }
.chapter h4 { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.chapter p { color: var(--text2); line-height: 1.7; margin-bottom: 10px; }

/* Vendor badge */
.vendor-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-family: var(--font-mono); font-weight: 600;
  padding: 4px 10px; border-radius: 20px; margin-bottom: 12px;
  background: rgba(var(--vc-rgb, 27,160,215), .1);
  color: var(--vc, var(--cisco));
  border: 1px solid rgba(var(--vc-rgb, 27,160,215), .25);
}

/* Version matrix */
.ver-matrix {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 0 0 28px;
}
.ver-card {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 8px; padding: 12px 16px; min-width: 170px;
}
.ver-label { font-size: 10px; font-family: var(--font-mono); color: var(--text3); margin-bottom: 4px; }
.ver-name { font-size: 1rem; font-family: var(--font-mono); font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.ver-status { font-size: 10px; }
.ver-status.rec   { color: var(--ok); }
.ver-status.maint { color: var(--warn); }
.ver-status.eol   { color: var(--danger); }

/* Risk banner */
.risk-banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px; padding: 16px 18px; margin: 0 0 20px;
}
.risk-icon { font-size: 22px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.risk-content h4 { color: #ef4444; font-size: .85rem; margin-bottom: 4px; }
.risk-content p { color: var(--text2); font-size: 13px; margin: 0; }

/* Callouts */
.callout {
  border-radius: 8px; padding: 14px 16px; margin: 12px 0 18px;
  border-left: 3px solid;
}
.callout.info    { background: rgba(56,189,248,.07); border-color: #38bdf8; }
.callout.warning { background: rgba(245,158,11,.07); border-color: #f59e0b; }
.callout.danger  { background: rgba(239,68,68,.07);  border-color: #ef4444; }
.callout.success { background: rgba(34,197,94,.07);  border-color: #22c55e; }
.callout.tip     { background: rgba(167,139,250,.07);border-color: #a78bfa; }
.callout-title {
  font-size: 10.5px; font-family: var(--font-mono); font-weight: 700;
  letter-spacing: .08em; margin-bottom: 6px;
}
.callout.info .callout-title    { color: #38bdf8; }
.callout.warning .callout-title { color: #f59e0b; }
.callout.danger .callout-title  { color: #ef4444; }
.callout.success .callout-title { color: #22c55e; }
.callout.tip .callout-title     { color: #a78bfa; }
.callout p, .callout li { color: var(--text2); font-size: 13.5px; margin: 0; line-height: 1.6; }
.callout code { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }

/* Code blocks */
.pre-wrap {
  background: #040609; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; margin: 10px 0 18px;
}
.pre-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pre-header-left { display: flex; align-items: center; gap: 10px; }
.pre-dots { display: flex; gap: 5px; }
.pre-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border2);
}
.pre-dots span:nth-child(1) { background: #ff5f57; }
.pre-dots span:nth-child(2) { background: #ffc22d; }
.pre-dots span:nth-child(3) { background: #29c740; }
.pre-label { font-size: 11px; font-family: var(--font-mono); color: var(--text3); }

.pre-mode {
  font-size: 9.5px; font-family: var(--font-mono); font-weight: 700;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .06em;
}
.pre-mode.cli  { background: rgba(27,160,215,.15); color: #1ba0d7; }
.pre-mode.gui  { background: rgba(245,158,11,.15); color: #f59e0b; }
.pre-mode.tftp { background: rgba(167,139,250,.15); color: #a78bfa; }

.pre-wrap pre {
  padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.75; color: #c9d9eb;
  tab-size: 2;
}
.cli-comment { color: #3a5472; }
.cli-prompt  { color: var(--accent); font-weight: 600; }
.cli-cmd     { color: #e2eaf5; }
.cli-out     { color: #6a8aa8; }
.cli-ok      { color: #22c55e; }
.cli-warn    { color: #f59e0b; }
.cli-kw      { color: #c4b5fd; font-weight: 600; }
.cli-flash   { color: #fb923c; }
.cli-path    { color: #7dd3fc; }
.cli-section { color: var(--accent); font-weight: 700; }

.copy-btn {
  font-size: 11px; font-family: var(--font-mono);
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text3); border-radius: 4px; padding: 3px 8px;
  cursor: pointer; transition: all .2s;
}
.copy-btn:hover, .copy-btn.copied {
  background: rgba(245,158,11,.15); border-color: var(--accent);
  color: var(--accent);
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 10px 0 20px; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--surface); }
th {
  padding: 10px 14px; text-align: left; font-size: 10.5px;
  font-family: var(--font-mono); font-weight: 700;
  color: var(--text3); letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--border2);
}
td {
  padding: 10px 14px; color: var(--text2); font-size: 13px;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(245,158,11,.03); }
td code, td pre { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); }
td.ok   { color: var(--ok); font-weight: 600; }
td.bad  { color: var(--danger); font-weight: 600; }
td.warn { color: var(--warn); font-weight: 600; }
.table-note { padding: 8px 14px; font-size: 11px; color: var(--text3); background: var(--surface); border-top: 1px solid var(--border); }

/* Steps */
.steps { margin: 14px 0 20px; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 0 0 20px;
  position: relative;
}
.step:not(:last-child)::before {
  content: ''; position: absolute; left: 15px; top: 32px;
  width: 1px; bottom: 0;
  background: var(--border2);
}
.step::after {
  content: ''; position: absolute; left: 7px; top: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg); flex-shrink: 0;
}
.step-content { padding-left: 34px; flex: 1; }
.step-content h4 { color: var(--accent); margin-bottom: 4px; }
.step-content p { font-size: 13.5px; margin-bottom: 8px; }
.step-cmd { margin-top: 8px; }

/* Tabs */
.tabs { margin: 10px 0 20px; }
.tab-headers {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border2); margin-bottom: 0;
}
.tab-btn {
  padding: 8px 16px; font-size: 12px; font-family: var(--font-mono);
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text2); cursor: pointer; transition: color .2s, border-color .2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; padding-top: 14px; }
.tab-pane.active { display: block; }

/* Checklist */
.checklist {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 8px; padding: 16px 20px; margin: 10px 0 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.checklist label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--text2); cursor: pointer;
}
.checklist input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}
.checklist code { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }

/* Chapter grid (home) */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 12px; margin-bottom: 24px; }
.ch-card {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; padding: 16px; text-decoration: none;
  transition: border-color .2s, background .2s; display: block;
}
.ch-card:hover { border-color: var(--vc, var(--accent)); background: var(--surface2); }
.ch-vendor { font-size: 10px; font-family: var(--font-mono); font-weight: 700; color: var(--vc, var(--accent)); margin-bottom: 4px; }
.ch-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ch-desc { font-size: 11.5px; color: var(--text3); }

/* Vendor color classes */
.vendor-cisco   { --vc: var(--cisco); }
.vendor-hp      { --vc: var(--hp); }
.vendor-juniper { --vc: var(--juniper); }
.vendor-fortinet{ --vc: var(--fortinet); }
.vendor-palo    { --vc: var(--paloalto); }
.vendor-arista  { --vc: var(--arista); }
.vendor-extreme { --vc: var(--extreme); }
.vendor-all     { --vc: var(--all); }

/* Nav prev/next */
.ch-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.ch-nav a {
  font-size: 13px; font-family: var(--font-mono); font-weight: 600;
  color: var(--text2); text-decoration: none;
  padding: 8px 16px; border: 1px solid var(--border2); border-radius: 6px;
  transition: all .2s;
}
.ch-nav a:hover { border-color: var(--accent); color: var(--accent); }
.ch-nav a.next { background: rgba(245,158,11,.08); color: var(--accent); border-color: var(--accent); }
.ch-nav a.prev::before { content: '← '; }
.ch-nav a.next::after  { content: ' →'; }

/* Glossary */
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.glos-item { background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; padding: 14px 16px; }
.glos-term { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: .88rem; margin-bottom: 4px; }
.glos-def  { font-size: 12.5px; color: var(--text2); line-height: 1.55; }

/* Overlay mobile */
#overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 90;
}
#overlay.open { display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    transform: translateX(-100%);
  }
  #sidebar.open { transform: translateX(0); }
  #hamburger { display: block; }
  .chapter { padding: 20px 16px 48px; }
  .chapter h1 { font-size: 1.5rem; }
  .ver-matrix { gap: 8px; }
  .ver-card { min-width: 140px; }
  .ch-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .ch-grid { grid-template-columns: 1fr; }
  .tab-btn { padding: 6px 10px; font-size: 11px; }
}
