/* Dark mode color variables */
:root {
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-light: rgba(99, 102, 241, 0.1);
    
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    
    --border: #30363d;
    --border-light: #21262d;
    
    --code-bg: #161b22;
    --code-border: #30363d;
    
    --sidebar-width: 280px;
    --header-height: 60px;
    
    --radius: 6px;
    --radius-sm: 4px;
    
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

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

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.2s;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--bg-tertiary);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link svg {
    flex-shrink: 0;
}

.sidebar-footer-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    margin: 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Main Content */
.site-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.content {
    color: var(--text-primary);
}

/* Typography */
.content h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-top: 0;
}

.content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}

.content h2:first-of-type {
    margin-top: 0;
}

.content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.content p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.content ul,
.content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.content a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Code */
.content code {
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--code-border);
    color: #f85149;
    font-weight: 500;
}

.content pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    display: block;
    color: inherit;
}

/* Syntax highlighting */
.content .highlight {
    background: var(--code-bg);
    border-radius: var(--radius);
    border: 1px solid var(--code-border);
}

.content .highlight pre {
    border: none;
    box-shadow: none;
    margin-bottom: 0;
}

/* Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.content table th,
.content table td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.content table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.content table tr:hover {
    background: var(--bg-tertiary);
}

.content table td {
    color: var(--text-primary);
}

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

.content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

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

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-hover);
}

.separator {
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .site-main {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 2rem 1.25rem;
    }
    
    .content h1 {
        font-size: 2rem;
    }
    
    .content h2 {
        font-size: 1.75rem;
    }
    
    .content h3 {
        font-size: 1.375rem;
    }
    
    .content pre {
        padding: 1rem;
        font-size: 0.8125rem;
    }
    
    .content table {
        font-size: 0.875rem;
    }
    
    .content table th,
    .content table td {
        padding: 0.75rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Center align for homepage */
.content > p[align="center"] {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 2rem 0;
}

/* Improve readability */
.content > p:first-child {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
}
