:root {
    --primary-blue: #0f172a;
    --secondary-blue: #1e293b;
    --accent-blue: #3b82f6;
    --light-blue: #60a5fa;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --code-bg: #f1f5f9;
    --table-bg: #ffffff;
    --table-hover: #f1f5f9;
    --code-surface: #0b1224;
    --code-surface-text: #e2e8f0;
    --footer-bg: #0b1220;
    --footer-text: #e2e8f0;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-blue: #e5e7eb;
    --secondary-blue: #cbd5e1;
    --accent-blue: #60a5fa;
    --light-blue: #8ab4ff;
    --text-primary: #e5e7eb;
    --text-secondary: #c7d2fe;
    --bg-light: #0b1220;
    --border-color: #273249;
    --nav-bg: rgba(13, 19, 33, 0.94);
    --card-bg: #111827;
    --code-bg: #111827;
    --table-bg: #0f172a;
    --table-hover: rgba(96, 165, 250, 0.14);
    --code-surface: #0f172a;
    --code-surface-text: #e5e7eb;
    --footer-bg: #0b1220;
    --footer-text: #e5e7eb;
}

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

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

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    height: 45px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.12);
}

.nav-links a.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.18);
}

/* Toggle Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toggle-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.toggle-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.toggle-icon {
    font-size: 1rem;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 70px;
    gap: 2rem;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 2rem 1rem 2rem 2rem;
}

.toc-sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

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

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

.toc-list a:hover {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding-left: 1.2rem;
}

/* Content Area */
.content {
    padding: 2rem 2rem 4rem 0;
    max-width: 900px;
}

.doc-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.doc-header h1 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.doc-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Typography */
h2 {
    font-size: 2rem;
    color: var(--primary-blue);
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin: 2.5rem 0 1rem;
}

h4 {
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin: 2rem 0 1rem;
}

p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    line-height: 1.7;
}

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

li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Code Blocks */
code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e11d48;
}

pre {
    background: var(--code-surface);
    color: var(--code-surface-text);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Info Boxes */
.info-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-left: 4px solid var(--accent-blue);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--table-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

th {
    background: var(--accent-blue);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

tr:hover {
    background: var(--table-hover);
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-yuften {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-yuften img {
    height: 25px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

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

    .toc-sidebar {
        display: none;
    }

    .content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .doc-header h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}
