/* ===========================================
   SIMPLERLLM DOCS - Layout & Navigation
   =========================================== */

/* ===========================================
   TWO-COLUMN LAYOUT
   =========================================== */

.sllm-docs-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 100px);
    position: relative;
}

/* ===========================================
   SIDEBAR
   =========================================== */

.sllm-docs-sidebar {
    background: var(--sllm-bg);
    border-right: 1px solid var(--sllm-border-light);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sllm-docs-sidebar-inner {
    padding: 20px 0;
}

/* Sidebar Scrollbar */
.sllm-docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.sllm-docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sllm-docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--sllm-border);
    border-radius: 4px;
}

.sllm-docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--sllm-primary);
}

/* ===========================================
   SEARCH
   =========================================== */

.sllm-docs-search {
    padding: 0 16px 16px;
    border-bottom: 1px solid var(--sllm-border-light);
    margin-bottom: 12px;
}

.sllm-docs-search-wrapper {
    position: relative;
}

.sllm-docs-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sllm-text-light);
    pointer-events: none;
}

.sllm-docs-search-input {
    width: 100%;
    padding: 8px 32px 8px 34px;
    border: 1px solid var(--sllm-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--sllm-bg-subtle);
    color: var(--sllm-text);
    transition: border-color 0.15s, background 0.15s;
}

.sllm-docs-search-input:focus {
    outline: none;
    border-color: var(--sllm-primary);
    background: var(--sllm-bg);
}

.sllm-docs-search-input::placeholder {
    color: var(--sllm-text-light);
}

.sllm-docs-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--sllm-text-light);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sllm-docs-search-clear:hover {
    color: var(--sllm-text);
}

.sllm-docs-search-clear.hidden {
    display: none;
}

.sllm-docs-no-results {
    padding: 24px 16px;
    text-align: center;
    color: var(--sllm-text-muted);
    font-size: 13px;
}

.sllm-docs-no-results.hidden {
    display: none;
}

/* ===========================================
   NAVIGATION
   =========================================== */

.sllm-docs-nav {
    padding: 0 8px;
}

.sllm-docs-nav-section {
    margin-bottom: 20px;
}

.sllm-docs-nav-section.filtered-hidden {
    display: none;
}

.sllm-docs-nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sllm-text-muted);
    padding: 0 8px;
    margin-bottom: 6px;
}

.sllm-docs-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sllm-docs-nav-link {
    display: block;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--sllm-text-secondary);
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid transparent;
    margin-left: 2px;
    transition: all 0.15s;
}

.sllm-docs-nav-link:hover {
    color: var(--sllm-text);
    background: var(--sllm-bg-subtle);
}

.sllm-docs-nav-link--active {
    color: var(--sllm-primary);
    background: var(--sllm-bg-accent);
    border-left-color: var(--sllm-primary);
    font-weight: 500;
}

.sllm-docs-nav-link.filtered-hidden {
    display: none;
}

/* ===========================================
   MAIN CONTENT AREA
   =========================================== */

.sllm-docs-main {
    padding: 32px 48px;
    max-width: 800px;
}

.sllm-docs-article {
    line-height: 1.7;
}

/* Breadcrumb */
.sllm-docs-breadcrumb {
    font-size: 13px;
    color: var(--sllm-text-light);
    margin-bottom: 16px;
}

.sllm-docs-breadcrumb a {
    color: var(--sllm-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.sllm-docs-breadcrumb a:hover {
    color: var(--sllm-primary);
}

.sllm-docs-breadcrumb-sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* Title */
.sllm-docs-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--sllm-text);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* Content */
.sllm-docs-content {
    color: var(--sllm-text-secondary);
    font-size: 15px;
}

.sllm-docs-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--sllm-text);
    margin-top: 40px;
    margin-bottom: 16px;
}

.sllm-docs-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--sllm-text);
    margin-top: 32px;
    margin-bottom: 12px;
}

.sllm-docs-content p {
    margin-bottom: 16px;
}

/* Inline code */
.sllm-docs-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    background: var(--sllm-bg-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--sllm-primary);
}

/* Code Block Container (added by JS) */
.sllm-code-block {
    position: relative;
    margin: 20px 0;
}

/* Code Block */
.sllm-docs-content pre {
    background: #1e1e2e;
    border: none;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 0;
}

.sllm-code-block pre {
    padding-top: 44px;
}

.sllm-docs-content pre code {
    background: none;
    padding: 0;
    color: #cdd6f4;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Copy Button */
.sllm-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: system-ui, -apple-system, sans-serif;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sllm-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #cdd6f4;
}

.sllm-copy-btn.copied {
    color: #a6e3a1;
    border-color: rgba(166, 227, 161, 0.3);
}

.sllm-copy-btn svg {
    width: 14px;
    height: 14px;
}

/* ===========================================
   PRISM SYNTAX HIGHLIGHTING OVERRIDES
   =========================================== */

/* Override Prism background to match our theme */
.sllm-docs-content pre[class*="language-"],
.sllm-docs-content code[class*="language-"] {
    background: #1e1e2e;
    text-shadow: none;
}

/* Catppuccin Mocha-inspired token colors */
.sllm-docs-content .token.comment,
.sllm-docs-content .token.prolog,
.sllm-docs-content .token.doctype,
.sllm-docs-content .token.cdata {
    color: #6c7086;
}

.sllm-docs-content .token.punctuation {
    color: #bac2de;
}

