/* Documentation Styles */

/* Fullscreen container for docs (like chat) */
.docs-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--taskbar-safe-zone);
    z-index: 2;
    display: flex;
    pointer-events: none;
    background: rgba(3, 3, 3, 0.75);
}

.docs-fullscreen > * {
    pointer-events: auto;
}

/* Main docs layout - sidebar + content */
.docs-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
    background: rgba(8, 8, 8, 0.85);
    border-right: 1px solid rgba(255, 176, 120, 0.25);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Search box */
.docs-search {
    position: relative;
}

.docs-search input {
    width: 100%;
    border: 1px solid rgba(255, 176, 120, 0.4);
    background: rgba(3, 3, 3, 0.8);
    color: rgba(255, 245, 235, 0.95);
    padding: 0.6rem 0.9rem;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 140ms ease;
}

.docs-search input:focus {
    border-color: rgba(255, 176, 120, 0.8);
}

.docs-search input::placeholder {
    color: rgba(255, 208, 172, 0.5);
}

.docs-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 176, 120, 0.4);
    border-top: none;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
}

.docs-search-result {
    display: block;
    padding: 0.75rem 0.9rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 176, 120, 0.15);
    transition: background 100ms ease;
}

.docs-search-result:last-child {
    border-bottom: none;
}

.docs-search-result:hover,
.docs-search-result:focus {
    background: rgba(255, 176, 120, 0.1);
}

.docs-search-title {
    display: block;
    color: rgba(255, 235, 222, 0.95);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.docs-search-category {
    display: block;
    color: rgba(255, 208, 172, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.docs-search-empty {
    padding: 1rem;
    color: rgba(255, 208, 172, 0.6);
    text-align: center;
    font-size: 0.85rem;
}

/* Navigation */
.docs-nav {
    flex: 1;
}

.docs-nav-category {
    margin-bottom: 1.25rem;
}

.docs-nav-category-title {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.72rem;
    color: rgba(255, 208, 172, 0.8);
    padding: 0.5rem 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 176, 120, 0.2);
    transition: color 140ms ease;
}

.docs-nav-category-title:hover {
    color: rgba(255, 176, 120, 1);
}

.docs-nav-pages {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
}

.docs-nav-pages li {
    margin: 0;
}

.docs-nav-pages a {
    display: block;
    padding: 0.4rem 0 0.4rem 0.75rem;
    color: rgba(255, 235, 222, 0.75);
    text-decoration: none;
    font-size: 0.88rem;
    border-left: 2px solid transparent;
    transition: color 100ms ease, border-color 100ms ease;
}

.docs-nav-pages a:hover {
    color: rgba(255, 176, 120, 1);
    border-left-color: rgba(255, 176, 120, 0.5);
}

.docs-nav-pages a.is-active {
    color: rgba(255, 176, 120, 1);
    border-left-color: rgba(255, 176, 120, 0.8);
}

/* Main content area */
.docs-main {
    padding: 2rem 3rem;
    overflow-y: auto;
    color: rgba(255, 235, 222, 0.92);
}

/* Breadcrumb */
.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.docs-breadcrumb a {
    color: rgba(255, 208, 172, 0.7);
    text-decoration: none;
    transition: color 100ms ease;
}

.docs-breadcrumb a:hover {
    color: rgba(255, 176, 120, 1);
}

.docs-breadcrumb-sep {
    color: rgba(255, 176, 120, 0.4);
}

.docs-breadcrumb-current {
    color: rgba(255, 235, 222, 0.9);
}

/* Header */
.docs-header {
    margin-bottom: 2rem;
}

.docs-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: 0.04em;
    color: rgba(255, 235, 222, 0.98);
}

.docs-description {
    margin: 0;
    color: rgba(255, 235, 222, 0.75);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Table of contents */
.docs-toc {
    float: right;
    width: 220px;
    margin: 0 0 1.5rem 2rem;
    padding: 1rem;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 176, 120, 0.2);
    font-size: 0.82rem;
    position: sticky;
    top: 1rem;
}

.docs-toc-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 208, 172, 0.7);
}

.docs-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-toc li {
    margin: 0;
}

