/* kcml-nav.css — Static sidebar navigation styles for KCML Reference Manual */
/* DevExtreme 25.2 served locally from /shared/devexpress/ */

/* ── Body layout override ─────────────────────────────────────────────────── */
body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.kcml-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    flex: 0 0 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    background: #f4f4f4;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ── Logo area ────────────────────────────────────────────────────────────── */
.kcml-logo {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.kcml-logo img {
    width: 140px;
    height: auto;
}

/* ── Tree container (DevExtreme renders inside) ───────────────────────────── */
#kcml-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ── Search area ──────────────────────────────────────────────────────────── */
.kcml-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

#kcml-searchbox {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ── Search results ───────────────────────────────────────────────────────── */
#kcml-search-results {
    padding: 0 8px 8px;
    overflow-y: auto;
    max-height: 300px;
    font-size: 0.85rem;
}

#kcml-search-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#kcml-search-results li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

#kcml-search-results a {
    font-weight: bold;
    display: block;
}

#kcml-search-results small {
    color: #555;
}

/* ── Main content area ────────────────────────────────────────────────────── */
#kcml-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: auto;
    min-width: 0;
}

/* ── DevExtreme TreeView overrides ───────────────────────────────────────── */
.dx-treeview {
    background: transparent;
    border: none;
}

.dx-treeview-item {
    padding: 3px 8px;
    font-size: 0.875rem;
}

.dx-treeview-item.dx-state-selected .dx-item-content {
    font-weight: bold;
    color: #0077cc;
}

/* ── Dark mode ────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .kcml-sidebar {
        background: #1e1e1e;
        border-right-color: #333;
    }

    .kcml-logo {
        border-bottom-color: #333;
    }

    .kcml-search-wrap {
        border-top-color: #333;
    }

    #kcml-searchbox {
        background: #2d2d2d;
        color: #eee;
        border-color: #555;
    }

    #kcml-search-results a {
        color: #82aaff;
    }
}

/* ── Responsive (max 768px) ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .kcml-sidebar {
        height: auto;
        width: 100%;
        position: relative;
    }

    #kcml-tree {
        max-height: 300px;
    }
}
