/* WTK KSP Multiplayer — Stylesheet */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-yellow: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;

  --sidebar-width: 240px;
  --max-content: 1100px;
  --radius: 6px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
}

.site-header .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header .logo .rocket { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.2rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: auto;
}

/* Layout */
.layout {
  display: flex;
  padding-top: 56px;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0.75rem;
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  overflow-y: auto;
}

.sidebar nav ul { list-style: none; }
.sidebar nav li { margin-bottom: 0.25rem; }
.sidebar nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--bg-tertiary);
  color: var(--accent);
  font-weight: 600;
}

main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem 2.5rem 4rem;
  max-width: var(--max-content);
}

/* Typography */
h1 { font-size: 2rem; margin-bottom: 1rem; font-weight: 700; }
h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; font-weight: 600; }
h4 { font-size: 1rem; margin: 1rem 0 0.5rem; font-weight: 600; color: var(--accent); }

p { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1rem 1.5rem; }
li { margin-bottom: 0.25rem; }

.tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h3 { margin-top: 0; }

.server-info-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}
.server-info-grid dt {
  color: var(--text-secondary);
  font-weight: 600;
}
.server-info-grid dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.badge-required { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.badge-optional { background: rgba(188, 140, 255, 0.15); color: var(--accent-purple); }
.badge-manual { background: rgba(210, 153, 34, 0.15); color: var(--accent-yellow); }
.badge-online { background: rgba(63, 185, 80, 0.15); color: var(--accent-green); }
.badge-offline { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.badge-unknown { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Steps */
.step {
  display: flex;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.step-body { flex: 1; }
.step-body h3 { margin-top: 0; }

/* Callouts */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-secondary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.callout-warning {
  border-left-color: var(--accent-yellow);
  background: rgba(210, 153, 34, 0.07);
}
.callout-info {
  border-left-color: var(--accent);
  background: rgba(88, 166, 255, 0.07);
}
.callout-success {
  border-left-color: var(--accent-green);
  background: rgba(63, 185, 80, 0.07);
}
.callout-danger {
  border-left-color: var(--accent-red);
  background: rgba(248, 81, 73, 0.07);
}

/* Code */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-tertiary);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--accent);
}

.code-block {
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.code-block pre { margin: 0; }
.code-block code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text-primary); border-color: var(--accent); }

/* Download button */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.download-btn:hover {
  background: #79b8ff;
  text-decoration: none;
}

/* Mod table */
.mod-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}
.mod-table th, .mod-table td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.mod-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.mod-table tr:last-child td { border-bottom: none; }
.mod-table td:nth-child(2) {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent);
  font-size: 0.85rem;
}

.mod-category {
  margin-top: 2rem;
  color: var(--accent-purple);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* Hero */
.hero {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.hero h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Footer */
.site-footer {
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: var(--max-content);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  text-align: center;
}
.footer-brand {
  font-weight: 500;
  color: var(--text-primary);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* Platform notes */
.platform-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--bg-tertiary);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.platform-note .platform-label {
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 99;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }

  main, .site-footer {
    margin-left: 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero h1 { font-size: 1.8rem; }
  h1 { font-size: 1.6rem; }

  .server-info-grid {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .server-info-grid dt { margin-top: 0.5rem; }

  .step { flex-direction: column; }
}