.docs-toc a {
    display: block;
    padding: 0.25rem 0;
    color: rgba(255, 235, 222, 0.7);
    text-decoration: none;
    transition: color 100ms ease;
}

.docs-toc a:hover {
    color: rgba(255, 176, 120, 1);
}

.docs-toc-level-3 {
    padding-left: 0.75rem;
}

/* Content styling */
.docs-content {
    max-width: 720px;
    line-height: 1.7;
}

.docs-content h2 {
    margin: 2.5rem 0 1rem 0;
    font-size: 1.5rem;
    color: rgba(255, 220, 195, 0.95);
    letter-spacing: 0.03em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 176, 120, 0.2);
}

.docs-content h3 {
    margin: 2rem 0 0.75rem 0;
    font-size: 1.2rem;
    color: rgba(255, 214, 190, 0.92);
}

.docs-content h4 {
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1rem;
    color: rgba(255, 208, 172, 0.9);
}

.docs-content p {
    margin: 0 0 1rem 0;
}

.docs-content ul, .docs-content ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.4rem;
}

.docs-content a {
    color: rgba(255, 176, 120, 0.95);
    text-decoration: underline;
    text-decoration-color: rgba(255, 176, 120, 0.4);
    text-underline-offset: 2px;
    transition: text-decoration-color 100ms ease;
}

.docs-content a:hover {
    text-decoration-color: rgba(255, 176, 120, 0.9);
}

/* Inline code */
.docs-content code {
    background: rgba(255, 176, 120, 0.12);
    padding: 0.15rem 0.4rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    font-size: 0.88em;
    border-radius: 2px;
    color: rgba(255, 220, 195, 0.95);
}

/* Code blocks */
.docs-content pre {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 176, 120, 0.25);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1rem 0 1.5rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.docs-content pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
}

/* Tables */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem 0;
    font-size: 0.9rem;
}

.docs-content th,
.docs-content td {
    padding: 0.6rem 0.9rem;
    text-align: left;
    border: 1px solid rgba(255, 176, 120, 0.25);
}

.docs-content th {
    background: rgba(255, 176, 120, 0.1);
    color: rgba(255, 220, 195, 0.95);
    font-weight: 600;
}

.docs-content td {
    background: rgba(10, 10, 10, 0.4);
}

/* Blockquotes */
.docs-content blockquote {
    margin: 1rem 0 1.5rem 0;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    border-left: 3px solid rgba(255, 176, 120, 0.6);
    background: rgba(255, 176, 120, 0.06);
    color: rgba(255, 235, 222, 0.85);
}

.docs-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Horizontal rules */
.docs-content hr {
    border: none;
    border-top: 1px solid rgba(255, 176, 120, 0.2);
    margin: 2rem 0;
}

/* Category cards on index page */
.docs-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.docs-category-card {
    display: block;
    padding: 1.25rem;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 176, 120, 0.3);
    text-decoration: none;
    transition: border-color 140ms ease, background 140ms ease;
}

.docs-category-card:hover {
    border-color: rgba(255, 176, 120, 0.6);
    background: rgba(255, 176, 120, 0.05);
}

.docs-category-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: rgba(255, 235, 222, 0.95);
}

.docs-category-card p {
    margin: 0 0 0.75rem 0;
    color: rgba(255, 235, 222, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
}

.docs-category-count {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 208, 172, 0.6);
}

/* Responsive */
@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        display: none; /* TODO: Add mobile menu toggle */
    }

    .docs-main {
        padding: 1.5rem;
    }

    .docs-toc {
        float: none;
        width: 100%;
        margin: 0 0 1.5rem 0;
        position: static;
    }
}

