/* CSS Variables for custom styling */

/* Theme Variables */
        :root {
            --bg-color: #f8f5f3;
            --text-color: #2d2d2d;
            --text-light: #5a5a5a;
    --text-muted: #888;
            --border-color: #e0d7d0;
            --code-bg: #f5f0eb;
            --code-border: #d4c4b8;
            --accent: #f59e0b;
    --accent-secondary: #666;
            --glass-bg: linear-gradient(135deg,
                rgba(255,255,255,.10) 0%,
                rgba(255,255,255,.07) 50%,
                rgba(255,255,255,.05) 100%
            );
    --shadow-xs: 0 1px 1px rgba(42,42,42,.08);
    --shadow-sm: 0 1px 2px rgba(42,42,42,.08);
    --shadow-md: 0 4px 6px -1px rgba(42,42,42,.12),0 2px 4px -1px rgba(42,42,42,.08);
    --shadow-lg: 0 10px 15px -3px rgba(42,42,42,.12),0 4px 6px -2px rgba(42,42,42,.08);
    --radius-xs: .25rem;
    --radius-sm: .375rem;
    --radius-md: .5rem;
    --radius-lg: .75rem;
    --space-xs: .5rem;
            --space-sm: 1rem;
            --space-md: 1.5rem;
            --space-lg: 2rem;
            --space-xl: 3rem;
            --space-2xl: 4rem;
            /* Category colors for matrisome table */
            --challenge-text: rgb(127, 29, 29);
            --challenge-bg: linear-gradient(135deg, rgba(155, 28, 36, 0.08) 0%, rgba(127, 29, 29, 0.06) 100%);
            --gap-text: rgb(146, 64, 14);
            --gap-bg: linear-gradient(135deg, rgba(180, 83, 9, 0.08) 0%, rgba(146, 64, 14, 0.06) 100%);
            --opportunity-text: rgb(30, 58, 138);
            --opportunity-bg: linear-gradient(135deg, rgba(30, 64, 175, 0.08) 0%, rgba(30, 58, 138, 0.06) 100%);
            --solution-text: rgb(5, 46, 22);
            --solution-bg: linear-gradient(135deg, rgba(6, 95, 70, 0.08) 0%, rgba(5, 46, 22, 0.06) 100%);
        }

        [data-theme="dark"] {
    --bg-color: #000;
            --text-color: #e5e5e5;
            --text-light: #b0b0b0;
    --text-muted: #888;
    --border-color: #333;
            --glass-bg: linear-gradient(135deg,
                rgba(255,255,255,.06) 0%,
                rgba(255,255,255,.04) 50%,
                rgba(255,255,255,.02) 100%
            );
            --code-bg: #1a1a1a;
            --code-border: #404040;
    --accent: #f59e0b;
    --accent-secondary: #666;
    --shadow-xs: 0 1px 1px rgba(0,0,0,.3);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -1px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -2px rgba(0,0,0,.4);
            /* Category colors for matrisome table - dark theme variants */
            --challenge-text: rgb(255, 120, 120);
            --challenge-bg: linear-gradient(135deg, rgba(155, 28, 36, 0.15) 0%, rgba(127, 29, 29, 0.12) 100%);
            --gap-text: rgb(255, 160, 80);
            --gap-bg: linear-gradient(135deg, rgba(180, 83, 9, 0.15) 0%, rgba(146, 64, 14, 0.12) 100%);
            --opportunity-text: rgb(120, 160, 255);
            --opportunity-bg: linear-gradient(135deg, rgba(30, 64, 175, 0.15) 0%, rgba(30, 58, 138, 0.12) 100%);
            --solution-text: rgb(80, 255, 160);
            --solution-bg: linear-gradient(135deg, rgba(6, 95, 70, 0.15) 0%, rgba(5, 46, 22, 0.12) 100%);
}

/* Core Layout */
        .tab-content {
            display: none;
            max-width: 1600px;
            margin: 0 auto;
            padding: var(--space-sm) var(--space-sm) var(--space-xl);
        }

.tab-content.active { display: block; }

/* Header */
        .header-awesome {
            margin-bottom: 0 !important;
            padding: var(--space-lg) 0;
            position: relative;
            overflow: hidden;
            width: 100%;
            background: var(--bg-color);
            min-height: 120px; /* Ensure header maintains proper height */
        }

        [data-theme="dark"] .header-awesome {
            background: #000;
        }

        .ascii-background {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            opacity: 0.8;
            display: none;
        }

        [data-theme="dark"] .ascii-background {
            display: block;
        }

        .header-awesome > .header-content {
            max-width: 1600px;
            margin: 0 auto;
            padding: 0 var(--space-sm);
            position: relative;
            z-index: 3;
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-sm);
            padding-bottom: var(--space-xs);
        }

        .header-brand {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: var(--space-xs);
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

/* Theme Switcher */
        .theme-switcher-delicate {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 1000;
            display: flex;
    gap: .25rem;
    background: rgba(255,255,255,.8);
            backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,.1);
            border-radius: 20px;
    padding: .25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: all .3s ease;
    opacity: .7;
        }

        .theme-switcher-delicate:hover {
            opacity: 1;
            transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
        }

        [data-theme="dark"] .theme-switcher-delicate {
    background: rgba(0,0,0,.8);
    border-color: rgba(255,255,255,.1);
        }

        .theme-btn-delicate {
            background: none;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
    font-size: .875rem;
    transition: all .2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
    opacity: .6;
}

.theme-btn-delicate:hover { opacity: .8; transform: scale(1.1); }
        .theme-btn-delicate.active {
            opacity: 1;
            background: var(--accent);
            color: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,.3);
        }

[data-theme="dark"] .theme-btn-delicate.active { box-shadow: 0 0 0 2px rgba(0,0,0,.5); }

