/* /Components/Layout/DiscoveryTree.razor.rz.scp.css */
/* ═══════════════════════════════════════════════════════
   DiscoveryTree — Scoped Styles
   Premium "Sectioned Accordion" document tree
   ═══════════════════════════════════════════════════════ */

/* ── Container ──────────────────────────────────────── */
.discovery-tree[b-nhj76uwu7q] {
    padding: 12px;
    min-height: 200px;
    flex: 1;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Filter Bar ─────────────────────────────────────── */
.filter-bar[b-nhj76uwu7q] {
    flex-shrink: 0;
}

.filter-input-wrapper[b-nhj76uwu7q] {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 10px;
    padding: 6px 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-input-wrapper:focus-within[b-nhj76uwu7q] {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.05);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.filter-icon[b-nhj76uwu7q] {
    color: rgba(148, 163, 184, 0.6);
    flex-shrink: 0;
}

.filter-input[b-nhj76uwu7q] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.filter-input[b-nhj76uwu7q]::placeholder {
    color: rgba(148, 163, 184, 0.4);
    font-weight: 400;
}

.filter-clear[b-nhj76uwu7q] {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: rgba(148, 163, 184, 0.5);
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.filter-clear:hover[b-nhj76uwu7q] {
    color: #e2e8f0;
    background: rgba(100, 116, 139, 0.15);
}

/* ── Tree Scroll Container ──────────────────────────── */
.tree-scroll[b-nhj76uwu7q] {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Custom scrollbar */
.tree-scroll[b-nhj76uwu7q]::-webkit-scrollbar {
    width: 4px;
}

.tree-scroll[b-nhj76uwu7q]::-webkit-scrollbar-track {
    background: transparent;
}

.tree-scroll[b-nhj76uwu7q]::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
}

.tree-scroll[b-nhj76uwu7q]::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.35);
}

/* ── Base Tree Node ─────────────────────────────────── */
.tree-node[b-nhj76uwu7q] {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-node:hover[b-nhj76uwu7q] {
    background: rgba(100, 116, 139, 0.06);
    border-color: rgba(100, 116, 139, 0.1);
}

.tree-node:active[b-nhj76uwu7q] {
    transform: scale(0.99);
}

/* ── Node Active Indicator (left bar) ───────────────── */
.node-indicator[b-nhj76uwu7q] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #22d3ee;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ── Root Node ──────────────────────────────────────── */
.root-node.active[b-nhj76uwu7q] {
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.18);
}

.root-node.active .node-indicator[b-nhj76uwu7q] {
    opacity: 1;
}

/* ── Node Icon Box ──────────────────────────────────── */
.node-icon-box[b-nhj76uwu7q] {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(100, 116, 139, 0.12);
    background: rgba(100, 116, 139, 0.06);
    color: rgba(148, 163, 184, 0.8);
    transition: all 0.2s ease;
}

.tree-node:hover .node-icon-box[b-nhj76uwu7q] {
    color: #cbd5e1;
}

.root-icon-box.active[b-nhj76uwu7q] {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.25);
    color: #22d3ee;
}

/* ── Node Text ──────────────────────────────────────── */
.node-text[b-nhj76uwu7q] {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.node-title[b-nhj76uwu7q] {
    font-size: 0.82rem;
    font-weight: 500;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.node-title.active[b-nhj76uwu7q] {
    color: #f1f5f9;
    font-weight: 600;
}

.node-subtitle[b-nhj76uwu7q] {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.35);
    line-height: 1.2;
}

/* ── Node Badge (count) ─────────────────────────────── */
.node-badge[b-nhj76uwu7q] {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.1);
    color: rgba(148, 163, 184, 0.7);
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.node-badge.active[b-nhj76uwu7q] {
    background: #22d3ee;
    color: #0f172a;
}

.tree-node:hover .node-badge:not(.active)[b-nhj76uwu7q] {
    color: #cbd5e1;
}

/* ── Tree Divider ───────────────────────────────────── */
.tree-divider[b-nhj76uwu7q] {
    height: 1px;
    background: rgba(100, 116, 139, 0.1);
    margin: 8px 16px;
}

/* ── Subject Section ────────────────────────────────── */
.subject-section[b-nhj76uwu7q] {
    margin-bottom: 2px;
}

/* ── Subject Node ───────────────────────────────────── */
.subject-node[b-nhj76uwu7q] {
    padding-left: 14px;
}

.subject-accent-bar[b-nhj76uwu7q] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 0 4px 4px 0;
    opacity: 0.5;
    transition: all 0.25s ease;
}

