:root {
  --bg: #0a0e13;
  --bg-subtle: #0f1419;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --border: #21262d;
  --accent: #238636;
  --code-bg: rgb(110 118 129 / 15%);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff;
    --bg-subtle: #f6f8fa;
    --text: #1f2328;
    --text-muted: #636c76;
    --link: #0969da;
    --link-hover: #0550ae;
    --border: #d0d7de;
    --accent: #1a7f37;
    --code-bg: rgb(175 184 193 / 20%);
  }
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  margin: 0;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#map {
  flex: 1;
  max-width: 60%;
  height: 100%;
  border-right: 1px solid var(--border);
}

#description {
  width: 40%;
  min-width: 600px;
  max-width: 800px;
  padding: 32px;
  background: var(--bg-subtle);
  overflow-y: auto;
  box-shadow: -2px 0 8px rgb(0 0 0 / 10%);
  display: flex;
  flex-direction: column;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.back-button,
.next-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.back-button:hover,
.next-button:hover {
  color: var(--link-hover);
  background: rgb(88 166 255 / 10%);
}

.back-button:hover {
  transform: translateX(-2px);
}

.next-button:hover {
  transform: translateX(2px);
}

.back-button::before {
  content: "←";
  font-size: 16px;
}

.next-button::after {
  content: "→";
  font-size: 16px;
}

.description-content {
  flex: 1;
}

#description h3 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

#description p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

#description p:last-child {
  margin-bottom: 0;
}

#description strong {
  color: var(--text);
  font-weight: 600;
}

#description a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

#description a:hover {
  color: var(--link-hover);
}

/* Code block styling - must come before #description code for specificity */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  font-family: "SF Mono", Monaco, "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  display: block;
}

/* Comment styling in code */
.code-comment {
  color: #6e7781;
  font-style: italic;
}

/* Inline code in description */
#description code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", Monaco, "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  color: var(--text);
}

#description ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
}

#description li {
  margin-bottom: 8px;
  color: var(--text-muted);
}

#description li:last-child {
  margin-bottom: 0;
}

/* Buttons and controls */
button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-right: 8px;
  margin-top: 8px;
}

button:hover {
  background: #2ea043;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(35 134 54 / 30%);
}

button:active {
  transform: translateY(0);
}

/* Responsive design */
@media (width <= 1024px) {
  body {
    flex-direction: column;
  }

  #map {
    max-width: 100%;
    width: 100%;
    height: 60vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  #description {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 40vh;
    overflow-y: auto;
  }
}

@media (width <= 768px) {
  #map {
    height: 50vh;
  }

  #description {
    padding: 20px;
    height: 50vh;
  }

  #description h3 {
    font-size: 20px;
  }

  #description p,
  #description ul {
    font-size: 14px;
  }
}
