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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --text: #2d3748;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --code-bg: #f7fafc;
    --sidebar-width: 280px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.version {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.last-updated {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

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

.sidebar nav h2 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.nav-list, .toc {
    list-style: none;
}

.nav-list li, .toc li {
    margin-bottom: 0.5rem;
}

.nav-list a, .toc a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    display: block;
    transition: all 0.2s;
}

.nav-list a:hover, .toc a:hover {
    background: var(--primary);
    color: white;
}

/* Nested class hierarchy styling */
.nav-sublist {
    list-style: none;
    margin-left: 1rem;
    margin-top: 0.25rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border);
}

.nav-sublist li {
    margin-bottom: 0.25rem;
}

.nav-sublist a {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
}

.nav-sublist a:hover {
    background: var(--primary);
    color: white;
}

/* Nested sublists get progressively lighter */
.nav-sublist .nav-sublist {
    border-left-color: #cbd5e0;
}

.nav-sublist .nav-sublist a {
    font-size: 0.8125rem;
}

.content {
    margin-left: var(--sidebar-width);
    padding: 3rem 4rem;
    max-width: 900px;
}

.page-header {
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.class-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.class-header h1 {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.inheritance {
    color: var(--text-secondary);
    font-size: 1rem;
}

.inheritance a {
    color: var(--primary);
    text-decoration: none;
}

.inheritance a:hover {
    text-decoration: underline;
}

.intro, .description, .examples {
    margin-bottom: 3rem;
}

.intro h2, .intro h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.intro h2 {
    font-size: 1.875rem;
}

.intro h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

.intro p {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    margin-bottom: 1rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card h3 {
    color: var(--primary);
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.category-card ul {
    list-style: none;
}

.category-card li {
    margin-bottom: 0.5rem;
}

.category-card a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9375rem;
}

.category-card a:hover {
    color: var(--primary);
}

.api-section {
    margin-bottom: 3rem;
}

.api-section h2 {
    font-size: 1.875rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.member {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.member:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.member-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.member-name {
    font-size: 1.25rem;
    color: var(--text);
    font-weight: 600;
}

.member-type {
    color: var(--primary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--code-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.member-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag.readonly {
    background: #fed7d7;
    color: #c53030;
}

.tag.deprecated {
    background: #ff6b6b;
    color: white;
}

.tag.inherited {
    background: #4ecdc4;
    color: white;
}

.tag.inherited a {
    color: white;
    text-decoration: underline;
}

.default {
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.parameters {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.parameters h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.parameters ul {
    list-style: none;
}

.parameters li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.parameters code {
    color: var(--text);
    font-weight: 600;
}

.parameters .type {
    color: var(--primary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-top: 1rem;
}

code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

pre code {
    display: block;
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .content {
        margin-left: 0;
        padding: 2rem 1rem;
    }
    
    .nav-sublist {
        margin-left: 0.5rem;
    }
}