@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

@page {
  size: letter;
  margin: 0;
}

:root {
  --bg-dark: #1e1e2e;
  --bg-card: #2d2d3f;
  --bg-code: #0d0d14;
  --text-primary: #e4e4e7;
  --text-secondary: #9ca3af;
  --accent-green: #22c55e;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --code-cyan: #22d3ee;
  --border-subtle: #3f3f5a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 10pt;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-dark);
}

.container {
  max-width: 100%;
  padding: 0 35px 30px;
}

/* Header Banner */
.header-banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  color: var(--text-primary);
  padding: 30px 35px 25px;
  border-bottom: 3px solid;
  border-image: linear-gradient(
      90deg,
      var(--accent-green) 0%,
      var(--accent-blue) 50%,
      var(--accent-purple) 100%
    )
    1;
}

.header-banner h1 {
  font-size: 24pt;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.server-address {
  background: var(--bg-code);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 16px;
  border: 1px solid var(--accent-green);
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12pt;
  font-weight: 500;
  color: var(--accent-green);
  letter-spacing: 1px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.server-address::before {
  content: "SERVER ADDRESS";
  font-family: "Inter", system-ui, sans-serif;
  font-size: 7pt;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.server-address::after {
  content: "click to copy";
  font-family: "Inter", system-ui, sans-serif;
  font-size: 7pt;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.server-address:hover {
  background: #1a1a28;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.server-address:hover::after {
  opacity: 1;
}

.server-address:active {
  background: var(--bg-dark);
  transform: scale(0.98);
}

/* Server Status Widget */
.status-widget {
  background: var(--bg-card);
  margin: 20px 35px;
  padding: 16px 20px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.status-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.status-dot.loading {
  background: var(--text-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.status-text {
  font-size: 11pt;
  font-weight: 600;
  color: var(--text-primary);
}

.status-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9.5pt;
  color: var(--text-secondary);
}

.status-separator {
  color: var(--border-subtle);
}

.player-count {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  color: var(--accent-green);
}

.status-player-list {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 9.5pt;
  color: var(--text-secondary);
}

.player-list-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-right: 8px;
}

.player-names {
  color: var(--code-cyan);
  font-family: "JetBrains Mono", monospace;
}

.status-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 9pt;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.refresh-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-blue);
}

.refresh-btn:active {
  background: var(--bg-dark);
}

.refresh-icon {
  font-size: 12pt;
  line-height: 1;
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 9pt;
  color: var(--text-secondary);
}

.auto-refresh-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.toggle-label {
  user-select: none;
}

/* Command Search */
.search-container {
  margin: 20px 35px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 14pt;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10pt;
  color: var(--text-primary);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 10pt;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.search-clear-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.search-no-results {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 9.5pt;
  text-align: center;
}

/* Search result highlighting */
tr.search-hidden {
  display: none;
}

.intro-text {
  background: var(--bg-card);
  padding: 18px 24px;
  margin: 20px 35px;
  border-left: 4px solid var(--accent-blue);
  border-radius: 0 6px 6px 0;
  font-size: 11pt;
}

.intro-text p {
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 1.6;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

.seed-highlight {
  background: var(--bg-code);
  color: var(--code-cyan);
  font-family: "JetBrains Mono", monospace;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
  font-size: 9pt;
}

/* Quick Tips (inline version) */
.quick-tips {
  margin: 20px 35px;
}

.quick-tips-header {
  color: var(--accent-amber);
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 12px;
}

.tips-list.inline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tips-list.inline li {
  background: var(--bg-card);
  padding: 10px 12px;
  border-left: 3px solid var(--accent-amber);
  border-radius: 0 6px 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 9pt;
  margin: 0;
}

.tips-list.inline .tip-number {
  background: var(--accent-amber);
  color: var(--bg-dark);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 9pt;
  flex-shrink: 0;
  border-radius: 3px;
}

.tips-list.inline .tip-content {
  flex: 1;
  color: var(--text-secondary);
}

.tips-list.inline .tip-content strong {
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .quick-tips {
    margin: 16px 16px;
  }

  .tips-list.inline {
    grid-template-columns: 1fr;
  }
}

/* Section Navigation */
.section-nav {
  margin: 0 35px 20px;
}

.nav-label {
  color: var(--text-secondary);
  font-size: 9.5pt;
  margin-bottom: 10px;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 9.5pt;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.essentials {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.nav-link.essentials:hover {
  background: rgba(34, 197, 94, 0.25);
}

.nav-link.mcmmo {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.nav-link.mcmmo:hover {
  background: rgba(168, 85, 247, 0.25);
}

.nav-link.towny {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.nav-link.towny:hover {
  background: rgba(59, 130, 246, 0.25);
}

.nav-link.tips {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.nav-link.tips:hover {
  background: rgba(245, 158, 11, 0.25);
}

@media (max-width: 640px) {
  .section-nav {
    margin: 0 16px 16px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-link {
    padding: 8px 14px;
    font-size: 9pt;
    flex: 1 1 calc(50% - 4px);
    text-align: center;
  }
}

/* Section Intro Header */
.section-intro {
  color: var(--text-primary);
  font-size: 16pt;
  font-weight: 600;
  margin: 28px 35px 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-blue);
}

@media (max-width: 640px) {
  .section-intro {
    margin: 24px 16px 16px;
    font-size: 14pt;
  }
}

/* Section Headers */
.section {
  margin-bottom: 20px;
  page-break-inside: avoid;
}

.section-header {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 18px;
  font-size: 14pt;
  font-weight: 600;
  margin-bottom: 12px;
  border-radius: 6px;
  border-left: 4px solid var(--accent-green);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.section-header:hover {
  background: #363649;
}

.section-header:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.collapse-indicator {
  font-size: 10pt;
}

.collapse-indicator::after {
  content: "▼";
  display: inline-block;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.section-header.collapsed .collapse-indicator::after {
  transform: rotate(-90deg);
}

.section-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  max-height: none;
}

.section-header.essentials {
  border-left-color: var(--accent-green);
}

.section-header.mcmmo {
  border-left-color: var(--accent-purple);
}

.section-header.towny {
  border-left-color: var(--accent-blue);
}

.section-header.tips {
  border-left-color: var(--accent-amber);
}

/* Subsection Headers */
.subsection-header {
  color: var(--text-primary);
  padding: 6px 0;
  font-size: 11pt;
  font-weight: 600;
  margin: 14px 0 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
  page-break-inside: avoid;
}

th {
  background: var(--bg-code);
  color: var(--text-secondary);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(63, 63, 90, 0.5);
  font-size: 9.5pt;
}

tr:nth-child(odd) {
  background: var(--bg-card);
}

tr:nth-child(even) {
  background: rgba(45, 45, 63, 0.5);
}

tr:last-child td {
  border-bottom: none;
}

/* Command styling */
code {
  font-family: "JetBrains Mono", monospace;
  background: var(--bg-code);
  color: var(--code-cyan);
  padding: 2px 6px;
  font-size: 8.5pt;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
}

td code {
  display: inline-block;
  white-space: nowrap;
}

/* Description text */
.section > p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-size: 9.5pt;
}

/* Skills Lists */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.skills-category {
  background: var(--bg-card);
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  page-break-inside: avoid;
}

.skills-category h4 {
  color: var(--text-secondary);
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.skills-category ul {
  list-style: none;
  padding: 0;
}

.skills-category li {
  padding: 3px 0;
  font-size: 9pt;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(63, 63, 90, 0.3);
}

.skills-category li:last-child {
  border-bottom: none;
}

.skill-name {
  font-weight: 600;
  color: var(--accent-purple);
}

/* Tips Section */
.tips-list {
  list-style: none;
  padding: 0;
}

.tips-list li {
  background: var(--bg-card);
  padding: 10px 14px;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent-amber);
  border-radius: 0 6px 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 9.5pt;
}

.tip-number {
  background: var(--accent-amber);
  color: var(--bg-dark);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10pt;
  flex-shrink: 0;
  border-radius: 3px;
}

.tip-content {
  flex: 1;
  color: var(--text-secondary);
}

.tip-content strong {
  color: var(--text-primary);
}

/* Wilderness info box */
.info-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 12px;
  page-break-inside: avoid;
}

.info-box h4 {
  color: var(--accent-blue);
  margin-bottom: 4px;
  font-size: 10pt;
  font-weight: 600;
}

.info-box p {
  font-size: 9pt;
  color: var(--text-secondary);
}

/* Copy-to-clipboard for commands */
code {
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

code::after {
  content: "click to copy";
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 7pt;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s,
    visibility 0.15s;
  pointer-events: none;
  z-index: 10;
}

code:hover::after {
  opacity: 1;
  visibility: visible;
}

code:hover {
  background: #1a1a28;
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

code:active {
  background: var(--bg-dark);
  transform: scale(0.98);
}

/* Toast notification */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-green);
  color: var(--bg-dark);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 10pt;
  font-weight: 600;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(34, 197, 94, 0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--accent-blue);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10pt;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #2563eb;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.back-to-top:active {
  background: #1d4ed8;
  transform: translateY(2px);
}

/* Mobile responsive styles */
@media (max-width: 640px) {
  .header-banner {
    padding: 20px 20px 18px;
  }

  .header-banner h1 {
    font-size: 18pt;
  }

  .server-address {
    font-size: 10pt;
    padding: 6px 12px;
  }

  .server-address::before {
    font-size: 6pt;
    margin-bottom: 3px;
  }

  .server-address::after,
  code::after {
    display: none;
  }

  .status-widget {
    margin: 16px 16px;
    padding: 12px 14px;
  }

  .status-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-details {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .search-container {
    margin: 16px 16px;
  }

  .intro-text {
    margin: 16px 16px;
    padding: 12px 16px;
  }

  .container {
    padding: 0 16px 24px;
  }

  .section-header {
    font-size: 12pt;
    padding: 10px 14px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skills-category ul[style] {
    grid-template-columns: 1fr !important;
  }

  table {
    font-size: 9pt;
  }

  th,
  td {
    padding: 5px 8px;
  }

  code {
    font-size: 8pt;
    padding: 2px 4px;
  }
}

/* Print styles */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: var(--bg-dark) !important;
  }

  .section {
    page-break-inside: avoid;
  }

  table {
    page-break-inside: avoid;
  }

  .skills-category {
    page-break-inside: avoid;
  }
}
