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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
}

.container {
  display: flex;
  height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 280px;
  background: #f9f9f9;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  transform: translateX(-280px);
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-content {
  padding: 20px;
}

.sidebar h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.sidebar h3 {
  font-size: 14px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: #555;
}

.sidebar p {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.sidebar code {
  background: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  border: 1px solid #e0e0e0;
}

/* Code blocks */

.code-block {
  position: relative;
  margin: 8px 0;
}

.sidebar pre {
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  font-family: 'SF Mono', Monaco, monospace;
}

.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #d0d0d0;
  background: #f0f0f0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:active {
  background: #e0e0e0;
}

/* Examples */

.example {
  margin: 8px 0;
}

.example-header {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.example-header::after {
  content: '▶';
  position: absolute;
  right: 12px;
  transition: transform 0.2s ease;
  font-size: 10px;
}

.example-header:hover {
  background: #f5f5f5;
}

.example.open .example-header::after {
  transform: rotate(90deg);
}

.example-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.example.open .example-content {
  max-height: 500px;
  padding-top: 8px;
}

/* Main */

.main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

h1 {
  font-size: 24px;
  font-weight: 600;
}

.toggle-docs {
  padding: 6px 14px;
  font-size: 13px;
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
}

.toggle-docs:hover {
  background: #e5e5e5;
}

.editor-container {
  max-width: 700px;
}

textarea {
  width: 100%;
  height: 180px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 14px;
  padding: 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  resize: vertical;
}

textarea:focus {
  border-color: #888;
  outline: none;
}

button.run {
  margin-top: 16px;
  padding: 8px 20px;
  font-size: 14px;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
}

button.run:hover {
  background: #333;
}


pre.output {
  background: #f5f5f5;
  padding: 16px;
  margin-top: 20px;
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}


pre.output:empty {
  display: none;
}

button.run,
button.clear {
  padding: 8px 20px;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  min-width: 80px;
}

button.run {
  background: #1a1a1a;
  color: white;
}

button.run:hover {
  background: #333;
}

button.clear {
  background: #f0f0f0;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
}

button.clear:hover {
  background: #e5e5e5;
}