/* Header Typography */
        .header-name {
            margin: 0;
    font-size: clamp(1.75rem,4vw,2.5rem);
            font-weight: 700;
    background: linear-gradient(135deg,#ff6b35,#f7931e);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
    letter-spacing: -.05em;
            line-height: 1;
        }

        .header-type {
            font-size: 1.125rem;
            font-weight: 400;
            color: var(--text-light);
    font-family: 'Geist',sans-serif;
    letter-spacing: .025em;
}

.header-bottom { margin-top: var(--space-sm); }

.header-version,.header-tag {
    font-family: 'Geist Mono',monospace;
    font-size: .875rem;
            color: var(--text-color);
            background: var(--code-bg);
    padding: .5rem 1rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            font-weight: 600;
    letter-spacing: .05em;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
        }

        .header-description p {
            margin: 0;
    font-size: .95rem;
            line-height: 1.5;
            color: var(--text-light);
            font-weight: 400;
        }

        .header-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: var(--space-md);
            align-items: center;
        }

        .header-stats .stat-item {
            display: flex !important;
            flex-direction: row !important;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.75rem;
            width: 100%;
            margin: 0;
            cursor: default; /* Disable pointer cursor for header stats */
            transition: none; /* Neutralize hover transition in header */
            pointer-events: none; /* Disable click interactions for header stats */
        }

        /* Prevent hover/focus effects on header stats */
        .header-stats .stat-item:hover,
        .header-stats .stat-item:focus {
            box-shadow: var(--shadow-xs);
            transform: none;
            outline: none;
        }

        .header-stats .stat-number {
            font-family: 'Geist Mono', monospace;
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-color);
            line-height: 1;
            letter-spacing: -0.025em;
            order: 1;
            flex-shrink: 0;
            margin: 0;
        }

        .header-stats .stat-label {
            font-size: 1rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
            text-align: right;
            order: 2;
            flex-grow: 1;
            margin: 0;
            line-height: 1;
        }

/* Dataset Info Cards */
        .dataset-info-section {
    margin: var(--space-sm) 0;
        }

        .dataset-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-color);
            margin: 0 0 var(--space-md) 0;
            padding-bottom: var(--space-xs);
    border-bottom: 2px solid var(--accent);
            display: inline-block;
        }

        .dataset-info-cards {
            display: grid;
    grid-template-columns: repeat(3,1fr);
            gap: var(--space-md);
            margin-bottom: var(--space-sm);
        }

        .dataset-info-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: var(--space-md);
    background: linear-gradient(to bottom,var(--bg-color) 0%,rgba(0,0,0,.01) 50%,var(--bg-color) 100%);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-xs);
    transition: all .2s ease;
        }

        .dataset-info-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
        }

        [data-theme="dark"] .dataset-info-card {
    background: rgba(255,255,255,.02);
        }

        .dataset-compartments-note {
            padding: var(--space-sm) var(--space-md);
            background: var(--code-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
    font-size: .9rem;
            line-height: 1.5;
            color: var(--text-color);
        }

        [data-theme="dark"] .dataset-compartments-note {
    background: rgba(0,0,0,.1);
    border-color: rgba(255,255,255,.1);
        }

        .dataset-info-label {
    font-size: .75rem;
            color: var(--text-muted);
            text-transform: uppercase;
    letter-spacing: .05em;
            font-weight: 600;
            margin-bottom: var(--space-xs);
    font-family: 'Geist Mono',monospace;
        }

        .dataset-info-value {
    font-family: 'Geist Mono',monospace;
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--accent);
            line-height: 1;
        }

        .compartments-item .dataset-info-value {
    font-size: .9rem;
            font-weight: 500;
            line-height: 1.4;
        }


/* Layouts */
        .individual-analysis-layout {
            display: grid;
            grid-template-columns: 320px 1fr;
            gap: var(--space-lg);
            min-height: 600px;
        }

        .dataset-panel {
            background: var(--glass-bg);
            border: 1px solid rgba(255,255,255,.1);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-xs);
    transition: all .2s ease;
            position: sticky;
            top: var(--space-md);
            height: fit-content;
            max-height: calc(100vh - 200px);
            margin-top: var(--space-sm);
        }

.dataset-panel:hover { box-shadow: var(--shadow-sm); }

        [data-theme="dark"] .dataset-panel {
    background: var(--glass-bg);
    border-color: rgba(255,255,255,.1);
        }


        .dataset-panel-header {
            padding: var(--space-sm) var(--space-md);
            background: transparent;
            border-bottom: 1px solid rgba(255,255,255,.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        [data-theme="dark"] .dataset-panel-header {
    background: transparent;
    border-bottom-color: rgba(255,255,255,.1);
        }

        .dataset-panel-header h3 {
            margin: 0;
            padding-left: 8px;
    font-size: .9rem;
            font-weight: 600;
            color: var(--text-color);
    font-family: 'Geist Mono',monospace;
            text-transform: uppercase;
    letter-spacing: .05em;
        }

        .dataset-count {
    font-family: 'Geist Mono',monospace;
    font-size: .75rem;
            font-weight: 500;
            color: var(--text-muted);
            background: rgba(0,0,0,.06);
    padding: .2rem .4rem;
            border-radius: var(--radius-xs);
            margin-right: var(--space-sm);
        }

        .dataset-list {
            max-height: calc(100vh - 280px);
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--text-muted) var(--bg-color);
        }

        .dataset-list::-webkit-scrollbar {
            width: var(--space-xs);
        }

        .dataset-list::-webkit-scrollbar-thumb {
            background-color: var(--text-muted);
            border-radius: var(--radius-xs);
        }

        .dataset-list::-webkit-scrollbar-track {
            background: var(--bg-color);
        }

        .dataset-loading {
            padding: var(--space-xl);
            text-align: center;
            color: var(--text-muted);
            font-style: italic;
    font-size: .9rem;
        }

        .compare-layout {
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        #search-container {
            padding: var(--space-sm) var(--space-md) var(--space-xs);
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-color);
        }

        #search-container input {
            width: 100%;
            padding: var(--space-xs) var(--space-sm);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
    font-size: .9rem;
            background: var(--bg-color);
    transition: border-color .2s ease;
            /* Modern CSS: field-sizing for auto-growing inputs */
            field-sizing: content;
            min-width: 200px;
            max-width: 100%;
        }

        /* Modern CSS: field-sizing for textareas */
        textarea {
            field-sizing: content;
            resize: none;
            min-height: 4lh;
        }

        #search-container input:focus {
            outline: none;
            border-color: var(--accent);
        }

