/**
 * Docs/File Viewer Styles
 * Full-screen overlay for browsing and reading documentation and code files
 */

/* Import Roboto font */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap");

/* ===================================== */
/* OVERLAY */
/* ===================================== */

.docs-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: docsOverlayFadeIn 0.2s ease-out;
}

.docs-viewer-overlay.closing {
    animation: docsOverlayFadeOut 0.2s ease-out forwards;
}

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

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

/* ===================================== */
/* CONTAINER */
/* ===================================== */

.docs-viewer-container {
    width: 100%;
    height: 100%;
    max-width: none;
    background: var(--bg-dark, var(--bg-base));
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: docsContainerSlideIn 0.3s ease-out;
}

.docs-viewer-overlay.closing .docs-viewer-container {
    animation: docsContainerSlideOut 0.2s ease-out forwards;
}

@keyframes docsContainerSlideIn {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes docsContainerSlideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }
}

/* ===================================== */
/* HEADER */
/* ===================================== */

.docs-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--sidebar-header-bg, var(--bg-surface));
    border-bottom: 1px solid var(--sidebar-border, var(--bg-surface));
    gap: 20px;
}

.docs-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.docs-header-icon {
    font-size: 1.5rem;
}

.docs-header-left h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-light, var(--text-primary));
    font-weight: 600;
}

.docs-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.docs-folder-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 700px;
}

.docs-folder-input-wrapper {
    flex: 1;
    position: relative;
}

.docs-folder-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg, var(--bg-base));
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 6px;
    color: var(--text-light, var(--text-primary));
    font-size: 0.9rem;
    font-family: monospace;
}

.docs-folder-input:focus {
    outline: none;
    border-color: var(--primary-color, var(--accent-blue));
    box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.2);
}

.docs-load-btn {
    padding: 8px 16px;
    background: var(--primary-color, var(--accent-blue));
    color: var(--bg-dark, var(--bg-base));
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.docs-load-btn:hover {
    background: var(--primary-hover, #22d3ee);
    transform: translateY(-1px);
}

.docs-header-right {
    flex-shrink: 0;
}

.docs-close-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 6px;
    color: var(--text-muted, var(--text-secondary));
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-close-btn:hover {
    background: var(--error-color, var(--accent-red));
    border-color: var(--error-color, var(--accent-red));
    color: white;
}

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

.docs-search-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid #2d323c;
}

.docs-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.docs-search-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 0 10px;
}

.docs-search-input-group:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.docs-search-icon {
    color: var(--text-secondary);
    font-size: 1rem;
}

.docs-search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 0;
    color: #e6edf3;
    font-size: 0.9rem;
    outline: none;
}

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

.docs-search-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-top: 8px;
}

.docs-search-filters-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 4px;
}

.docs-search-filter {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    min-width: 36px;
    text-align: center;
}

.docs-search-filter:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.docs-search-filter.active {
    background: rgba(56, 139, 253, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.docs-search-btn {
    padding: 6px 14px;
    background: var(--accent-green);
    border: 1px solid var(--accent-green);
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.docs-search-btn:hover {
    background: var(--accent-green);
}

.docs-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Search Results Panel */
.docs-search-results {
    display: none;
    flex-direction: column;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--bg-surface);
    max-height: 300px;
    overflow-y: auto;
}

.docs-search-results.visible {
    display: flex;
}

.docs-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.docs-search-results-count {
    color: var(--accent-blue);
    font-weight: 500;
}

.docs-search-results-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.docs-search-results-close:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.docs-search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--bg-surface);
}

.docs-search-result-item:last-child {
    border-bottom: none;
}

.docs-search-result-item:hover {
    background: var(--bg-surface);
}

.docs-search-result-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.docs-search-result-info {
    flex: 1;
    min-width: 0;
}

.docs-search-result-name {
    font-size: 0.9rem;
    color: #e6edf3;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-search-result-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-search-result-match {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.docs-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-secondary);
}

.docs-search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* ===================================== */
/* HISTORY DROPDOWN */
/* ===================================== */

.docs-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--sidebar-bg, var(--bg-surface));
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
    margin-top: 2px;
}

.docs-history-dropdown.visible {
    display: block;
}

.docs-history-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted, var(--text-secondary));
    font-size: 0.9rem;
}

.docs-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--sidebar-border, var(--bg-surface));
}

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

.docs-history-item:hover {
    background: rgba(103, 232, 249, 0.1);
}

