:root {
  --bg-color: #0d0f14;
  --sidebar-bg: rgba(20, 24, 33, 0.8);
  --card-bg: rgba(255, 255, 255, 0.03);
  --accent-color: #3b82f6;
  --accent-secondary: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px border var(--border-color);
  padding: 2rem 1.5rem;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  letter-spacing: -0.025em;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-group {
  margin-bottom: 2rem;
}

.nav-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-color);
}

.nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

/* Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 3rem 4rem;
  max-width: 1000px;
}

.doc-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.doc-section.active {
  display: block;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1.25rem;
  color: white;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: #e2e8f0;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--accent-secondary);
}

pre {
  background: #011627;
  padding: 1.5rem;
  border-radius: 16px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

pre code {
  background: transparent;
  padding: 0;
  color: #d6deeb;
}

ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Step list */
.steps {
  counter-reset: step;
}

.step-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 2rem;
}

.step-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent-color);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.hero-gradient {
  position: absolute;
  top: 0;
  right: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
    padding: 2rem;
  }
}

/* Nesting Flow Styles */
.nesting-flow .step-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--accent-color);
  color: white;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.nesting-flow .step-item {
  border-left: 2px solid var(--border-color);
  padding-left: 20px;
  margin-left: 10px;
  position: relative;
  padding-bottom: 20px;
  counter-increment: none;
}

.nesting-flow .step-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 3px solid var(--bg-color);
}

.nesting-flow .step-item:last-child {
  padding-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table th {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-primary);
  letter-spacing: 1px;
}

table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

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