.search-suggestions-top {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--bg-color);
            border: 1px solid var(--border-color);
            border-top: none;
            border-radius: 0 0 var(--radius-md) var(--radius-md);
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            max-height: 200px;
            overflow-y: auto;
        }

        .compare-main-content {
            display: flex;
            gap: var(--space-lg);
            flex: 1;
            min-height: 0;
        }

        .filters-panel {
            flex: 0 0 340px;
            background: var(--glass-bg);
            border-radius: var(--radius-lg);
            border: 1px solid rgba(255,255,255,.1);
            overflow: visible;
            box-shadow: var(--shadow-lg);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .filters-panel.loading {
            opacity: 0.8;
            transform: scale(0.98);
        }

        .analysis-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: var(--space-sm);
    min-width: 0;
        }

        .analysis-panel .chart-container {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
        }

        .analysis-panel #heatmap {
            width: 100% !important;
            height: auto;
            min-height: 600px;
        }

        #filters-content {
            padding: var(--space-sm) var(--space-md);
        }


        /* Tree Component Styles */
        .filter-tree {
            margin-bottom: var(--space-md);
        }

        .tree-node {
            margin-bottom: 2px; /* Reduced from var(--space-xs) */
        }

        .tree-node-header {
            display: flex;
            align-items: center;
            padding: 2px 0; /* Reduced from var(--space-xs) */
            cursor: pointer;
            user-select: none;
        }

        .tree-toggle {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-right: var(--space-xs);
            width: 12px;
            text-align: center;
        }

        .tree-label {
            flex: 1;
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-color);
        }

        /* Tree counters use the same dataset-item-count class for consistent styling */

        .tree-node-content {
            margin-left: var(--space-md);
            margin-top: 2px; /* Reduced from var(--space-xs) */
        }

        /* Increase indentation for deeper tree levels (up to 4 levels) */
        .filter-tree .tree-node-content .tree-node-content {
            margin-left: calc(var(--space-md) * 1.5);
        }
        .filter-tree .tree-node-content .tree-node-content .tree-node-content {
            margin-left: calc(var(--space-md) * 2);
        }
        .filter-tree .tree-node-content .tree-node-content .tree-node-content .tree-node-content {
            margin-left: calc(var(--space-md) * 2.5);
        }

        .tree-leaf {
            display: flex;
            align-items: center;
            padding: 2px 0;
            cursor: pointer;
            user-select: none;
        }



        /* Root node styling */
        .root-node .tree-label {
            font-weight: 600;
            font-size: 0.9rem;
        }

        /* Organ node styling */
        .organ-node .tree-label {
            font-weight: 600;
        }

        /* Expanded/collapsed states */
        .tree-node:not(.expanded) .tree-node-content {
            display: none;
        }

        /* Unified Checkbox Styling */
        .filter-checkbox {
            appearance: none;
            width: 18px;
            height: 18px;
            border: 2px solid var(--border-color);
            border-radius: 4px;
            margin-right: 10px;
            position: relative;
            cursor: pointer;
            transition: all 0.2s ease;
            background: var(--bg-color);
        }

        .filter-checkbox:checked {
            background: var(--accent);
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
        }

        .filter-checkbox:checked::after {
            content: '✓';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 12px;
            font-weight: bold;
        }

        .filter-checkbox:hover {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(245,158,11,0.1);
        }

        /* Filter labels */
        .filter-label {
            display: flex !important;
            align-items: center;
            padding: 6px 0;
            cursor: pointer;
            border-radius: var(--radius-sm);
            transition: background-color 0.2s ease;
            margin: 0;
        }

        .filter-label:hover {
            background: rgba(245,158,11,0.05);
        }

        /* Organ checkboxes (larger) */
        .organ-checkbox {
            width: 20px !important;
            height: 20px !important;
            border-radius: 6px !important;
            margin-right: 12px !important;
        }

        .organ-checkbox:checked {
            box-shadow: 0 0 0 3px rgba(245,158,11,0.25);
        }


        .trend-label {
            font-weight: 500;
            font-size: 0.85rem;
        }

        .trend-label.up {
            color: #dc2626;
        }

        .trend-label.down {
            color: #16a34a;
        }

        .trend-label.stable {
            color: var(--text-muted);
        }


        /* Filter Control Buttons */
        .control-buttons {
            display: flex;
            gap: var(--space-sm);
            margin-top: var(--space-md);
        }

        .control-buttons button {
            flex: 1;
            padding: var(--space-sm) var(--space-md);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.9rem;
            background: var(--bg-color);
            color: var(--text-color);
        }

        .control-buttons button:hover {
            border-color: var(--accent);
            background: rgba(245,158,11,0.05);
        }

        .control-buttons .btn-primary {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .control-buttons .btn-primary:hover {
            background: color-mix(in srgb, var(--accent) 90%, black);
            border-color: color-mix(in srgb, var(--accent) 90%, black);
        }

        /* Control Options (Auto-apply toggle) */
        .control-option {
            display: flex !important;
            align-items: center;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-color);
            gap: var(--space-sm);
            padding: var(--space-xs) var(--space-sm);
            border-radius: var(--radius-sm);
            transition: background-color 0.2s ease;
        }

        .control-option:hover {
            background: rgba(245,158,11,0.05);
        }

        .control-option input[type="checkbox"] {
            appearance: none;
            width: 18px;
            height: 18px;
            border: 2px solid var(--border-color);
            border-radius: 4px;
            position: relative;
            cursor: pointer;
            transition: all 0.2s ease;
            background: var(--bg-color);
        }

        .control-option input[type="checkbox"]:checked {
            background: var(--accent);
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
        }

        .control-option input[type="checkbox"]:checked::after {
            content: '✓';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 12px;
            font-weight: bold;
        }

        .control-option input[type="checkbox"]:hover {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(245,158,11,0.1);
        }


        /* Results Summary */
        .results-summary {
            margin-top: var(--space-lg);
            padding: var(--space-md);
            background: rgba(16,185,129,0.03);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
        }

        .summary-content { text-align: center; }


        .filter-summary-text {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: var(--space-xs);
            font-style: italic;
        }


