/* Depthkit Docs - Clean documentation theme */

:root {
    --primary: #222;
    --secondary: #fff;
    --tertiary: #0088cc;
    --header-bg: #ffffff;
    --header-border: #e1e4e8;
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #e1e4e8;
    --sidebar-bg: #ffffff;
    --sidebar-width: 280px;
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #888;
    --link-color: #0088cc;
    --accent: #0064ff;
    --code-bg: #f4f5f7;
    --callout-info-bg: #e8f4fd;
    --callout-info-border: #0088cc;
    --callout-warn-bg: #fff8e1;
    --callout-warn-border: #f59e0b;
    --callout-danger-bg: #fef2f2;
    --callout-danger-border: #ef4444;
    --callout-success-bg: #f0fdf4;
    --callout-success-border: #22c55e;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --max-width: 1200px;
}

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

body {
    font-family: var(--font-stack);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--body-bg);
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.site-logo img {
    height: 28px;
    width: auto;
}

.site-title {
    font-size: 17px;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-nav a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
}

.header-nav a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.nav-external {
    border-left: 1px solid var(--card-border);
    padding-left: 20px !important;
}

/* Layout */
.site-layout {
    display: flex;
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: calc(100vh - 120px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    overflow-y: auto;
    position: sticky;
    top: 49px;
    height: calc(100vh - 49px);
    padding: 20px 0;
}

.sidebar-toggle {
    display: none;
}

.sidebar-nav {
    padding: 0 16px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 4px 8px;
    margin-bottom: 4px;
}

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

.nav-link {
    display: block;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 4px;
    line-height: 1.4;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,0.04);
    text-decoration: none;
}

.nav-link-active {
    color: var(--accent) !important;
    font-weight: 600;
    background: rgba(0, 100, 255, 0.06);
}

.nav-subsection {
    margin-top: 2px;
}

.nav-subsection-title {
    display: block;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: 4px;
}

.nav-subsection-title:hover {
    text-decoration: none;
    background: rgba(0,0,0,0.04);
}

.nav-sublist {
    list-style: none;
    padding-left: 12px;
    border-left: 1px solid var(--card-border);
    margin-left: 14px;
    margin-top: 2px;
    display: none;
}

.nav-subsection-active > .nav-sublist {
    display: block;
}

.nav-section-active .nav-sublist {
    /* Show sublists in active sections */
}

/* Main content */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 32px 48px;
    max-width: calc(var(--max-width) - var(--sidebar-width));
}

.main-content-wide {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Doc article */
.doc-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.doc-breadcrumb a {
    color: var(--text-muted);
}

.doc-breadcrumb a:hover {
    color: var(--link-color);
}

.breadcrumb-sep {
    margin: 0 6px;
}

.doc-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    line-height: 1.2;
}

.doc-body {
    line-height: 1.7;
}

.doc-body h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}

.doc-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.doc-body h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 8px;
}

.doc-body p {
    margin: 0 0 16px;
}

.doc-body ul, .doc-body ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.doc-body li {
    margin-bottom: 4px;
}

.doc-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
}

.doc-body .doc-figure {
    margin: 16px 0;
    text-align: center;
}

.doc-body .doc-figure img {
    max-width: 100%;
    border-radius: 6px;
}

.doc-body .doc-figure figcaption {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.doc-body code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
}

.doc-body pre {
    background: #282c34;
    color: #abb2bf;
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0 0 16px;
    line-height: 1.5;
}

.doc-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 14px;
    color: inherit;
}

.doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 14px;
}

.doc-body th, .doc-body td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid var(--card-border);
}

.doc-body th {
    background: var(--code-bg);
    font-weight: 600;
}

.doc-body blockquote {
    border-left: 4px solid var(--callout-info-border);
    background: var(--callout-info-bg);
    padding: 12px 16px;
    margin: 0 0 16px;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
}

.doc-body blockquote p:last-child {
    margin-bottom: 0;
}

.doc-body hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 32px 0;
}

/* Glossary terms */
.glossary-term {
    font-weight: 500;
    border-bottom: 1px dashed var(--text-muted);
    cursor: help;
}

/* Video embeds */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 16px 0;
    border-radius: 6px;
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pagination */
.doc-pagination {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.pagination-prev, .pagination-next {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    max-width: 48%;
    transition: border-color 0.15s;
}

.pagination-prev:hover, .pagination-next:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.pagination-next {
    text-align: right;
    margin-left: auto;
}

.pagination-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pagination-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 2px;
}

/* Home page */
.home-hero {
    text-align: center;
    padding: 48px 20px 40px;
}

.home-hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.home-hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.home-search {
    margin-top: 24px;
}

.home-search-btn {
    display: inline-block;
    padding: 10px 32px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.home-search-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
}

.home-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 20px 48px;
    max-width: 900px;
    margin: 0 auto;
}

.home-section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 24px;
}

.home-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.home-section-links {
    list-style: none;
}

.home-section-links li {
    margin-bottom: 6px;
}

.home-section-links a {
    font-size: 14px;
    color: var(--link-color);
}

/* Search page */
.search-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

.search-box {
    margin-bottom: 24px;
}

#search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--card-border);
    border-radius: 8px;
    outline: none;
    font-family: var(--font-stack);
    transition: border-color 0.15s;
}

#search-input:focus {
    border-color: var(--accent);
}

.search-hint, .search-no-results {
    color: var(--text-muted);
    font-size: 14px;
}

.search-result {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    transition: background 0.1s;
}

.search-result:hover {
    background: rgba(0,0,0,0.03);
    text-decoration: none;
}

.search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.search-result-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.search-result-snippet {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 404 */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 72px;
    color: var(--card-border);
    margin-bottom: 16px;
}

.error-page p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--card-border);
    background: var(--card-bg);
    padding: 16px 20px;
    text-align: center;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    font-size: 13px;
    color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 49px;
        width: 280px;
        z-index: 99;
        transition: left 0.25s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }

    .sidebar.sidebar-open {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 101;
        background: var(--accent);
        border: none;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    .sidebar-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: white;
        border-radius: 1px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .doc-title {
        font-size: 24px;
    }

    .home-hero h1 {
        font-size: 28px;
    }
}
