/* ============================================================
   KubernetesTrainer.com — style.css v1
   Design system: identical to LearnSlurm v6
   Accent: Kubernetes official blue #326ce5
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@300;400;500;600&display=swap');

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

:root {
  --bg0:   #050708;
  --bg1:   #080b10;
  --bg2:   #0d1117;
  --bg3:   #131920;
  --bg4:   #1a2332;
  --bd1:   #1e2d3d;
  --bd2:   #2a3f55;
  --bd3:   #3a5570;
  --accent: #326ce5;
  --accentg:#2557d6;
  --blue:  #326ce5;
  --blueg: #2557d6;
  --sand:  #c9a96e;
  --green: #4caf82;
  --red:   #e05c5c;
  --amber: #e0a050;
  --tx1:   #d6e4f0;
  --tx2:   #8aabca;
  --tx3:   #4a6880;
  --fm:    'JetBrains Mono', 'Courier New', monospace;
  --fd:    'DM Serif Display', Georgia, serif;
  --fu:    'Outfit', sans-serif;
  --nav-h: 52px;
}

body {
  font-family: var(--fu);
  background: var(--bg0);
  color: var(--tx1);
  overflow-x: hidden;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--bd3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(8,11,16,0.96);
  border-bottom: 1px solid var(--bd1);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 20px;
}
.nav-logo { display: flex; align-items: baseline; gap: 1px; text-decoration: none; flex-shrink: 0; }
.nav-logo-learn { font-family: var(--fu); font-weight: 300; font-size: 14px; color: var(--tx2); letter-spacing: .04em; }
.nav-logo-k8s { font-family: var(--fd); font-size: 19px; color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; flex: 1; }
.nav-links a { font-size: 13px; color: var(--tx2); text-decoration: none; padding: 5px 10px; border-radius: 4px; transition: .15s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--tx1); background: var(--bg3); }
.nav-toggle { display: none; background: none; border: none; color: var(--tx2); font-size: 18px; cursor: pointer; padding: 4px; }
.nav-right { margin-left: auto; flex-shrink: 0; }
.cluster-badge { font-family: var(--fm); font-size: 11px; color: var(--tx3); background: var(--bg2); border: 1px solid var(--bd1); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   TRAINER PAGE — fixed-height layout
   ═══════════════════════════════════════════════════════════ */

body.trainer-body {
  overflow: hidden;
  height: 100vh;
}

.trainer-wrap {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ── Terminal panel (left) ──────────────────────────────── */
.terminal-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--bd1);
  min-width: 0;
}

.term-titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--bd1);
  flex-shrink: 0;
  height: 36px;
}
.term-dots { display: flex; gap: 6px; flex-shrink: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
.term-title { font-family: var(--fm); font-size: 11px; color: var(--tx3); }

.terminal-output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 10px;
  font-family: var(--fm);
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--bg1);
  cursor: text;
  min-height: 0;
}

.terminal-output > div {
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 1px;
}

.step-hint {
  flex-shrink: 0;
  background: var(--bg2); border-top: 1px solid var(--bd1);
  padding: 6px 14px; font-size: 12px; font-family: var(--fm);
  color: var(--tx2); display: flex; align-items: center; gap: 8px;
}
.step-hint-icon { color: var(--blue); }

/* Hidden real input */
.term-input {
  position: fixed;
  top: -9999px; left: -9999px;
  width: 1px; height: 1px;
  opacity: 0; border: none; outline: none;
  background: transparent; color: transparent;
  font-family: var(--fm); font-size: 0.82rem;
}

/* Terminal line colours */
.ls-head    { color: var(--sand) !important; font-weight: 500; }
.ls-success { color: var(--green) !important; }
.ls-warn    { color: var(--amber) !important; }
.ls-error   { color: var(--red) !important; }
.ls-info    { color: var(--blue) !important; }
.ls-comment { color: var(--tx3) !important; }
.ls-out     { color: var(--tx2) !important; }

