:root {
  /* Color Palette - Express.js Gray & Deep Slate */
  --primary: #828282;
  --primary-glow: rgba(130, 130, 130, 0.3);
  --bg-dark: #0b0f1a;
  --bg-sidebar: #111827;
  --bg-card: rgba(30, 41, 59, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent: #828282;
  --sidebar-width: 300px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  overflow: hidden;
  display: flex;
}

/* Sidebar Layout */
aside {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 0 2rem 2rem;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 0.75rem;
}

.nav-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 0;
}

.chapter {
  margin-bottom: 2rem;
}

.chapter-title {
  padding: 0 2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.page-link {
  display: block;
  padding: 0.5rem 2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  border-right: 2px solid transparent;
}

.page-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.page-link.active {
  color: var(--primary);
  background: rgba(130, 130, 130, 0.05);
  border-right-color: var(--primary);
  font-weight: 600;
}

/* Main Content Area */
main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 4rem 2rem;
  scroll-behavior: smooth;
}

.book-page {
  max-width: 800px;
  margin: 0 auto;
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.book-page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.content-header {
  margin-bottom: 4rem;
}

.content-header .label {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: block;
}

.content-header h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.content-body {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.content-body h2 {
  color: var(--text-primary);
  margin: 3rem 0 1.5rem;
  font-size: 1.75rem;
}

.content-body p {
  margin-bottom: 1.5rem;
}

.code-block {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  margin: 2rem 0;
  overflow-x: auto;
  position: relative;
}

.code-block::before {
  content: 'javascript';
  position: absolute;
  top: 0;
  right: 1.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.pro-tip {
  background: linear-gradient(135deg, rgba(130, 130, 130, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-left: 4px solid var(--primary);
  padding: 2rem;
  border-radius: 0 12px 12px 0;
  margin: 3rem 0;
}

.pro-tip h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Page Navigation Buttons */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.nav-btn {
  padding: 1rem 2rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.nav-btn .dir {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
}

@media (max-width: 1024px) {
  aside {
    display: none;
  }
}