/* Search & Suggestions */
.search-container { position: relative; }
        .top-search-input-container {
            position: relative;
            margin-bottom: var(--space-sm);
        }

        .top-search-input-container::before {
            content: '';
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 0.9rem;
            pointer-events: none;
            z-index: 1;
        }

        .top-search-input-container input {
            width: 100%;
            padding: var(--space-sm) var(--space-sm) var(--space-sm) 36px;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
            font-size: 0.9rem;
            transition: all 0.3s ease;
            background: var(--bg-color);
            color: var(--text-color);
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .top-search-input-container input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(245,158,11,0.1);
            transform: translateY(-1px);
        }

        .top-search-input-container input::placeholder {
            color: var(--text-muted);
            opacity: 0.7;
        }

        .search-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--bg-color);
            border: 1px solid var(--border-color);
            border-top: none;
            border-radius: 0 0 var(--radius-md) var(--radius-md);
            box-shadow: var(--shadow-md);
            z-index: 1000;
            max-height: 200px;
            overflow-y: auto;
        }

        .suggestion-item {
            padding: var(--space-sm);
            cursor: pointer;
            border-bottom: 1px solid var(--border-color);
    transition: background-color .2s ease;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,.suggestion-item.active { background: var(--code-bg); }
        .suggestion-item mark {
            background: #fff3cd;
            color: #856404;
    padding: .125rem .25rem;
            border-radius: var(--radius-xs);
        }


/* Dataset Items */
        .dataset-item {
            position: relative;
            cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
            border: 1px solid transparent;
            border-radius: 12px;
            margin: 6px var(--space-sm);
            overflow: hidden;
            opacity: 0;
            transform: translateY(20px);
        }

        /* Modern CSS: linear() easing for sequential animations (Chrome/Edge only) */
        @supports (animation: 1s linear(0, 1)) {
            .dataset-item.animate-in {
                --d: .5s;
                --_s: calc(100% * (sibling-index() - 1) / sibling-count());
                --_e: calc(100% * sibling-index() / sibling-count());
                animation: dataset-stagger calc(var(--d) * sibling-count()) infinite linear(0, 0 var(--_s), 1, 0 var(--_e), 0);
            }
        }

        /* Fallback animation for other browsers */
        .dataset-item.animate-in {
            animation: dataset-stagger-fallback 0.6s ease-out forwards;
        }

        /* Keyframes for staggered dataset loading animation */
        @keyframes dataset-stagger {
            0% { opacity: 0; transform: translateY(20px); }
            50% { opacity: 1; transform: translateY(0); }
            100% { opacity: 1; transform: translateY(0); }
        }

        @keyframes dataset-stagger-fallback {
            to { opacity: 1; transform: translateY(0); }
        }

        .dataset-item:hover {
    background: rgba(245,158,11,.06);
    border-color: rgba(245,158,11,.15);
    box-shadow: 0 4px 16px rgba(245,158,11,.12);
        }

        .dataset-item.active {
    background: linear-gradient(135deg,rgba(245,158,11,.1) 0%,rgba(245,158,11,.05) 100%);
    border-color: rgba(245,158,11,.25);
    box-shadow: 0 6px 24px rgba(245,158,11,.2),inset 0 1px 0 rgba(255,255,255,.15);
            transform: scale(1.02);
        }

        [data-theme="dark"] .dataset-item:hover {
    background: rgba(245,158,11,.08);
    border-color: rgba(245,158,11,.2);
    box-shadow: 0 4px 16px rgba(245,158,11,.18);
        }

        [data-theme="dark"] .dataset-item.active {
    background: linear-gradient(135deg,rgba(245,158,11,.15) 0%,rgba(245,158,11,.08) 100%);
    border-color: rgba(245,158,11,.3);
    box-shadow: 0 6px 24px rgba(245,158,11,.3),inset 0 1px 0 rgba(255,255,255,.1);
        }

        .dataset-item-content {
            padding: 6px var(--space-sm);
            min-height: 40px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--space-sm);
    transition: all .3s ease;
        }

        .dataset-item-primary {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .dataset-item-name {
            font-weight: 500;
    font-size: .85rem;
            color: var(--text-color);
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
    transition: color .25s ease;
        }

        .dataset-item.active .dataset-item-name {
            color: var(--text-color);
            font-weight: 600;
        }

        .dataset-item-organ {
            font-size: .7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: .08em;
            font-weight: 600;
            opacity: .55;
            line-height: 1.2;
            transition: opacity .25s ease;
        }

        .dataset-item.active .dataset-item-organ {
            opacity: .7;
        }

        .dataset-item-count {
            font-family: 'Geist Mono', monospace;
            font-size: .75rem;
            font-weight: 500;
            color: var(--text-muted);
            background: rgba(0,0,0,.05);
            padding: 2px 6px;
            border-radius: 4px;
            transition: all .25s ease;
        }

        [data-theme="dark"] .dataset-item-count {
            background: rgba(255,255,255,.08);
        }

        .dataset-item.active .dataset-item-count {
            background: rgba(245,158,11,.15);
            color: #c2410c;
            font-weight: 600;
        }

        /* Modern CSS: :has() pseudo-class for parent selectors */
        .dataset-item:has(.dataset-item-content:hover) {
            border-color: rgba(245,158,11,.08);
        }

        .structure-block:has(h3) {
            border-left: 2px solid var(--accent);
        }

        .section:has(.matrisome-table) {
            background: linear-gradient(135deg, var(--bg-color) 0%, rgba(245,158,11,.02) 100%);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            margin: var(--space-md) 0;
        }

        .link-item:has(a[target="_blank"])::after {
            content: "↗";
            margin-left: var(--space-xs);
            opacity: 0.6;
        }

        .section:has(.features-list) {
            position: relative;
        }

        .section:has(.features-list)::before {
            content: "✨";
            position: absolute;
            top: var(--space-sm);
            right: var(--space-sm);
            font-size: 1.2em;
            opacity: 0.7;
        }

        [data-theme="dark"] .dataset-item.active .dataset-item-count {
            background: rgba(245,158,11,.2);
            color: #fb923c;
        }

        .no-dataset-selected {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: var(--space-2xl);
            text-align: center;
    background: linear-gradient(135deg,var(--bg-color) 0%,rgba(0,0,0,.01) 50%,var(--bg-color) 100%);
            border: 2px dashed var(--border-color);
            border-radius: var(--radius-lg);
            min-height: 400px;
        }

        .no-dataset-icon {
            font-size: 3rem;
            margin-bottom: var(--space-md);
    opacity: .6;
        }

        .no-dataset-selected h3 {
            margin: 0 0 var(--space-sm) 0;
            color: var(--text-color);
            font-size: 1.5rem;
        }

        .no-dataset-selected p {
            margin: 0;
            color: var(--text-muted);
            max-width: 400px;
            line-height: 1.6;
        }


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

        body {
    font-family: 'Geist',-apple-system,BlinkMacSystemFont,sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.65;
    font-size: clamp(1rem,2vw,1.125rem);
            font-variation-settings: 'wght' 350;
            max-width: 1600px;
            margin: 0 auto;
    padding: var(--space-sm);
        }

[data-theme="dark"] body { color: #b0b0b0; }

/* Typography */
h1,h2,h3,h4,h5 {
    font-family: 'Geist Mono',monospace;
    font-feature-settings: 'kern' 1,'liga' 1;
            font-weight: 450;
            line-height: 1.3;
            margin-bottom: var(--space-md);
            font-optical-sizing: auto;
            color: var(--text-color);
        }

        h1 {
    font-size: clamp(2rem,5vw,2.5rem);
    letter-spacing: -.02em;
            font-variation-settings: 'wght' 450;
            margin-bottom: var(--space-md);
        }

h2 {
    font-size: clamp(1.5rem,3vw,1.75rem);
    margin: 0 0 .75rem 0;
            padding: var(--space-sm) 0;
            display: flex;
            align-items: center;
        }

        /* Science icon styling for h2 titles - now numbered circles */
        .science-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.8rem;
            height: 1.8rem;
            background: var(--accent);
            border-radius: 50%;
            border: 2px solid var(--bg-color);
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
            margin-right: var(--space-sm);
            font-size: 0.8rem;
            font-weight: 600;
            color: white;
            font-family: 'Geist Mono', monospace;
        }

        .science-icon::before {
            content: attr(data-number);
        }

        h3 {
    font-size: clamp(1.125rem,2.5vw,1.25rem);
            font-weight: 450;
            margin-bottom: var(--space-sm);
        }

        h4 a {
            color: var(--accent);
            text-decoration: none;
    transition: color .2s ease;
        }

h4 a:hover,h4 a:focus {
            color: var(--text-light);
        }

        p {
            margin-bottom: var(--space-md);
            text-align: justify;
            hyphens: auto;
        }

ul,ol {
            margin-bottom: var(--space-md);
            padding-left: 1.75rem;
        }

li { margin-bottom: var(--space-xs); }
strong { font-weight: 450; }

        a {
            color: var(--accent);
            text-decoration: none;
    transition: all .2s ease;
        }

a:hover,a:focus {
            text-decoration: underline;
            color: var(--text-light);
        }

        pre {
            background-color: var(--code-bg);
            border: 1px solid var(--code-border);
            border-radius: var(--radius-md);
            padding: var(--space-md);
    font-family: 'Geist Mono',monospace;
    font-feature-settings: 'kern' 1,'liga' 1;
    font-size: .875rem;
            line-height: 1.3;
            overflow-x: auto;
            margin-bottom: var(--space-md);
            white-space: pre-wrap;
            box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease;
            scrollbar-width: thin;
            scrollbar-color: var(--text-muted) var(--code-bg);
        }

pre::-webkit-scrollbar { width: var(--space-xs); }
        pre::-webkit-scrollbar-thumb {
            background-color: var(--text-muted);
            border-radius: var(--radius-xs);
        }
pre::-webkit-scrollbar-track { background: var(--code-bg); }
        pre:hover {
            box-shadow: var(--shadow-md);
    background: linear-gradient(to bottom,var(--code-bg) 0%,rgba(0,0,0,.01) 50%,var(--code-bg) 100%);
        }

        code {
    font-family: 'Geist Mono',monospace;
    font-feature-settings: 'kern' 1,'liga' 1;
            background-color: var(--code-bg);
    padding: .125rem .375rem;
            border-radius: var(--radius-xs);
            border: 1px solid var(--code-border);
    font-size: .875em;
    transition: background-color .2s ease;
        }

        .section {
            margin-bottom: var(--space-lg);
    background: linear-gradient(to bottom,var(--bg-color) 0%,rgba(0,0,0,.01) 50%,var(--bg-color) 100%);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xs);
        }

        /* About tab sections - no padding, just content spacing */
        #tab-about .section {
            padding: 0;
            margin-bottom: var(--space-xl);
        }

        #tab-about .section h2 {
            padding: var(--space-md) 0 var(--space-xs) 0;
            margin: 0 0 var(--space-sm) 0;
        }

        #tab-about .section > *:not(h2):not(.section):first-of-type {
            padding-top: 0;
        }

        /* Individual Dataset Analysis sections - add padding for chart sections */
        #tab-individual .section {
            padding: var(--space-lg) var(--space-md);
            margin-bottom: var(--space-xl);
        }

        .features-list {
            list-style: none;
            padding: 0;
        }

        .features-list li {
            display: flex;
            align-items: flex-start;
            margin-bottom: var(--space-sm);
            padding: var(--space-xs) 0;
    transition: all .2s ease;
            transform: translateX(0);
            border-radius: var(--radius-sm);
        }

        .features-list li:hover {
            background-color: var(--code-bg);
            padding-left: var(--space-sm);
            transform: scale(1.02);
            box-shadow: var(--shadow-xs);
        }

        .features-list li::before {
            content: "▹";
            color: var(--accent-secondary);
            font-weight: bold;
    margin-right: .875rem;
    margin-top: .125rem;
    font-size: .875rem;
            flex-shrink: 0;
    transition: transform .2s ease;
}