/* ── Sidebar (right) ────────────────────────────────────── */
.sidebar {
  width: 290px; flex-shrink: 0;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg2);
}
.sidebar-tabs {
  display: flex; border-bottom: 1px solid var(--bd1);
  flex-shrink: 0; height: 38px;
}
.stab {
  flex: 1; font-size: 12px; color: var(--tx3);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  padding: 0 8px; cursor: pointer; transition: .15s;
  font-family: 'Outfit', sans-serif;
}
.stab.active { color: var(--blue); border-bottom-color: var(--blue); }
.stab:hover:not(.active) { color: var(--tx2); }
.spanel {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  display: none; flex-direction: column; min-height: 0;
}
.spanel.active { display: flex; }

/* Pod list */
.pod-header { font-family: var(--fm); font-size: 10px; color: var(--tx3); letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px 8px; border-bottom: 1px solid var(--bd1); flex-shrink: 0; background: var(--bg2); }
.q-head { display: grid; grid-template-columns: 1fr 70px 40px; gap: 4px; padding: 4px 12px 6px; font-family: var(--fm); font-size: 10px; color: var(--tx3); border-bottom: 1px solid var(--bd1); flex-shrink: 0; }
.q-row { display: grid; grid-template-columns: 1fr 70px 40px; gap: 4px; align-items: center; padding: 5px 12px; font-family: var(--fm); font-size: 11px; border-bottom: 1px solid rgba(255,255,255,.025); cursor: default; transition: background .1s; }
.q-row:hover { background: var(--bg3); }
.q-name { color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-ns   { color: var(--tx3); font-size: 10px; }
.q-r    { color: var(--green); font-weight: 600; }
.q-pd   { color: var(--amber); }
.q-err  { color: var(--red); }
.q-other{ color: var(--blue); }
.q-empty { padding: 20px 12px; text-align: center; color: var(--tx3); font-size: 12px; font-family: var(--fm); }
#pod-body { flex: 1; overflow-y: auto; }

/* Search */
.search-wrap { position: relative; padding: 10px; border-bottom: 1px solid var(--bd1); flex-shrink: 0; background: var(--bg2); }
.cmd-search-input { width: 100%; background: var(--bg3); border: 1px solid var(--bd2); color: var(--tx1); font-family: var(--fm); font-size: 12px; padding: 7px 30px 7px 10px; border-radius: 5px; outline: none; transition: border-color .15s; }
.cmd-search-input:focus { border-color: var(--blue); }
.cmd-search-input::placeholder { color: var(--tx3); }
.search-icon { position: absolute; right: 18px; top: 50%; transform: translateY(-45%); color: var(--tx3); font-size: 14px; pointer-events: none; }
#search-results { flex: 1; overflow-y: auto; }
.sr-hint { font-size: 11px; color: var(--tx3); padding: 8px 12px 4px; font-family: var(--fm); }
.sr-count { font-family: var(--fm); font-size: 10px; color: var(--tx3); padding: 6px 12px; letter-spacing: .05em; }
.sr-empty { font-size: 12px; color: var(--tx3); padding: 16px 12px; font-family: var(--fm); }
.sr-cat { display: flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--tx2); border-bottom: 1px solid var(--bd1); transition: background .1s; user-select: none; }
.sr-cat:hover { background: var(--bg3); }
.sr-cat-label { flex: 1; }
.sr-cat-count { font-family: var(--fm); font-size: 10px; color: var(--tx3); background: var(--bg3); padding: 1px 5px; border-radius: 10px; }
.sr-cat-arrow { color: var(--tx3); font-size: 11px; }
.sr-item { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,.025); cursor: pointer; transition: background .1s; display: block; }
.sr-item:hover { background: var(--bg4); }
.sr-item-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.sr-cmd { font-family: var(--fm); font-size: 11px; color: var(--blue); display: inline; white-space: nowrap; }
.sr-cat-tag { font-family: var(--fm); font-size: 9px; color: var(--tx3); background: var(--bg3); padding: 1px 5px; border-radius: 3px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .04em; }
.sr-desc { font-size: 11px; color: var(--tx3); line-height: 1.35; display: block; padding-top: 2px; }

/* Toast */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--bg3); border: 1px solid var(--blue); color: var(--blue); padding: 6px 14px; border-radius: 5px; font-size: 12px; font-family: var(--fm); animation: fadeIn .2s; }
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1} }

/* ── INDEX PAGE ─────────────────────────────────────────── */
.page { padding-top: var(--nav-h); }

