/* Variables */
:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --primary: #61dafb;
  --text: #e0e0e0;
  --accent: #2a2a2a;
}

/* Base styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { 
  color: var(--primary);
}

/* Typography */
h1, h2, h3 { 
  color: #fff; 
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

p {
  font-size: 1.2rem;
  color: #ccc;
  text-align: center;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Navbar */
.navbar {
  background: var(--surface);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  position: relative;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
}

.navbar-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: bold;
  font-size: 1.1rem;
}

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

/* Mobile menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.menu-toggle span {
  height: 3px;
  width: 100%;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Main layout */
main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 900px;
}

.content-wrapper {
  display: flex;
  min-height: calc(100vh - 60px); /* Adjust based on navbar height */
  max-width: 1200px;
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--bg);
  padding: 2rem 1rem;
  border-right: 1px solid #333;
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-toggle {
  display: none;
  cursor: pointer;
  background: var(--surface);
  border-radius: 4px;
  padding: 6px 10px;
  transition: all 0.2s ease;
  color: var(--text);
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  border: 1px solid #444;
}

.sidebar-toggle:hover {
  background: #3a3a3a;
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  fill: var(--text);
  transition: transform 0.3s ease;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 0.75rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sidebar-nav a:hover {
  background: #2a2a2a;
}

.sidebar-nav a.active {
  background: #2a2a2a;
  color: var(--primary);
  font-weight: bold;
}

/* Document content */
.doc-content {
  flex: 1;
  padding: 2rem;
  max-width: 800px;
}

/* Game nav */
.game-nav {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
}

a.game-link {
  display: block;
  text-align: center;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  transition: background 0.3s;
}

a.game-link:hover {
  background: #1f1f1f;
}

/* Code styling */
pre { 
  background: var(--surface); 
  padding: 1rem; 
  border-radius: 6px; 
  overflow-x: auto; 
  margin: 1.5rem 0;
}

code {
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  background: rgba(0,0,0,0.2);
}

pre code {
  padding: 0;
  background: transparent;
  font-size: 0.95em;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}

thead {
  background-color: #2a2a2a;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #333;
}

th {
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: rgba(46, 46, 46, 0.5);
}

/* Form elements */
label {
  display: block;
  margin-top: 1.5rem;
  font-weight: bold;
}

select, textarea, button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 6px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  box-sizing: border-box;
}

textarea {
  height: 300px;
  resize: vertical;
  font-family: monospace;
}

button {
  background: var(--primary);
  color: black;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 1rem;
}

button:hover {
  background: #4ec1e6;
}

/* Result container */
.result-container {
  position: relative;
  margin-top: 2rem;
}

.copy-btn {
  position: absolute;
  top: 4.5rem;
  right: 1.2rem;
  background: rgba(0,0,0,0.4);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  width: auto;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}

.copy-btn:hover {
  background: rgba(0,0,0,0.6);
}

/* Footer */
footer, .footer {
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
  background: var(--surface);
  color: #888;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    padding: 1rem;
    border-right: none;
    border-bottom: none;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-nav {
    display: none;
    transition: all 0.3s ease;
  }

  .sidebar-nav.active {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  .sidebar-nav li {
    margin-bottom: 0.25rem;
    width: 100%;
  }

  .sidebar-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-radius: 4px;
    white-space: normal;
    width: 100%;
    box-sizing: border-box;
  }

  .sidebar-title {
    margin-bottom: 0;
  }

  .doc-content {
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem;
  }
  
  .navbar {
    padding: 0.75rem 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  .navbar-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    padding: 1rem;
    gap: 1rem;
    border-top: 1px solid #333;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
  }

  .navbar-links.active {
    display: flex;
  }
  
  h1 {
    font-size: 1.75rem;
  }

  .copy-btn {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  
  p {
    font-size: 1rem;
  }
}