/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #0066cc;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
}

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

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.05em;
}

.subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
}

.nav-menu {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-item {
    display: block;
    padding: 0.625rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
}

.nav-item.sub-item {
    padding-left: 2.5rem;
    font-size: 0.85rem;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.mobile-menu-btn {
    display: none;
    width: 30px;
    height: 24px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.mobile-menu-btn span:first-child { top: 0; }
.mobile-menu-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.mobile-menu-btn span:last-child { bottom: 0; }

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.header-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Content */
.content {
    padding-top: var(--header-height);
    background: var(--bg-white);
    min-height: calc(100vh - var(--header-height));
}

.section {
    padding: 1.5rem 0;
}


.section-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: left;
}

.section h1, .section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.section h1 {
    font-size: 2rem;
    font-weight: 700;
}

.section h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 1.5rem 0 0.75rem;
}

.section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 1.25rem 0 0.5rem;
}

.section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.section ul, .section ol {
    margin: 0 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.section li {
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

/* Code blocks */
.section pre {
    background: #282c34;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.section code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.section p code,
.section li code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--accent-color);
    font-size: 0.85rem;
}

/* Tables */
.section table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    background: var(--bg-white);
}

.section table th {
    background: var(--bg-light);
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.section table tr:hover {
    background: var(--bg-light);
}

/* Blockquotes */
.section blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Links */
.section a {
    color: var(--accent-color);
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        left: 0;
        padding: 0 1rem;
    }
    
    .mobile-menu-btn {
        display: block;
        margin-right: 1rem;
    }
    
    .content {
        padding-top: var(--header-height);
    }
    
    .section-container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .section h1 {
        font-size: 1.75rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .section h3 {
        font-size: 1.1rem;
    }
}

/* Loading state */
.loading {
    text-align: left;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}