.hero {
  position: relative; min-height: 64vh; display: flex; align-items: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 60% 40%, rgba(50,108,229,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(201,169,110,0.04) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(50,108,229,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50,108,229,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}
.hero-inner {
  position: relative; max-width: 1400px; margin: 0 auto; padding: 56px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; width: 100%;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--fm); font-size: 11px; color: var(--blue);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px;
}
.hero-eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--blue); }
.hero-title { font-family: var(--fd); font-size: clamp(40px, 5vw, 64px); line-height: 1.1; margin-bottom: 8px; }
.hero-title em { font-style: italic; color: var(--sand); }
.hero-subtitle { font-size: 16px; font-weight: 300; color: var(--tx2); max-width: 540px; line-height: 1.6; margin-bottom: 28px; margin-top: 12px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--fm); font-size: 13px; font-weight: 500;
  background: var(--blue); color: #fff; border: none; padding: 11px 22px;
  border-radius: 5px; cursor: pointer; text-decoration: none; transition: .2s;
}
.btn-primary:hover { background: var(--accentg); box-shadow: 0 0 20px rgba(50,108,229,0.4); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--fm); font-size: 13px; background: transparent; color: var(--tx2);
  border: 1px solid var(--bd2); padding: 11px 22px; border-radius: 5px;
  cursor: pointer; text-decoration: none; transition: .2s;
}
.btn-secondary:hover { color: var(--tx1); border-color: var(--bd3); background: var(--bg3); }

/* Hero terminal preview */
.hero-terminal { background: var(--bg2); border: 1px solid var(--bd2); border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 20px rgba(50,108,229,0.1); overflow: hidden; font-family: var(--fm); font-size: 13px; }
.terminal-titlebar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg3); border-bottom: 1px solid var(--bd1); }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }
.terminal-title { font-size: 11px; color: var(--tx3); margin-left: 6px; }
.terminal-body { padding: 18px; min-height: 280px; }
.t-line { margin-bottom: 3px; line-height: 1.5; font-size: 13px; }
.t-prompt { color: var(--blue); }
.t-cmd    { color: var(--tx1); }
.t-head   { color: var(--sand); font-weight: 500; font-size: 12px; }
.t-run    { color: var(--green); font-size: 12px; }
.t-cursor { display: inline-block; width: 8px; height: 14px; background: var(--blue); vertical-align: middle; animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Stats bar */
.stats-bar { border-top: 1px solid var(--bd1); border-bottom: 1px solid var(--bd1); background: var(--bg2); padding: 20px 0; }
.stats-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; }
.stat-item { flex: 1; text-align: center; padding: 0 16px; border-right: 1px solid var(--bd1); }
.stat-item:last-child { border-right: none; }
.stat-value { font-family: var(--fd); font-size: 30px; color: var(--sand); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--tx3); letter-spacing: .06em; text-transform: uppercase; }

/* Section */
.section { max-width: 1400px; margin: 0 auto; padding: 72px 24px; }
.section-label { display: inline-flex; align-items: center; gap: 8px; font-family: var(--fm); font-size: 11px; color: var(--blue); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.section-label::before { content: ''; display: block; width: 16px; height: 1px; background: var(--blue); }
.section-title { font-family: var(--fd); font-size: clamp(26px, 3vw, 38px); color: var(--tx1); line-height: 1.2; }
.section-title em { font-style: italic; color: var(--sand); }
.section-desc { font-size: 15px; color: var(--tx2); max-width: 540px; margin-top: 12px; line-height: 1.7; font-weight: 300; }
.section-header { margin-bottom: 44px; }

/* Features grid */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--bd1); border: 1px solid var(--bd1); border-radius: 10px; overflow: hidden; }
.feature-card { background: var(--bg2); padding: 28px; transition: background .2s; }
.feature-card:hover { background: var(--bg4); }
.feature-icon { width: 38px; height: 38px; border-radius: 5px; background: var(--bg3); border: 1px solid var(--bd2); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; font-size: 17px; }
.feature-title { font-family: var(--fd); font-size: 19px; color: var(--tx1); margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: var(--tx2); line-height: 1.65; font-weight: 300; }

