/* ==========================================================
   OSCP+/OSEP Cheatsheet (v2 / tactical-console)
   Class names match what cheatsheet.js renders.
   ========================================================== */

.bg-grid, .bg-glow, .bg-blog-img, .bg-cheat-img, .bg-hero-img { display: none; }
.cheat-page { background: var(--bg); }

/* ----------------------------------------------------------
   HERO
   ---------------------------------------------------------- */
.cheat-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 32px;
  position: relative;
  z-index: 2;
}
.cheat-hero-inner { max-width: 880px; }

.cheat-h1 {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.03em;
  margin: 14px 0 16px;
  color: var(--text);
}
.cheat-h1 span { display: block; }
.cheat-h1 sup { font-size: .5em; color: var(--amber); vertical-align: super; }
.cheat-h1 .gradient {
  background: linear-gradient(90deg, var(--amber) 0%, var(--crimson) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cheat-sub {
  font-size: 16px;
  color: var(--text-2);
  max-width: 640px;
  margin-bottom: 28px;
  line-height: 1.65;
}

.cheat-stat-bar {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  flex-wrap: wrap;
}
.cheat-stat-bar > div {
  padding: 12px 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.cheat-stat-bar > div:last-child { border-right: none; }
.cheat-stat-bar strong {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}
.cheat-stat-bar span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ----------------------------------------------------------
   VARIABLES BAR
   ---------------------------------------------------------- */
.vars-section {
  width: calc(100% - 64px);
  max-width: 1216px; /* = 1280 - 64 (matches hero content edge) */
  margin: 0 auto 24px;
  padding: 22px 26px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  position: relative;
  z-index: 2;
}
.vars-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.vars-head h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.vars-head h3::before { content: '//'; color: var(--text-4); }
.vars-head p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .04em;
}
.vars-reset {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: all .15s;
}
.vars-reset:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}
.vars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.vars-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vars-grid label span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-3);
  text-transform: uppercase;
}
.vars-grid input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  color: var(--emerald-2);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.vars-grid input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
.vars-grid input::placeholder { color: var(--text-4); }

/* ----------------------------------------------------------
   TOOLBAR / SEARCH + FILTERS
   ---------------------------------------------------------- */
.cheat-toolbar {
  max-width: 1280px;
  margin: 0 auto 24px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.search-bar { position: relative; width: 100%; }
.search-bar .search-icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}
.search-bar input {
  width: 100%;
  padding: 14px 60px 14px 46px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.search-bar input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
.search-bar input::placeholder { color: var(--text-4); }
.search-bar kbd {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-3);
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pills .pill {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
}
.filter-pills .pill:hover { color: var(--text); border-color: var(--border-strong); }
.filter-pills .pill.on {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

/* ----------------------------------------------------------
   LAYOUT
   ---------------------------------------------------------- */
.cheat-layout {
  max-width: 1280px;
  margin: 0 auto 80px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: start;
  position: relative;
  z-index: 2;
}

/* ---- SIDEBAR ---- */
.cheat-side {
  position: sticky;
  top: 84px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.cheat-side::-webkit-scrollbar { width: 6px; }
.cheat-side::-webkit-scrollbar-track { background: transparent; }
.cheat-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.cs-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--amber);
  padding: 6px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.cs-count {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-3);
}

#sideNav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.side-link {
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .12s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.on {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
  font-weight: 600;
}

.side-link-all {
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.side-link-all .si-ico { color: var(--amber); }
.side-link .si-ico {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.side-link > span:nth-child(2) {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-link .si-cnt {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--bg-2);
  color: var(--text-4);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.side-link.on .si-cnt {
  background: var(--amber);
  color: #0B0905;
}

.cs-tip {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--amber-soft);
  border: 1px solid var(--amber);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.cs-tip strong {
  display: block;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.cs-tip kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--amber-2);
}

/* ----------------------------------------------------------
   MAIN: CATEGORIES
   ---------------------------------------------------------- */
.cheat-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0; /* prevent grid blowout */
}

.cat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px 28px;
  scroll-margin-top: 90px;
}
.cat.hidden { display: none; }

.cat-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.cat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: var(--amber-soft);
  border: 1px solid var(--amber);
  color: var(--amber);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.cat-meta { flex: 1; min-width: 0; }
.cat-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.018em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}
.cat-grouptag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 8px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.cat-cnt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--text-3);
}