.subject-node:hover .subject-accent-bar[b-nhj76uwu7q] {
    height: 50%;
    opacity: 0.8;
}

.subject-node.active .subject-accent-bar[b-nhj76uwu7q] {
    height: 65%;
    opacity: 1;
}

.subject-node.active[b-nhj76uwu7q] {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.15);
}

.subject-icon-box[b-nhj76uwu7q] {
    transition: all 0.2s ease;
}

/* ── Chevron ────────────────────────────────────────── */
.chevron[b-nhj76uwu7q] {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s ease;
    flex-shrink: 0;
}

.chevron.expanded[b-nhj76uwu7q] {
    transform: rotate(90deg);
    color: rgba(148, 163, 184, 0.7);
}

/* ── Children Container (animated) ──────────────────── */
.children-container[b-nhj76uwu7q] {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}

.children-container.expanded[b-nhj76uwu7q] {
    max-height: 600px;
    opacity: 1;
}

.children-inner[b-nhj76uwu7q] {
    padding: 4px 0 4px 28px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ── Type Node (leaf) ───────────────────────────────── */
.type-node[b-nhj76uwu7q] {
    padding: 5px 8px;
    border-radius: 8px;
    gap: 8px;
    position: relative;
}

.type-node:hover[b-nhj76uwu7q] {
    background: rgba(100, 116, 139, 0.06);
}

.type-node.active[b-nhj76uwu7q] {
    background: rgba(34, 211, 238, 0.04);
    border-color: rgba(34, 211, 238, 0.15);
}

.type-connector[b-nhj76uwu7q] {
    position: absolute;
    left: -12px;
    top: 50%;
    width: 10px;
    height: 0;
    border-bottom: 1px dashed;
    border-color: rgba(100, 116, 139, 0.15);
}

.type-icon[b-nhj76uwu7q] {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(148, 163, 184, 0.5);
    transition: color 0.2s ease;
}

.type-node:hover .type-icon[b-nhj76uwu7q] {
    color: #cbd5e1;
}

.type-title[b-nhj76uwu7q] {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 450;
    color: rgba(148, 163, 184, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.type-title.active[b-nhj76uwu7q] {
    font-weight: 600;
    color: var(--accent, #22d3ee);
}

.type-node:hover .type-title:not(.active)[b-nhj76uwu7q] {
    color: #e2e8f0;
}

.type-badge[b-nhj76uwu7q] {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(100, 116, 139, 0.08);
    color: rgba(148, 163, 184, 0.5);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.type-badge.active[b-nhj76uwu7q] {
    color: var(--accent, #22d3ee);
    background: rgba(34, 211, 238, 0.1);
}

.type-node:hover .type-badge:not(.active)[b-nhj76uwu7q] {
    color: rgba(148, 163, 184, 0.7);
}

/* ── Stats Footer ───────────────────────────────────── */
.stats-footer[b-nhj76uwu7q] {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 8px 4px;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
    margin-top: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.45);
    letter-spacing: 0.02em;
}

.stats-icon[b-nhj76uwu7q] {
    color: rgba(148, 163, 184, 0.3);
    font-size: 0.85rem !important;
}

.stats-dot[b-nhj76uwu7q] {
    color: rgba(148, 163, 184, 0.25);
    font-weight: 700;
}

/* ── Empty State ────────────────────────────────────── */
.empty-state[b-nhj76uwu7q] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
}

.empty-icon[b-nhj76uwu7q] {
    color: rgba(100, 116, 139, 0.2);
}

.empty-text[b-nhj76uwu7q] {
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.4);
    font-weight: 500;
}

/* ── Skeleton Loading ───────────────────────────────── */
.skeleton-container[b-nhj76uwu7q] {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px;
}

.skeleton-line[b-nhj76uwu7q] {
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(
        90deg,
        rgba(100, 116, 139, 0.06) 25%,
        rgba(100, 116, 139, 0.12) 50%,
        rgba(100, 116, 139, 0.06) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer-b-nhj76uwu7q 1.8s ease-in-out infinite;
}

.skeleton-wide[b-nhj76uwu7q]  { width: 100%; }
.skeleton-medium[b-nhj76uwu7q] { width: 85%; margin-left: 12px; }
.skeleton-narrow[b-nhj76uwu7q] { width: 65%; margin-left: 28px; }

@keyframes skeleton-shimmer-b-nhj76uwu7q {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Focus Visible (Keyboard Navigation) ────────────── */
.tree-node:focus-visible[b-nhj76uwu7q] {
    outline: 2px solid rgba(34, 211, 238, 0.5);
    outline-offset: -2px;
}