.features-list li:hover::before { transform: translateX(.25rem); }

/* Stats Grid */
.stats-grid, .stats-container {
            display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-lg);
            margin-top: 0;
        }

/* Remove top margin for dataset stats in individual analysis */
#dataset-stats {
    margin-top: 0;
}

        .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
            text-align: center;
    padding: var(--space-lg);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
    transition: all .2s ease;
            cursor: pointer;
            box-shadow: var(--shadow-xs);
    background: var(--bg-color);
        }

.stat-item:hover,.stat-item:focus {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .stat-number {
    font-family: 'Geist Mono',monospace;
            font-size: 2rem;
            font-weight: 700;
            display: block;
            color: var(--accent);
            margin-bottom: var(--space-xs);
    line-height: 1;
        }

        .stat-label {
    font-size: .875rem;
            color: var(--text-muted);
            text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 500;
        }

/* Links and Resources */
        .links {
            display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: var(--space-lg);
            margin-top: var(--space-lg);
        }

        .link-item {
            padding: var(--space-lg);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-xs);
            cursor: pointer;
    background: var(--bg-color);
    text-align: left;
        }

        .link-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--accent);
            transform: scaleX(0);
            transition: transform 0.2s ease;
        }

        .link-item:hover::before {
            transform: scaleX(1);
        }

        .link-item:hover,
        .link-item:focus-within {
            box-shadow: var(--shadow-lg);
            background: linear-gradient(to bottom, var(--bg-color) 0%, rgba(0,0,0,0.01) 50%, var(--bg-color) 100%);
    border-color: var(--accent);
        }

        .link-item h4 {
            margin-bottom: var(--space-sm);
    color: var(--text-color);
        }

        .link-item p {
            color: var(--text-muted);
            font-size: 0.875rem;
            margin-bottom: 0;
    line-height: 1.5;
        }