.sllm-docs-content .token.property,
.sllm-docs-content .token.tag,
.sllm-docs-content .token.boolean,
.sllm-docs-content .token.number,
.sllm-docs-content .token.constant,
.sllm-docs-content .token.symbol {
    color: #fab387;
}

.sllm-docs-content .token.selector,
.sllm-docs-content .token.attr-name,
.sllm-docs-content .token.string,
.sllm-docs-content .token.char,
.sllm-docs-content .token.builtin {
    color: #a6e3a1;
}

.sllm-docs-content .token.operator,
.sllm-docs-content .token.entity,
.sllm-docs-content .token.url,
.sllm-docs-content .language-css .token.string,
.sllm-docs-content .style .token.string {
    color: #89dceb;
}

.sllm-docs-content .token.atrule,
.sllm-docs-content .token.attr-value,
.sllm-docs-content .token.keyword {
    color: #cba6f7;
}

.sllm-docs-content .token.function,
.sllm-docs-content .token.class-name {
    color: #89b4fa;
}

.sllm-docs-content .token.regex,
.sllm-docs-content .token.important,
.sllm-docs-content .token.variable {
    color: #f9e2af;
}

.sllm-docs-placeholder {
    padding: 40px;
    background: var(--sllm-bg-subtle);
    border: 1px dashed var(--sllm-border);
    border-radius: 12px;
    text-align: center;
    color: var(--sllm-text-muted);
}

/* Note/Callout Box */
.sllm-docs-note {
    background: var(--sllm-bg-accent);
    border-left: 3px solid var(--sllm-primary);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 14px;
}

.sllm-docs-note strong {
    color: var(--sllm-primary);
}

/* Lists */
.sllm-docs-content ul,
.sllm-docs-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.sllm-docs-content li {
    margin-bottom: 8px;
}

/* Tables */
.sllm-docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.sllm-docs-table th,
.sllm-docs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--sllm-border-light);
}

.sllm-docs-table th {
    background: var(--sllm-bg-subtle);
    font-weight: 600;
    color: var(--sllm-text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sllm-docs-table tr:hover {
    background: var(--sllm-bg-subtle);
}

.sllm-docs-table code {
    font-size: 12px;
}

/* Tables within doc content (markdown-rendered) */
.sllm-docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border: 1px solid var(--sllm-border-light);
    border-radius: 8px;
    overflow: hidden;
}

.sllm-docs-content table th,
.sllm-docs-content table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--sllm-border-light);
}

.sllm-docs-content table th {
    background: var(--sllm-bg-subtle);
    font-weight: 600;
    color: var(--sllm-text);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sllm-docs-content table tr:last-child td {
    border-bottom: none;
}

.sllm-docs-content table tr:hover {
    background: var(--sllm-bg-subtle);
}

.sllm-docs-content table code {
    font-size: 12px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--sllm-primary);
}

/* ===========================================
   MOBILE SIDEBAR TOGGLE
   =========================================== */

.sllm-docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: var(--sllm-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(83, 74, 183, 0.3);
    align-items: center;
    gap: 8px;
}

.sllm-docs-sidebar-toggle:hover {
    background: var(--sllm-primary-hover);
}

/* Overlay */
.sllm-docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}

.sllm-docs-overlay.active {
    display: block;
}

/* ===========================================
   MOBILE RESPONSIVE
   =========================================== */

@media (max-width: 900px) {
    .sllm-docs-layout {
        grid-template-columns: 1fr;
    }

    .sllm-docs-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--sllm-border);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sllm-docs-sidebar.open {
        transform: translateX(0);
    }

    .sllm-docs-sidebar-toggle {
        display: flex;
    }

    .sllm-docs-main {
        padding: 24px 20px;
    }

    .sllm-docs-title {
        font-size: 26px;
    }
}

@media (max-width: 640px) {
    .sllm-docs-main {
        padding: 20px 16px;
    }

    .sllm-docs-title {
        font-size: 24px;
    }

    .sllm-docs-content {
        font-size: 14px;
    }
}

/* ===========================================
   DESCRIPTION & PLAYGROUND BUTTON
   =========================================== */

.sllm-docs-description {
    color: var(--sllm-text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.sllm-docs-playground-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--sllm-primary);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 32px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sllm-docs-playground-btn:hover {
    background: var(--sllm-primary-dark, #4338ca);
    transform: translateY(-1px);
}

.sllm-docs-playground-btn svg {
    flex-shrink: 0;
}

/* ===========================================
   PREV/NEXT NAVIGATION
   =========================================== */

.sllm-docs-nav-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--sllm-border);
}

.sllm-docs-nav-prev,
.sllm-docs-nav-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: var(--sllm-bg-subtle);
    border: 1px solid var(--sllm-border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-width: 0;
    flex: 1;
    max-width: 280px;
}

.sllm-docs-nav-prev:hover,
.sllm-docs-nav-next:hover {
    border-color: var(--sllm-primary);
    background: var(--sllm-bg);
}

.sllm-docs-nav-next {
    text-align: right;
    margin-left: auto;
}

.sllm-docs-nav-label {
    font-size: 12px;
    color: var(--sllm-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sllm-docs-nav-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--sllm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .sllm-docs-nav-footer {
        flex-direction: column;
        gap: 12px;
    }

    .sllm-docs-nav-prev,
    .sllm-docs-nav-next {
        max-width: none;
    }

    .sllm-docs-nav-next {
        text-align: left;
    }
}