/* ---- GROUP ---- */
.grp {
  margin-top: 22px;
}
.grp:first-of-type { margin-top: 0; }

.grp-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grp-name::before {
  content: '◆';
  color: var(--emerald);
  font-size: 8px;
}

.cmd-list {
  display: grid;
  gap: 8px;
}

/* ----------------------------------------------------------
   COMMAND CARD - the hero of the page
   ---------------------------------------------------------- */
.cmd {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: stretch;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  overflow: hidden;
}
.cmd:hover {
  border-color: var(--border-strong);
  border-left-color: var(--amber);
  background: var(--surface);
}
.cmd:hover .cmd-btn {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}
.cmd.hidden { display: none; }

.cmd-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cmd-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.005em;
  line-height: 1.3;
}

.cmd-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  text-transform: uppercase;
}
.cmd-tag.tag-osep { background: var(--crimson-soft); border-color: var(--crimson); color: var(--crimson); }
.cmd-tag.tag-oscp { background: var(--emerald-soft); border-color: var(--emerald); color: var(--emerald); }
.cmd-tag.tag-ad   { background: var(--violet-soft);  border-color: var(--violet);  color: var(--violet); }
.cmd-tag.tag-stealth,
.cmd-tag.tag-evasion { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }

.cmd-text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.cmd-text::-webkit-scrollbar { height: 4px; }
.cmd-text::-webkit-scrollbar-track { background: transparent; }
.cmd-text::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.var-tok {
  display: inline-block;
  font-weight: 600;
  color: var(--violet);
  background: var(--violet-soft);
  border: 1px dashed var(--violet);
  padding: 0 4px;
  border-radius: 3px;
  margin: 0 1px;
  font-size: .92em;
}
.var-tok.filled {
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald);
  border-style: solid;
}

.cmd-text mark {
  background: var(--amber);
  color: #0B0905;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 700;
}

/* ---- COPY BUTTON ---- */
.cmd-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}
.cmd-btn,
.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .15s ease;
  flex-shrink: 0;
}
.cmd-btn:hover,
.copy-btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: #0B0905;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px var(--amber-glow);
}
.cmd-btn svg,
.copy-btn svg {
  width: 16px;
  height: 16px;
}
.copy-btn.copied {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #062417;
  transform: none;
  box-shadow: 0 0 0 3px var(--emerald-soft);
}
.copy-btn.copied:hover {
  background: var(--emerald);
  border-color: var(--emerald);
}

/* ----------------------------------------------------------
   EMPTY STATE
   ---------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-3);
}
.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--text-4);
  margin-bottom: 16px;
}
.empty-state h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}
.empty-state p {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
}

/* ----------------------------------------------------------
   TOAST
   ---------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 22px;
  background: var(--amber);
  color: #0B0905;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  box-shadow: 0 12px 40px var(--amber-glow);
  z-index: 200;
  transition: transform .3s cubic-bezier(.5, 1.5, .5, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast::before {
  content: '✓';
  display: inline-block;
  background: #0B0905;
  color: var(--amber);
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .cheat-layout { grid-template-columns: 1fr; }
  .cheat-side {
    position: relative;
    top: 0;
    max-height: none;
  }
  #sideNav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-link { flex: 1 1 200px; }
  .cs-tip { display: none; }
}
@media (max-width: 700px) {
  .cheat-hero, .cheat-toolbar, .cheat-layout {
    padding-left: 20px; padding-right: 20px;
  }
  .vars-section { width: calc(100% - 40px); padding: 18px; }
  .cheat-stat-bar > div { padding: 10px 16px; }
  .cat { padding: 18px 16px; }
  .cat-head { gap: 12px; padding-bottom: 14px; margin-bottom: 16px; }
  .cat-icon { width: 36px; height: 36px; font-size: 16px; }
  .cat-title { font-size: 18px; }
  .cmd { grid-template-columns: 1fr; padding: 12px; }
  .cmd-actions { justify-content: flex-end; }
  .cmd-text { font-size: 12px; }
}