/* Contributors */
        .contributor-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
            border: 1px solid var(--border-color);
            margin: 0 var(--space-sm) 0 0;
            flex-shrink: 0;
        }


#contributors .link-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-xs);
    text-decoration: none;
    color: inherit;
}

#contributors .link-item .contributor-avatar {
    margin: 0 0 var(--space-xs) 0;
}

#contributors .link-item h4 {
    margin: 0 0 2px 0;
    font-size: 1rem;
    color: var(--text-color);
}

#contributors .link-item p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Tables */
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: var(--space-lg);
            font-size: 1rem;
            box-shadow: var(--shadow-sm);
            border-radius: var(--radius-md);
            overflow: hidden;
        }

th,td {
            padding: var(--space-sm) 1rem;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }

        th {
    font-family: 'Geist Mono',monospace;
            font-weight: 600;
            text-transform: uppercase;
    letter-spacing: .05em;
            color: var(--text-muted);
            background-color: var(--code-bg);
        }

        tbody tr {
            border: 1px solid var(--border-color);
            border-bottom: none;
    transition: background-color .2s ease;
}

tbody tr:last-child { border-bottom: 1px solid var(--border-color); }
tbody tr:hover { background-color: var(--code-bg); cursor: pointer; }
table a { color: inherit; text-decoration: none; }
table a:hover { color: var(--accent); }

/* Matrisome Table Category Styling */
.matrisome-table .category-challenge {
    background: var(--challenge-bg);
    color: var(--challenge-text);
}

.matrisome-table .category-gap {
    background: var(--gap-bg);
    color: var(--gap-text);
}

.matrisome-table .category-opportunity {
    background: var(--opportunity-bg);
    color: var(--opportunity-text);
}

.matrisome-table .category-solution {
    background: var(--solution-bg);
    color: var(--solution-text);
}

.matrisome-table .category-challenge strong,
.matrisome-table .category-gap strong,
.matrisome-table .category-opportunity strong,
.matrisome-table .category-solution strong {
    color: inherit;
}

/* Database Structure Section */
.structure-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

@media (min-width: 768px) {
    .structure-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Database Structure section - always horizontal */
#structure .structure-grid {
    grid-template-columns: 1fr 1fr;
}

