/* Modern Dark Theme - Premium Guide Design */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Color Palette */
    --bg-primary: #0a0a0c;
    --bg-secondary: #131316;
    --bg-tertiary: #1c1c21;
    
    --text-primary: #f2f2f2;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --accent-primary: #6366f1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.15);
    --border-color: #2a2a30;
    
    --code-bg: #1e1e24;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    
    /* Layout */
    --sidebar-width: 280px;
    --content-max-width: 800px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

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

.toc-nav li {
    margin-bottom: var(--spacing-xs);
}

.toc-nav a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-nav a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.toc-nav a.active {
    color: var(--accent-primary);
    background-color: var(--accent-glow);
    border-left-color: var(--accent-primary);
}

.toc-nav .toc-h3 {
    padding-left: 2rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    padding: var(--spacing-lg) var(--spacing-md);
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Markdown Content Styling */
#content {
    animation: fadeIn 0.5s ease-out;
}

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

h1, h2, h3, h4, h5, h6 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
    position: relative;
}

h1 { font-size: 2.5rem; font-weight: 700; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-top: 0; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    leading-trim: both;
    text-edge: cap;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

a:hover {
    border-bottom-color: var(--accent-primary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Lists */
ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5rem;
}

li::marker {
    color: var(--accent-primary);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    background-color: var(--bg-tertiary);
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-primary);
}

/* Code Blocks */
pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

p code, li code {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #e2e8f0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

/* Mobile Toggle */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none; /* Hidden by default on mobile, can be toggled */
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        z-index: 50;
    }

    .sidebar.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    .main-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}