/* Chroma syntax highlighting (monokai-inspired, retro orange theme) */
.chroma { background: transparent; }
.chroma .err { color: #f92672; }
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
.chroma .hl { background-color: rgba(255, 176, 120, 0.15); display: block; width: 100%; }
.chroma .lnt { margin-right: 0.6em; padding: 0 0.4em 0 0.4em; color: rgba(255, 208, 172, 0.4); }
.chroma .ln { margin-right: 0.6em; padding: 0 0.4em 0 0.4em; color: rgba(255, 208, 172, 0.4); }
.chroma .k { color: #ff8c55; } /* Keyword */
.chroma .kc { color: #ff8c55; } /* KeywordConstant */
.chroma .kd { color: #ff8c55; } /* KeywordDeclaration */
.chroma .kn { color: #ff8c55; } /* KeywordNamespace */
.chroma .kp { color: #ff8c55; } /* KeywordPseudo */
.chroma .kr { color: #ff8c55; } /* KeywordReserved */
.chroma .kt { color: #ffcc99; } /* KeywordType */
.chroma .n { color: #ffeedd; } /* Name */
.chroma .na { color: #a6e22e; } /* NameAttribute */
.chroma .nb { color: #f8f8f2; } /* NameBuiltin */
.chroma .nc { color: #a6e22e; } /* NameClass */
.chroma .no { color: #ffcc99; } /* NameConstant */
.chroma .nd { color: #a6e22e; } /* NameDecorator */
.chroma .ni { color: #f8f8f2; } /* NameEntity */
.chroma .ne { color: #a6e22e; } /* NameException */
.chroma .nf { color: #a6e22e; } /* NameFunction */
.chroma .nl { color: #f8f8f2; } /* NameLabel */
.chroma .nn { color: #f8f8f2; } /* NameNamespace */
.chroma .nx { color: #a6e22e; } /* NameOther */
.chroma .py { color: #f8f8f2; } /* NameProperty */
.chroma .nt { color: #ff8c55; } /* NameTag */
.chroma .nv { color: #f8f8f2; } /* NameVariable */
.chroma .s { color: #e6db74; } /* LiteralString */
.chroma .sa { color: #e6db74; } /* LiteralStringAffix */
.chroma .sb { color: #e6db74; } /* LiteralStringBacktick */
.chroma .sc { color: #e6db74; } /* LiteralStringChar */
.chroma .dl { color: #e6db74; } /* LiteralStringDelimiter */
.chroma .sd { color: #e6db74; } /* LiteralStringDoc */
.chroma .s2 { color: #e6db74; } /* LiteralStringDouble */
.chroma .se { color: #ae81ff; } /* LiteralStringEscape */
.chroma .sh { color: #e6db74; } /* LiteralStringHeredoc */
.chroma .si { color: #e6db74; } /* LiteralStringInterpol */
.chroma .sx { color: #e6db74; } /* LiteralStringOther */
.chroma .sr { color: #e6db74; } /* LiteralStringRegex */
.chroma .s1 { color: #e6db74; } /* LiteralStringSingle */
.chroma .ss { color: #e6db74; } /* LiteralStringSymbol */
.chroma .m { color: #ae81ff; } /* LiteralNumber */
.chroma .mb { color: #ae81ff; } /* LiteralNumberBin */
.chroma .mf { color: #ae81ff; } /* LiteralNumberFloat */
.chroma .mh { color: #ae81ff; } /* LiteralNumberHex */
.chroma .mi { color: #ae81ff; } /* LiteralNumberInteger */
.chroma .il { color: #ae81ff; } /* LiteralNumberIntegerLong */
.chroma .mo { color: #ae81ff; } /* LiteralNumberOct */
.chroma .o { color: #ff8c55; } /* Operator */
.chroma .ow { color: #ff8c55; } /* OperatorWord */
.chroma .p { color: #f8f8f2; } /* Punctuation */
.chroma .c { color: #75715e; } /* Comment */
.chroma .ch { color: #75715e; } /* CommentHashbang */
.chroma .cm { color: #75715e; } /* CommentMultiline */
.chroma .c1 { color: #75715e; } /* CommentSingle */
.chroma .cs { color: #75715e; } /* CommentSpecial */
.chroma .cp { color: #75715e; } /* CommentPreproc */
.chroma .cpf { color: #75715e; } /* CommentPreprocFile */
.chroma .gd { color: #f92672; } /* GenericDeleted */
.chroma .ge { font-style: italic; } /* GenericEmph */
.chroma .gi { color: #a6e22e; } /* GenericInserted */
.chroma .gs { font-weight: bold; } /* GenericStrong */
.chroma .gu { color: #75715e; } /* GenericSubheading */