.structure-block {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    background: var(--bg-color);
    box-shadow: var(--shadow-xs);
}

.structure-block h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.structure-block .features-list {
    margin: 0;
    padding-left: var(--space-sm);
}

.structure-block .features-list li {
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
    line-height: 1.3;
    padding: 0;
    transform: none;
}

.structure-block .features-list li:hover {
    background: none;
    transform: none;
}

.structure-block .features-list li::before {
    font-size: 0.75rem;
    margin-right: var(--space-xs);
}

.structure-item {
    margin-top: var(--space-md);
    padding: var(--space-xs) 0;
    border-top: 1px solid var(--border-color);
}

.structure-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.structure-data {
    font-size: 0.85rem;
    color: var(--text-color);
    font-family: 'Geist Mono', monospace;
    line-height: 1.4;
    display: block;
}

.structure-block .tip {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
}


/* Navigation - Simplified & Clean */
nav[aria-label="Main navigation"] {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(140%) contrast(105%);
    -webkit-backdrop-filter: blur(20px) saturate(140%) contrast(105%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin: -.75rem 0 var(--space-md);
    z-index: 10;
    box-shadow:
        0 2px 8px rgba(255, 107, 53, 0.04),
        0 1px 3px rgba(255, 107, 53, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 107, 53, 0.03);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    transition: all 0.3s ease;
    position-anchor: --nav-active;
}

/* Active indicator bar */
nav[aria-label="Main navigation"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: anchor(left, --nav-active);
    width: anchor(width, --nav-active);
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-secondary) 50%, var(--accent) 100%);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

        [data-theme="dark"] nav[aria-label="Main navigation"] {
            background:
                linear-gradient(135deg,
                    rgba(255, 107, 53, 0.08) 0%,
                    rgba(0, 0, 0, 0.4) 30%,
                    rgba(0, 0, 0, 0.4) 70%,
                    rgba(247, 147, 30, 0.06) 100%
                );
            border: 2px solid transparent;
            border-image: linear-gradient(135deg,
                rgba(255, 107, 53, 0.15) 0%,
                rgba(247, 147, 30, 0.25) 25%,
                rgba(255, 158, 11, 0.35) 50%,
                rgba(247, 147, 30, 0.25) 75%,
                rgba(255, 107, 53, 0.15) 100%
            ) 1;
            border-radius: var(--radius-lg);
            box-shadow:
                0 2px 8px rgba(255, 107, 53, 0.08),
                0 1px 3px rgba(255, 107, 53, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.12),
                inset 0 -1px 0 rgba(255, 107, 53, 0.06);
        }

        .nav-link {
            text-decoration: none;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
    transition: all .3s ease;
            display: flex;
            align-items: center;
            gap: var(--space-xs);
        }

        .nav-icon {
            flex-shrink: 0;
            opacity: 0.8;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .nav-link:hover {
            border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
        }

        nav[aria-label="Main navigation"] ul {
            list-style: none;
            display: flex;
            justify-content: center;
            gap: var(--space-sm);
            padding: 0;
            margin: 0;
            flex-wrap: wrap;
        }

        nav[aria-label="Main navigation"] li {
            margin-bottom: 0;
        }

        nav[aria-label="Main navigation"] li a.nav-link {
            color: var(--text-light);
            font-size: 1.0rem;
            font-weight: 500;
            transition: all 0.3s ease;
            padding: var(--space-xs) var(--space-md);
            border-radius: var(--radius-md);
            border: 2px solid rgba(255, 255, 255, 0.4);
            position: relative;
            backdrop-filter: blur(10px);
            background: rgba(255, 255, 255, 0.25);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            text-decoration: none !important;
        }

        /* Smooth hover effects - exclude active tabs */
        nav[aria-label="Main navigation"] li a:not(.active):hover,
        nav[aria-label="Main navigation"] li a:not(.active):focus {
            color: var(--accent);
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.7);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 53, 0.15);
            text-decoration: none !important;
        }

        /* Icon hover animation - exclude active tabs */
        nav[aria-label="Main navigation"] li a:not(.active):hover .nav-icon {
            transform: scale(1.1);
            transition: transform 0.3s ease;
        }

        nav[aria-label="Main navigation"] li a.active {
            anchor-name: --nav-active;
            font-weight: 600;
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2);
            outline: none;
            text-decoration: none !important;
        }

        /* Activate indicator bar for active tab */
        nav[aria-label="Main navigation"] li a.active ~ nav[aria-label="Main navigation"]::after {
            transform: scaleX(1);
        }

        /* Simple fade-in animation */
        nav[aria-label="Main navigation"] li {
            animation: nav-fade-in 0.4s ease-out;
        }

        @keyframes nav-fade-in {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* Light theme active state - orange background */
        :root nav[aria-label="Main navigation"] li a.active {
            color: white !important;
            background: var(--accent) !important;
            border-color: var(--accent) !important;
            box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3) !important;
            transform: translateY(-1px) !important;
            outline: none !important;
            text-decoration: none !important;
        }

        /* Ensure no hover effects persist on active tabs */
        :root nav[aria-label="Main navigation"] li a.active:hover,
        :root nav[aria-label="Main navigation"] li a.active:focus {
            color: white !important;
            background: var(--accent) !important;
            border-color: var(--accent) !important;
            box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3) !important;
            transform: translateY(-1px) !important;
            outline: none !important;
            text-decoration: none !important;
        }

        [data-theme="dark"] nav[aria-label="Main navigation"] li a.nav-link {
            background: rgba(0, 0, 0, 0.4);
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        }

        [data-theme="dark"] nav[aria-label="Main navigation"] li a:not(.active):hover,
        [data-theme="dark"] nav[aria-label="Main navigation"] li a:not(.active):focus {
            background: rgba(0, 0, 0, 0.6);
            border-color: rgba(255, 255, 255, 0.4);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        [data-theme="dark"] nav[aria-label="Main navigation"] li a.active {
            background: white !important;
            color: #1f2937 !important;
            border-color: white !important;
            outline: none !important;
            text-decoration: none !important;
        }

        /* Ensure no hover effects persist on dark theme active tabs */
        [data-theme="dark"] nav[aria-label="Main navigation"] li a.active:hover,
        [data-theme="dark"] nav[aria-label="Main navigation"] li a.active:focus {
            background: white !important;
            color: #1f2937 !important;
            border-color: white !important;
            outline: none !important;
            text-decoration: none !important;
        }

/* About Tab Layout */
.about-layout {
    display: flex;
    gap: var(--space-xl);
    width: 100%;
}

.about-main-content { flex: 1; min-width: 0; }
.about-sidebar {
    flex-shrink: 0;
    width: 320px;
    position: sticky;
    top: var(--space-lg);
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-section {
    background: var(--glass-bg);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    /* Remove margin since we're using gap in flexbox container */
}



.sidebar-section h4 {
    margin: 0 0 var(--space-xs) 0;
    padding-left: 8px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .8;
}

.toc-section .toc-nav {
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.toc-list a.nav-link {
    display: block;
    padding: 6px 8px;
    color: var(--text-light);
    font-size: .8rem;
    line-height: 1.3;
    transition: all .2s ease;
    text-decoration: none;
    border: none;
    text-align: left;
}

.toc-list a:hover {
    color: var(--text-color);
    background: rgba(245,158,11,.08);
}

[data-theme="dark"] .toc-list a:hover {
    background: rgba(245,158,11,.12);
}

.toc-list a.active {
    color: var(--text-color);
    background: rgba(245,158,11,.12);
    font-weight: 600;
}

[data-theme="dark"] .toc-list a.active {
    background: rgba(245,158,11,.18);
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.quick-link.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    color: var(--text-light);
    font-size: .8rem;
    transition: all .2s ease;
    text-decoration: none;
    border: none;
}

.quick-link:hover {
    color: var(--text-color);
    background: rgba(245,158,11,.08);
}

.link-text { flex: 1; font-weight: 500; }
.link-arrow {
    font-size: 1rem;
    opacity: .6;
    transition: all .2s ease;
    margin-left: 8px;
}

.quick-link:hover .link-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    color: var(--text-light);
    font-size: .8rem;
    transition: all .2s ease;
    text-decoration: none;
    cursor: pointer;
}

.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.member-name {
    font-size: .85rem;
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.team-member:hover {
    color: var(--text-color);
    background: rgba(245,158,11,.08);
}

.team-member:hover .member-name {
    color: var(--text-color);
}

.member-name:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* Footer */
.footer-note {
    margin-top: var(--space-xl);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    text-align: center;
}

.footer-note p {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid, .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: var(--space-md);
    }

    .stat-item {
        padding: var(--space-md);
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .about-layout { flex-direction: column; gap: var(--space-lg); }
    .about-sidebar {
        width: 100%;
        position: static;
        order: -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-sm);
        margin-bottom: var(--space-lg);
    }
    .sidebar-section {
        margin: 0;
        /* Compact height for better alignment */
        min-height: 150px;
    }
    .individual-analysis-layout { grid-template-columns: 1fr; gap: var(--space-md); }
    .dataset-panel { position: static; max-height: 350px; }
    .dataset-list { max-height: 300px; }
    .compare-main-content { flex-direction: column; gap: var(--space-md); }
    .filters-panel { flex: none; order: 2; }
    .analysis-panel { order: 1; }
    .footer-note { margin-top: var(--space-lg); padding: var(--space-md) 0; }
    .footer-content { padding: 0 var(--space-sm); }
    .footer-note p { font-size: .8125rem; }

    /* Mobile navigation enhancements */
    nav[aria-label="Main navigation"] {
        padding: var(--space-xs) var(--space-sm);
        margin: -.5rem 0 var(--space-sm);
    }

    nav[aria-label="Main navigation"] ul {
        gap: var(--space-xs);
    }

    nav[aria-label="Main navigation"] li a.nav-link {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.9rem;
    }

}

/* Compartment Styles */

/* Compartment Tabs - Styled like Navigation */
.compartment-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: 0 0 var(--space-lg);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.compartment-tabs .tab {
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(255,255,255,.1);
    color: var(--text-light);
}

.compartment-tabs .tab:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.compartment-tabs .tab.active {
    font-weight: 600;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    transform: translateY(-.5px);
    position: relative;
    text-decoration: none;
}

:root .compartment-tabs .tab.active {
    color: white;
    background: #2d2d2d;
}

[data-theme="dark"] .compartment-tabs .tab.active {
    color: #1f2937; /* dark text */
    background: #f3f4f6; /* light background for contrast */
    border-color: rgba(0,0,0,.2);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

[data-theme="dark"] .compartment-tabs .tab {
    background: rgba(0,0,0,.2);
}

/* Keep active tab light on hover/focus in dark theme */
[data-theme="dark"] .compartment-tabs .tab.active:hover,
[data-theme="dark"] .compartment-tabs .tab.active:focus {
    background: #f3f4f6;
    color: #1f2937;
}

/* Ensure main nav active state is light in dark theme for visibility */
[data-theme="dark"] nav[aria-label="Main navigation"] li a.active {
    color: #1f2937;
    background: #f3f4f6;
    border-color: rgba(0,0,0,.2);
}

[data-theme="dark"] nav[aria-label="Main navigation"] li a.active:hover,
[data-theme="dark"] nav[aria-label="Main navigation"] li a.active:focus {
    background: #f3f4f6;
    color: #1f2937;
}
