/* --- General Styling & Variables --- */
:root {
    --bg-color: #1a1a1d;
    --sidebar-bg: #222226;
    --text-color: #e2e2e2;
    --primary-color: #4f8af4;
    --secondary-color: #99aab5;
    --border-color: #3a3a40;
    --code-bg: #2c2c31;
    --highlight-bg: #4f8af430;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Layout: Sidebar and Main Content --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.content {
    margin-left: 260px; /* Same as sidebar width */
    padding: 40px;
}

/* --- Sidebar Navigation Styling --- */
.sidebar h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li a {
    display: block;
    color: var(--secondary-color);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
}

.sidebar ul li a:hover {
    background-color: var(--highlight-bg);
    color: var(--text-color);
}

.sidebar ul li a.active {
    background-color: var(--primary-color);
    color: #fff;
}

.sidebar ul li a.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

/* --- Main Content Styling --- */
.content header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.content section {
    margin-bottom: 60px;
    scroll-margin-top: 20px; /* Offset for active link highlighting */
}

.content h2 {
    font-size: 2rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* --- Documentation Item Styling --- */
.doc-item {
    margin-bottom: 30px;
}

.doc-item h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

.doc-item code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.doc-item .return-type {
    font-style: italic;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-left: 10px;
}

.doc-item p, .doc-item ul {
    margin-left: 10px;
}

/* --- Code Block Styling (PrismJS override) --- */
pre[class*="language-"] {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.2em !important; /* Override default padding */
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .content {
        margin-left: 0;
        padding: 20px;
    }
}