/* Synchronism Whitepaper Styles - Clean Structure */
:root {
    --primary-color: #374151;
    --secondary-color: #64748b;
    --background: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --code-bg: #f8fafc;
    --sidebar-width: 300px;
}

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

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

/* Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Download Links */
.download-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: sticky;
    bottom: 1rem;
}

.download-links a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.download-links a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.nav-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

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

.nav-section-title {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-section-title:hover {
    background: rgba(55, 65, 81, 0.05);
}

/* Only show arrow for sections with subsections */
.nav-section.has-subsections .nav-section-title::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.nav-section.has-subsections.collapsed .nav-section-title::after {
    transform: rotate(-90deg);
}

.nav-subsections {
    list-style: none;
    margin-left: 1rem;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
}

.nav-section.collapsed .nav-subsections {
    max-height: 0;
}

.nav-link {
    display: block;
    padding: 0.3rem 0.6rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(55, 65, 81, 0.05);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem 3rem;
    max-width: 900px;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Typography */
h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

h4 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    color: var(--primary-color);
}

p {
    margin-bottom: 1rem;
}

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.3rem;
}

/* Code */
code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

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

pre code {
    background: none;
    padding: 0;
}

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

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

a:hover {
    text-decoration: underline;
}

/* Key Concepts */
.key-concept {
    background: #f0f4f8;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 5px 5px 0;
}

/* Navigation Hints */
.navigation-hints {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .container {
        flex-direction: column;
    }
}