.docs-history-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.docs-history-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-history-name {
    font-weight: 500;
    color: var(--text-light, var(--text-primary));
    font-size: 0.9rem;
}

.docs-history-path {
    font-size: 0.75rem;
    color: var(--text-muted, var(--text-secondary));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-history-remove {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted, var(--text-secondary));
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.docs-history-remove:hover {
    background: var(--error-color, var(--accent-red));
    color: white;
}

/* ===================================== */
/* BODY - SPLIT VIEW */
/* ===================================== */

.docs-viewer-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ===================================== */
/* SIDEBAR - FILE TREE */
/* ===================================== */

.docs-sidebar {
    width: 280px;
    min-width: 200px;
    max-width: 400px;
    background: var(--sidebar-bg, var(--bg-surface));
    border-right: 1px solid var(--sidebar-border, var(--bg-surface));
    display: flex;
    flex-direction: column;
    resize: horizontal;
    overflow: hidden;
}

.docs-sidebar-header {
    padding: 10px 16px;
    background: var(--sidebar-header-bg, var(--bg-surface));
    border-bottom: 1px solid var(--sidebar-border, var(--bg-surface));
    font-weight: 600;
    color: var(--text-light, var(--text-primary));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.docs-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.docs-search-modal-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 4px;
    color: var(--text-muted, var(--text-secondary));
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.docs-search-modal-btn:hover {
    background: rgba(56, 139, 253, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.docs-refresh-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 4px;
    color: var(--text-muted, var(--text-secondary));
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.docs-refresh-btn:hover {
    background: rgba(103, 232, 249, 0.1);
    border-color: var(--primary-color, var(--accent-blue));
    color: var(--primary-color, var(--accent-blue));
}

.docs-file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ===================================== */
/* FILE TREE ITEMS */
/* ===================================== */

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

.docs-tree-item {
    margin: 0;
}

.docs-tree-folder,
.docs-tree-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-light, var(--text-primary));
}

/* Colored file/folder icons */
.docs-tree-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.docs-tree-icon.icon-folder {
    color: #f0c36d;
}

.docs-tree-icon.icon-folder-open {
    color: #f5d76e;
}

.docs-tree-icon.icon-md,
.docs-tree-icon.icon-markdown {
    color: #519aba;
}

.docs-tree-icon.icon-txt,
.docs-tree-icon.icon-text {
    color: var(--text-secondary);
}

.docs-tree-icon.icon-java {
    color: #e76f00;
}

.docs-tree-icon.icon-kt,
.docs-tree-icon.icon-kotlin {
    color: #7f52ff;
}

.docs-tree-icon.icon-py,
.docs-tree-icon.icon-python {
    color: #3776ab;
}

.docs-tree-icon.icon-js,
.docs-tree-icon.icon-javascript {
    color: #f7df1e;
}

.docs-tree-icon.icon-ts,
.docs-tree-icon.icon-typescript {
    color: #3178c6;
}

.docs-tree-icon.icon-jsx,
.docs-tree-icon.icon-tsx {
    color: #61dafb;
}

.docs-tree-icon.icon-vue {
    color: #42b883;
}

.docs-tree-icon.icon-html {
    color: #e34f26;
}

.docs-tree-icon.icon-css,
.docs-tree-icon.icon-scss {
    color: #264de4;
}

.docs-tree-icon.icon-json {
    color: #cbcb41;
}

.docs-tree-icon.icon-yaml,
.docs-tree-icon.icon-yml {
    color: #cb171e;
}

.docs-tree-icon.icon-xml {
    color: #e37933;
}

.docs-tree-icon.icon-sh,
.docs-tree-icon.icon-bash {
    color: #89e051;
}

.docs-tree-icon.icon-sql {
    color: #00758f;
}

.docs-tree-icon.icon-go {
    color: #00add8;
}

.docs-tree-icon.icon-rs,
.docs-tree-icon.icon-rust {
    color: #dea584;
}

.docs-tree-icon.icon-c,
.docs-tree-icon.icon-cpp {
    color: #659ad2;
}

.docs-tree-icon.icon-dockerfile,
.docs-tree-icon.icon-docker {
    color: #2496ed;
}

.docs-tree-icon.icon-gradle {
    color: #02303a;
}

.docs-tree-icon.icon-default {
    color: var(--text-secondary);
}

.docs-tree-folder:hover,
.docs-tree-file:hover {
    background: var(--sidebar-hover, rgba(103, 232, 249, 0.1));
}

.docs-tree-file.selected {
    background: var(--primary-color, var(--accent-blue));
    color: var(--bg-dark, var(--bg-base));
}

.docs-tree-file.selected .docs-tree-icon {
    color: var(--bg-dark, var(--bg-base));
}

.docs-tree-icon {
    flex-shrink: 0;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.docs-tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.docs-tree-toggle {
    flex-shrink: 0;
    font-size: 0.65rem;
    color: var(--text-muted, var(--text-secondary));
    transition: transform 0.2s;
    width: 12px;
}

.docs-tree-children {
    list-style: none;
    margin: 0;
    padding-left: 18px;
}

.docs-tree-children.hidden {
    display: none;
}

.docs-tree-markdown .docs-tree-name {
    color: var(--primary-color, var(--accent-blue));
}

.docs-tree-file.selected .docs-tree-name {
    color: var(--bg-dark, var(--bg-base));
}

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

.docs-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-elevated); /* Dark gray, close to black */
}

.docs-content-header {
    padding: 10px 20px;
    background: var(--sidebar-header-bg, var(--bg-surface));
    border-bottom: 1px solid var(--sidebar-border, var(--bg-surface));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.docs-current-file {
    font-weight: 500;
    color: var(--text-light, var(--text-primary));
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-file-icon {
    font-size: 1.1rem;
}

.docs-file-lang {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(103, 232, 249, 0.15);
    color: var(--primary-color, var(--accent-blue));
    border-radius: 4px;
    font-weight: 500;
}

.docs-content-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-action-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 4px;
    color: var(--text-muted, var(--text-secondary));
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.docs-action-btn:hover {
    background: rgba(103, 232, 249, 0.1);
    border-color: var(--primary-color, var(--accent-blue));
    color: var(--primary-color, var(--accent-blue));
}

.docs-file-size {
    font-size: 0.75rem;
    color: var(--text-muted, var(--text-secondary));
}

.docs-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

/* ===================================== */
/* CODE CONTENT - Prism Theme */
/* ===================================== */

/* Prism color variables - IntelliJ Darcula Theme */
.docs-code-content {
    --code-bg: #0d0f12;
    --code-border: #1a1d24;
    --code-text: #a9b7c6;
    --code-comment: #808080;
    --code-punctuation: #a9b7c6;
    --code-keyword: #b267e6;
    --code-string: #6a8759;
    --code-number: #6897bb;
    --code-function: #ffc66d;
    --code-class: #a9b7c6;
    --code-variable: #a9b7c6;
    --code-operator: #a9b7c6;
    --code-attr-name: #bababa;
    --code-attr-value: #6a8759;
    --code-tag: #e8bf6a;
    --code-selector: #b267e6;
    --code-boolean: #b267e6;
    --code-constant: #b267e6;

    background: var(--code-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--code-border);
}

.docs-code-content pre {
    margin: 0;
    padding: 20px 24px;
    background: transparent;
    border: none;
    overflow-x: auto;
}

.docs-code-content pre code {
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--code-text);
}

/* Prism Token Colors */
.docs-code-content .token.comment,
.docs-code-content .token.prolog,
.docs-code-content .token.doctype,
.docs-code-content .token.cdata {
    color: var(--code-comment);
}

.docs-code-content .token.punctuation {
    color: var(--code-punctuation);
}

.docs-code-content .token.operator {
    color: var(--code-operator);
}

.docs-code-content .token.property {
    color: var(--code-attr-name);
}

.docs-code-content .token.tag {
    color: var(--code-tag);
}

.docs-code-content .token.boolean {
    color: var(--code-boolean);
}

.docs-code-content .token.number {
    color: var(--code-number);
}

.docs-code-content .token.constant {
    color: var(--code-constant);
}

.docs-code-content .token.selector {
    color: var(--code-selector);
}

.docs-code-content .token.attr-name {
    color: var(--code-attr-name);
}

.docs-code-content .token.attr-value,
.docs-code-content .token.string,
.docs-code-content .token.char {
    color: var(--code-string);
}

.docs-code-content .token.builtin,
.docs-code-content .token.class-name {
    color: var(--code-class);
}

.docs-code-content .token.keyword {
    color: var(--code-keyword);
    font-style: normal;
}

.docs-code-content .token.regex {
    color: #a5d6ff;
}

.docs-code-content .token.variable {
    color: var(--code-variable);
}

.docs-code-content .token.function {
    color: var(--code-function);
}

.docs-code-content .token.inserted {
    color: #7ee787;
}

.docs-code-content .token.deleted {
    color: #ffa198;
}

.docs-code-content .token.important,
.docs-code-content .token.bold {
    font-weight: bold;
    font-style: normal;
}

.docs-code-content .token.italic {
    font-style: normal;
}

/* Line numbers */
.docs-code-content pre.line-numbers {
    padding-left: 60px;
    position: relative;
}

.docs-code-content .line-numbers-rows {
    position: absolute;
    left: 0;
    top: 20px;
    width: 40px;
    padding-right: 10px;
    text-align: right;
    color: #484f58;
    border-right: 1px solid var(--bg-surface);
    user-select: none;
}

/* ===================================== */
/* MARKDOWN CONTENT - Easy on eyes */
/* ===================================== */

.docs-markdown-content {
    max-width: 900px;
    margin: 0 auto;
    color: #b8c0cc; /* Soft gray - easy on eyes */
    line-height: 1.8;
    font-family:
        "Roboto",
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.docs-markdown-content h1 {
    font-size: 1.9rem;
    margin: 0 0 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #3a3f4b;
    color: #e2e4e9; /* Slightly brighter for headers */
    font-weight: 600;
}

.docs-markdown-content h2 {
    font-size: 1.45rem;
    margin: 2.2rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #2d323c;
    color: #d4d8e0;
    font-weight: 600;
}

.docs-markdown-content h3 {
    font-size: 1.2rem;
    margin: 1.8rem 0 0.8rem;
    color: #a8b5c9; /* Muted blue-gray */
    font-weight: 600;
}

.docs-markdown-content h4,
.docs-markdown-content h5,
.docs-markdown-content h6 {
    margin: 1.2rem 0 0.6rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.docs-markdown-content p {
    margin: 0 0 1.1rem;
}

.docs-markdown-content a {
    color: #7aa2d4; /* Soft muted blue */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.docs-markdown-content a:hover {
    border-bottom-color: #7aa2d4;
}

.docs-markdown-content ul,
.docs-markdown-content ol {
    margin: 0 0 1.1rem;
    padding-left: 1.6rem;
}

.docs-markdown-content li {
    margin: 0.35rem 0;
}

.docs-markdown-content li::marker {
    color: #6b7280;
}

.docs-markdown-content blockquote {
    margin: 1.2rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-surface);
    border-left: 3px solid #4a5568;
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
}

.docs-markdown-content blockquote p:last-child {
    margin-bottom: 0;
}

.docs-markdown-content code {
    background: var(--bg-surface);
    padding: 3px 7px;
    border-radius: 4px;
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-size: 0.88em;
    color: var(--text-primary);
}

.docs-markdown-content pre {
    margin: 1.2rem 0;
    padding: 1.1rem 1.3rem;
    background: var(--bg-surface);
    border: 1px solid #2d323c;
    border-radius: 8px;
    overflow-x: auto;
}

.docs-markdown-content pre code {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #abb2bf;
}

.docs-markdown-content table {
    width: 100%;
    margin: 1.2rem 0;
    border-collapse: collapse;
}

.docs-markdown-content th,
.docs-markdown-content td {
    padding: 10px 14px;
    border: 1px solid #2d323c;
    text-align: left;
}

.docs-markdown-content th {
    background: var(--bg-surface);
    font-weight: 600;
    color: #c9cdd4;
}

.docs-markdown-content tr:nth-child(even) {
    background: rgba(31, 35, 40, 0.5);
}

.docs-markdown-content hr {
    margin: 2.2rem 0;
    border: none;
    border-top: 1px solid #2d323c;
}

.docs-markdown-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Strong/Bold - slightly brighter */
.docs-markdown-content strong,
.docs-markdown-content b {
    color: #d1d5db;
    font-weight: 600;
}

/* Emphasis/Italic */
.docs-markdown-content em,
.docs-markdown-content i {
    color: #a8b2c1;
}

/* ===================================== */
/* WELCOME STATE */
/* ===================================== */

.docs-welcome {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.docs-welcome h3 {
    color: var(--text-light, var(--text-primary));
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.docs-welcome p {
    color: var(--text-muted, var(--text-secondary));
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.docs-features {
    text-align: left;
    margin: 0 0 2rem;
    padding-left: 1.5rem;
    color: var(--text-light, var(--text-primary));
}

.docs-features li {
    margin: 0.5rem 0;
}

.docs-history-section h4 {
    color: var(--text-light, var(--text-primary));
    margin: 0 0 1rem;
    font-size: 1rem;
}

.docs-welcome-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.docs-welcome-history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--sidebar-bg, var(--bg-surface));
    border: 1px solid var(--sidebar-border, var(--bg-surface));
    border-radius: 8px;
    color: var(--text-light, var(--text-primary));
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.docs-welcome-history-item:hover {
    background: rgba(103, 232, 249, 0.1);
    border-color: var(--primary-color, var(--accent-blue));
}

/* ===================================== */
/* STATES */
/* ===================================== */

.docs-empty-state,
.docs-loading,
.docs-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted, var(--text-secondary));
}

.docs-loading {
    gap: 12px;
}

.docs-spinner {
    font-size: 2rem;
    animation: docsSpin 1s linear infinite;
}

@keyframes docsSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.docs-error {
    color: var(--error-color, var(--accent-red));
    gap: 12px;
}

.docs-error-icon {
    font-size: 2rem;
}

.docs-error p {
    margin: 0;
}

/* ===================================== */
/* MARKDOWN PREVIEW TOGGLE */
/* ===================================== */

.docs-preview-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.docs-preview-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.docs-preview-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.docs-preview-btn.active {
    background: rgba(56, 139, 253, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.docs-preview-btn .icon {
    font-size: 1rem;
}

/* Raw markdown view */
.docs-raw-markdown {
    white-space: pre-wrap;
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-elevated);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

/* Syntax highlighted code in docs viewer */
.docs-code-content pre {
    margin: 0;
    padding: 16px;
    background: #0d0f12 !important;
    border-radius: 8px;
    overflow-x: auto;
}

.docs-code-content pre code {
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: transparent !important;
}

/* Prism overrides - IntelliJ Darcula Theme */
.docs-code-content .token.comment,
.docs-code-content .token.prolog,
.docs-code-content .token.doctype,
.docs-code-content .token.cdata {
    color: #808080;
    font-style: normal;
}

.docs-code-content .token.punctuation {
    color: #a9b7c6;
}

.docs-code-content .token.property,
.docs-code-content .token.constant {
    color: #b267e6;
}

.docs-code-content .token.tag {
    color: #e8bf6a;
}

.docs-code-content .token.boolean {
    color: #b267e6;
}

.docs-code-content .token.number {
    color: #6897bb;
}

.docs-code-content .token.symbol,
.docs-code-content .token.deleted {
    color: #6a8759;
}

.docs-code-content .token.selector {
    color: #b267e6;
}

.docs-code-content .token.attr-name {
    color: #bababa;
}

.docs-code-content .token.string,
.docs-code-content .token.char,
.docs-code-content .token.inserted {
    color: #6a8759;
}

.docs-code-content .token.builtin {
    color: #ffc66d;
}

.docs-code-content .token.operator,
.docs-code-content .token.entity,
.docs-code-content .token.url,
.docs-code-content .language-css .token.string,
.docs-code-content .style .token.string {
    color: #a9b7c6;
}

.docs-code-content .token.atrule,
.docs-code-content .token.attr-value {
    color: #6a8759;
}

.docs-code-content .token.keyword {
    color: #b267e6;
    font-style: normal;
}

.docs-code-content .token.function {
    color: #ffc66d;
}

.docs-code-content .token.class-name {
    color: #a9b7c6;
}

.docs-code-content .token.regex {
    color: #6a8759;
}

.docs-code-content .token.important {
    color: #b267e6;
    font-weight: bold;
    font-style: normal;
}

.docs-code-content .token.variable {
    color: #a9b7c6;
}

/* ===================================== */
/* MERMAID DIAGRAMS */
/* ===================================== */

.mermaid-diagram {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--sidebar-bg, var(--bg-surface));
    border-radius: 8px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
}

.mermaid-diagram svg {
    max-width: 100%;
}

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

@media (max-width: 768px) {
    .docs-viewer-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .docs-viewer-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .docs-header-center {
        order: 3;
        width: 100%;
    }

    .docs-folder-input-group {
        max-width: none;
    }

    .docs-sidebar {
        width: 200px;
        min-width: 150px;
    }

    .docs-content-body {
        padding: 16px;
    }
}
