/* Project Hack :: Help — themed to match the in-game terminal aesthetic
   (see ProjectHackJS src/index.css / src/components/Layout/GameLayout.css) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0e1a;
  --panel: #131823;
  --panel-alt: #1a1f2e;
  --panel-alt-2: #1a2535;
  --green: #00ff00;
  --green-dim: #00ff0044;
  --green-mid: #00ff0088;
  --green-accent: #00ff41;
  --green-hover: #00cc00;
  --red: #ff4444;
  --text-muted: #7fdc7f;
  --text-faint: #4d8f4d;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Courier New', monospace;
  background-color: var(--bg);
  color: var(--green);
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbars, matching the game */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--green-hover);
}

a {
  color: var(--green-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-shadow: 0 0 6px var(--green);
}

/* ============ Layout ============ */

.help-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--panel-alt);
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--green);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.help-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.help-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px var(--green));
}

.help-header h1 {
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--green);
  text-shadow: 0 0 10px var(--green);
}

.help-header-sub {
  color: var(--text-muted);
  font-weight: normal;
  text-shadow: none;
}

.help-header-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
}

.help-header-links a {
  border: 1px solid var(--green-dim);
  padding: 0.35rem 0.75rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.help-header-links a:hover {
  border-color: var(--green);
  background-color: rgba(0, 255, 0, 0.08);
  text-decoration: none;
}

.help-body {
  display: flex;
  flex: 1;
}

/* ============ Sidebar nav ============ */

.help-nav {
  width: 280px;
  flex-shrink: 0;
  background-color: var(--panel);
  border-right: 1px solid var(--green);
  padding: 1.25rem 1rem 3rem;
  overflow-y: auto;
}

.help-nav-title {
  color: var(--text-faint);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

.help-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.help-nav a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 3px;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
}

.help-nav a:hover {
  color: var(--green);
  background-color: rgba(0, 255, 0, 0.06);
  border-color: var(--green-dim);
  text-decoration: none;
}

.help-nav a.active {
  color: var(--green);
  background-color: rgba(0, 255, 0, 0.1);
  border-color: var(--green);
  text-shadow: 0 0 6px var(--green);
}

.help-nav a.active::before {
  content: '> ';
}

/* ============ Main content ============ */

.help-content {
  flex: 1;
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
  overflow-x: hidden;
}

.content-inner h1 {
  font-size: 1.75rem;
  color: var(--green);
  text-shadow: 0 0 12px var(--green), 0 0 24px var(--green-mid);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--green);
}

.content-inner h2 {
  font-size: 1.25rem;
  color: var(--green);
  margin-top: 2.25rem;
  margin-bottom: 0.9rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--green);
  text-shadow: 0 0 6px rgba(0, 255, 0, 0.4);
}

.content-inner h3 {
  font-size: 1.02rem;
  color: var(--green-accent);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.content-inner h3::before {
  content: '# ';
  color: var(--text-faint);
}

.content-inner p {
  margin-bottom: 1rem;
  color: #c9f5c9;
  max-width: 68ch;
}

.content-inner strong {
  color: var(--green-accent);
}

.content-inner code {
  background-color: rgba(0, 255, 0, 0.08);
  border: 1px solid var(--green-dim);
  color: var(--green-accent);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.92em;
}

.content-inner pre {
  background-color: var(--bg);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.05);
}

.content-inner pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--green);
  font-size: 0.88rem;
  line-height: 1.5;
}

.content-inner ul,
.content-inner ol {
  margin: 0 0 1.25rem 1.5rem;
  color: #c9f5c9;
}

.content-inner li {
  margin-bottom: 0.4rem;
  max-width: 66ch;
}

.content-inner ul {
  list-style: none;
  margin-left: 0.25rem;
}

.content-inner ul li::before {
  content: '\2022 ';
  color: var(--green);
  margin-right: 0.4em;
}

.content-inner ol {
  list-style: none;
  counter-reset: step;
  margin-left: 0.25rem;
}

.content-inner ol li {
  counter-increment: step;
  position: relative;
  padding-left: 1.9rem;
}

.content-inner ol li::before {
  content: counter(step) '.';
  position: absolute;
  left: 0;
  color: var(--green-accent);
  font-weight: bold;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--green);
  border-radius: 4px;
}

.content-inner table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
  white-space: nowrap;
}

.content-inner th,
.content-inner td {
  padding: 0.55rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--green-dim);
}

.content-inner th {
  background-color: var(--panel-alt-2);
  color: var(--green);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--green);
}

.content-inner tbody tr:nth-child(odd) {
  background-color: rgba(0, 255, 0, 0.03);
}

.content-inner tbody tr:hover {
  background-color: rgba(0, 255, 0, 0.08);
}

.content-inner td code,
.content-inner th code {
  white-space: nowrap;
}

/* Page nav (prev/next) */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--green-dim);
}

.page-nav a {
  border: 1px solid var(--green-dim);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  flex: 1;
  transition: all 0.15s ease;
}

.page-nav a:hover {
  border-color: var(--green);
  background-color: rgba(0, 255, 0, 0.06);
  text-decoration: none;
}

.page-nav-next {
  text-align: right;
  margin-left: auto;
}

/* Index page cards */

.wiki-toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 2rem;
}

/* ============ Responsive ============ */

@media (max-width: 800px) {
  .help-body {
    flex-direction: column;
  }
  .help-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--green);
    max-height: 260px;
  }
  .help-content {
    padding: 1.5rem 1.25rem 3rem;
  }
  .content-inner table {
    font-size: 0.78rem;
  }
}