/* Commands section */
.commands-section { background: var(--bg2); border-top: 1px solid var(--bd1); border-bottom: 1px solid var(--bd1); }
.commands-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cmd-group { background: var(--bg0); border: 1px solid var(--bd1); border-radius: 8px; padding: 18px; }
.cmd-group-title { font-family: var(--fm); font-size: 10px; color: var(--sand); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--bd1); }
.cmd-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.cmd-list li { font-family: var(--fm); font-size: 12px; color: var(--blue); padding: 4px 7px; background: var(--bg3); border-radius: 4px; }

/* Footer */
.footer { border-top: 1px solid var(--bd1); padding: 32px 0; margin-top: 40px; }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer-logo { font-family: var(--fd); font-size: 15px; color: var(--blue); text-decoration: none; }
.footer-text { font-size: 12px; color: var(--tx3); }
.footer-links { display: flex; gap: 18px; list-style: none; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 12px; color: var(--tx3); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--tx2); }
/* Auth buttons — used on all pages */
.btn-upgrade { background:transparent;color:#326ce5;border:1px solid #326ce5;border-radius:6px;padding:4px 10px;font-size:11px;cursor:pointer;font-weight:500;transition:.15s;white-space:nowrap; }
.btn-upgrade:hover { background:#326ce5;color:#fff; }
.btn-login { background:transparent;color:#8aabca;border:1px solid #1e2d3d;border-radius:6px;padding:4px 10px;font-size:11px;cursor:pointer;transition:.15s;white-space:nowrap; }
.btn-login:hover { border-color:#326ce5;color:#d6e4f0; }
.auth-user { display:flex;align-items:center;gap:7px;cursor:pointer;padding:4px 8px;border-radius:6px;transition:.15s; }
.auth-user:hover { background:var(--bg3); }
.auth-avatar { width:26px;height:26px;border-radius:50%;border:1px solid var(--bd1);object-fit:cover; }
.auth-name { font-size:12px;color:var(--tx2);max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.premium-badge { background:var(--blue);color:#fff;font-size:9px;font-weight:600;padding:1px 5px;border-radius:4px; }

/* ── About page ──────────────────────────────────────────── */
.about-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 60px 32px 80px;
}
.about-wrap h1 { font-family: var(--fd); font-size: clamp(28px, 4vw, 44px); margin-bottom: 20px; line-height: 1.15; }
.about-wrap h1 em { font-style: italic; color: var(--sand); }
.about-wrap p { font-size: 15px; color: var(--tx2); line-height: 1.8; margin-bottom: 18px; font-weight: 300; }
.about-wrap h2 { font-family: var(--fd); font-size: 22px; color: var(--tx1); margin: 36px 0 12px; }
.about-wrap a { color: var(--blue); text-decoration: none; }
.about-wrap a:hover { text-decoration: underline; }
.about-wrap .back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 40px; font-family: var(--fm); font-size: 13px; color: var(--tx2); text-decoration: none; transition: color .15s; }
.about-wrap .back-link:hover { color: var(--blue); text-decoration: none; }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0 20px; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--bd1); color: var(--tx2); }
.spec-table td:first-child { color: var(--blue); font-family: var(--fm); font-size: 12px; width: 40%; }

/* Changelog */
.changelog { list-style: none; margin: 0; padding: 0; }
.changelog li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--bd1); }
.changelog li:last-child { border-bottom: none; }
.cl-ver  { font-family: var(--fm); font-size: 12px; color: var(--blue); min-width: 56px; flex-shrink: 0; }
.cl-date { font-family: var(--fm); font-size: 11px; color: var(--tx3); min-width: 80px; flex-shrink: 0; margin-top: 1px; }
.cl-text { font-size: 13px; color: var(--tx2); line-height: 1.5; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-terminal { max-width: 520px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .commands-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: rgba(8,11,16,0.98); border-bottom: 1px solid var(--bd1); padding: 8px; z-index: 300; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-right { display: flex; align-items: center; gap: 6px; }
  .cluster-badge { display: none; }
  .sidebar { width: 0; display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .commands-grid { grid-template-columns: 1fr 1fr; }
  .stats-inner { flex-wrap: wrap; }
  .stat-item { flex: 1 1 50%; border-right: none; border-bottom: 1px solid var(--bd1); padding: 12px; }
  .about-wrap { padding: 40px 20px 60px; }
  .btn-upgrade { padding: 5px 8px; font-size: 11px; }
  .btn-login { padding: 5px 8px; font-size: 11px; }
}
