:root {
    --background: #222222;
    --background-light: #2a2a2a;
    --black: #000000;
    --grey: #666666;
    --grey-dark: #333333;

    --red: #F57F6C;
    --red-light: #FCB5AA;
    --green: #52B87A;
    --green-light: #91D4A8;
    --yellow: #D99530;
    --yellow-light: #E9BE74;
    --blue: #498DD1;
    --blue-light: #7FB6ED;
    --magenta: #F88AAF;
    --magenta-light: #FCACC5;
    --cyan: #32C5D2;
    --cyan-light: #5EDEE3;
    --white: #FFFFFF;
}

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

body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--background);
    color: var(--white);
    padding: 0;
}

.container {
    max-width: 1400px;  /* More reasonable max width */
    padding: 3rem 5rem;  /* Adjusted padding */
}

/* Header */
header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--grey);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

header h1 a {
    color: var(--red);
    text-decoration: none;
}

header h1 a:hover {
    color: var(--red-light);
}

.subtitle {
    color: var(--grey);
    font-size: 0.9rem;
}

/* Search */
.search-container {
    margin-bottom: 2rem;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--background);
    border: 1px solid var(--grey);
    border-radius: 2px;
    padding: 0.5rem 0.75rem;
}

.prompt {
    color: var(--cyan);
    margin-right: 0.5rem;
    font-weight: 500;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--white);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
}

#search-input::placeholder {
    color: var(--grey);
}

.search-results {
    margin-top: 1rem;
}

.search-result {
    background-color: var(--background-light);
    border: 1px solid var(--grey);
    border-radius: 2px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.search-result:hover {
    border-color: var(--cyan-light);
}

.search-result a {
    color: var(--white);
    text-decoration: none;
    display: block;
}

.search-result h3 {
    color: var(--green);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.search-result .snippet {
    color: var(--grey);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.search-result mark {
    background-color: rgba(173, 149, 233, 0.16);
    color: var(--green);
}

/* Docs List */
.docs-list h2 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.doc-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--grey);
}

.doc-item:last-child {
    border-bottom: none;
}

.doc-item a {
    color: var(--white);
    text-decoration: none;
    display: block;
}

.doc-item h3 {
    color: var(--green);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.doc-item a:hover h3 {
    color: var(--green-light);
}

.meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--grey);
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    color: var(--blue-light);
}

/* Single Doc */
.doc-single {
    max-width: 1200px;  /* Increased from 800px */
}

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

.doc-header h1 {
    color: var(--green);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.doc-content {
    margin-bottom: 2rem;
}

.doc-content h2 {
    color: var(--cyan);
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem 0;
    font-weight: 500;
}

.doc-content h3 {
    color: var(--yellow-light);
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem 0;
    font-weight: 500;
}

.doc-content p {
    margin-bottom: 1rem;
}

.doc-content ul,
.doc-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.doc-content li {
    margin-bottom: 0.25rem;
}

.doc-content code {
    background-color: none;
    color: var(--white);
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    font-size: 0.9em;
}

.doc-content pre {
    background-color: var(--background-light);
    border: 1px solid var(--grey);
    border-radius: 2px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.doc-content pre code {
    background: none;
    padding: 0;
}

.doc-content a {
    color: var(--cyan);
    text-decoration: underline;
}

.doc-content a:hover {
    color: var(--cyan-light);
}

.doc-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--grey);
}

.back-link {
    color: var(--grey);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--cyan-light);
}

.highlight {
    background-color: var(--background-light);
    border: 1px solid var(--grey);
    border-radius: 2px;
    padding: 1.0rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.highlight pre {
    background: none !important;
    background-color: transparent;
    padding: 0;
    margin: 0;
    border: 0;
}

.highlight .c { color: var(--grey); } /* Comment */
.highlight .k { color: var(--red); } /* Keyword */
.highlight .s { color: var(--green); } /* String */
.highlight .n { color: var(--blue); } /* Name */
.highlight .o { color: var(--cyan); } /* Operator */


/* Graphics */
.doc-content img.centered-svg {
    display: block;
    margin: 0 auto;
}


/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--grey);
    color: var(--grey);
    font-size: 0.85rem;
}

kbd {
    background-color: var(--background-light);
    border: 1px solid var(--grey);
    border-radius: 2px;
    padding: 0.1rem 0.4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

/* Selection */
::selection {
    background-color: rgba(173, 149, 233, 0.16);
    color: var(--green);
}

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

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

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

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

/* Responsive adjustments to maintain vim feel */
@media (max-width: 1400px) {
    .container {
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }
    
    .doc-single {
        max-width: 100%;
    }
}


.docs-header {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--grey);
    border-radius: 2px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: all 0.15s;
    border-right: 1px solid var(--grey);
}

.filter-btn:last-child {
    border-right: none;
}

.filter-btn:hover:not(.active) {
    background: var(--background-light);
}

.filter-btn.active {
    background: var(--green);
    color: var(--background);
}

.filter-separator {
    display: none;
}

.docs-section {
    animation: fadeIn 0.15s ease-in;
}

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