.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

.b-example-divider {
    width: 100%;
    height: 3rem;
    background-color: rgba(0, 0, 0, .1);
    border: solid rgba(0, 0, 0, .15);
    border-width: 1px 0;
    box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}

.b-example-vr {
    flex-shrink: 0;
    width: 1.5rem;
    height: 100vh;
}

.bi {
    vertical-align: -.125em;
    fill: currentColor;
}

.nav-scroller {
    position: relative;
    z-index: 2;
    height: 2.75rem;
    overflow-y: hidden;
}

.nav-scroller .nav {
    display: flex;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
    margin-top: -1px;
    overflow-x: auto;
    text-align: center;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.btn-bd-primary {
    --bd-violet-bg: #712cf9;
    --bd-violet-rgb: 112.520718, 44.062154, 249.437846;

    --bs-btn-font-weight: 600;
    --bs-btn-color: var(--bs-white);
    --bs-btn-bg: var(--bd-violet-bg);
    --bs-btn-border-color: var(--bd-violet-bg);
    --bs-btn-hover-color: var(--bs-white);
    --bs-btn-hover-bg: #6528e0;
    --bs-btn-hover-border-color: #6528e0;
    --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
    --bs-btn-active-color: var(--bs-btn-hover-color);
    --bs-btn-active-bg: #5a23c8;
    --bs-btn-active-border-color: #5a23c8;
}

.bd-mode-toggle {
    z-index: 1500;
}

.bd-mode-toggle .dropdown-menu .active .bi {
    display: block !important;
}

/* ===============================================
   CSS CUSTOM PROPERTIES (CSS Variables)
   =============================================== */

:root {
    /* Base Colors */
    --bg-primary: #ffffff;
    --surface: #212529;
    --surface-t: rgba(33, 37, 41, .95);
    --overlay: rgba(33, 37, 41, .95);
    --text: #212529;
    --muted: rgba(33, 37, 41, .6);
    
    /* Accent Colors */
    --table-accent: #198754;
    --table-accent-light: rgba(25, 135, 84, .1);
    --table-hover: rgba(25, 135, 84, .2);
    
    /* Card & Input Colors */
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: rgba(0, 0, 0, .15);
    --input-text: #212529;
    
    /* Status Colors */
    --error-color: #dc3545;
    --error-light: rgba(220, 53, 69, .1);
    --success-color: #198754;
    --success-light: rgba(25, 135, 84, .1);
    --warning-color: #ffc107;
    --warning-light: rgba(255, 193, 7, .1);
    --info-color: #0dcaf0;
    --info-light: rgba(13, 202, 240, .1);
}

[data-theme="dark"] {
    /* Base Colors */
    --bg-primary: #212529;
    --surface: #1a1a1a;
    --surface-t: rgba(33, 37, 41, .95);
    --overlay: rgba(33, 37, 41, .95);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .6);
    
    /* Accent Colors */
    --table-accent: #20c997;
    --table-accent-light: rgba(32, 201, 151, .1);
    --table-hover: rgba(32, 201, 151, .2);
    
    /* Card & Input Colors */
    --card-bg: #2d2d2d;
    --input-bg: rgba(255, 255, 255, .05);
    --input-border: rgba(255, 255, 255, .15);
    --input-text: #ffffff;
    
    /* Status Colors */
    --error-color: #dc3545;
    --error-light: rgba(220, 53, 69, .1);
    --success-color: #20c997;
    --success-light: rgba(32, 201, 151, .1);
    --warning-color: #ffc107;
    --warning-light: rgba(255, 193, 7, .1);
    --info-color: #0dcaf0;
    --info-light: rgba(13, 202, 240, .1);
}

/* ===============================================
   GLOBAL BASE STYLES
   =============================================== */

html, body {
    height: 100%;
}

body {
    background: var(--bg-primary);
    color: var(--text);
}

main {
    flex: 1 0 auto;
}

/* Theme-aware overrides */
.bg-dark {
    background: var(--surface) !important;
}

.text-muted {
    color: var(--muted) !important;
}

.border-secondary {
    border-color: var(--input-border) !important;
}

.card {
    background: var(--card-bg) !important;
}

/* ===============================================
   TYPOGRAPHY COMPONENTS
   =============================================== */

.title-highlight {
    background: linear-gradient(120deg, var(--table-accent) 0%, var(--table-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.condition-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(120deg, var(--table-accent) 0%, var(--table-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.superclass-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--table-accent);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    margin-bottom: 1.5rem;
}

.celltype-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--table-accent);
    margin-bottom: 1rem;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--table-accent);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    margin-bottom: 1.5rem;
}

.faq-question {
    color: var(--table-accent);
    font-weight: 600;
}

/* ===============================================
   HERO SECTION COMPONENTS
   =============================================== */

.hero-section,
.about-hero,
.superclass-hero,
.celltype-hero,
.condition-hero {
    padding: 4rem 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--input-border);
}

.condition-hero {
    padding: 6rem 0;
}

.hero-section::before,
.about-hero::before,
.superclass-hero::before,
.celltype-hero::before,
.condition-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.344 0L13.858 8.485 15.272 9.9l7.9-7.9h-.828zm5.656 0L19.515 8.485 17.343 10.657 28 0h-z' fill='%233d3d3d' fill-opacity='0.1'/%3E%3C/svg%3E");
    opacity: .4;
}

.about-hero::before,
.superclass-hero::before,
.celltype-hero::before,
.condition-hero::before {
    display: none;
}

/* ===============================================
   CARD COMPONENTS
   =============================================== */

.card,
.stat-card,
.about-content,
.param-table,
.celltype-card,
.value-card,
.condition-description,
.info-box {
    border-radius: 1rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--input-border);
    transition: all 0.3s ease;
}

.condition-description {
    padding: 2.5rem;
    margin: -3rem auto 3rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.value-card {
    margin-bottom: 1rem;
    height: 100%;
}

.value-card:hover {
    transform: translateY(-5px);
    border-color: var(--table-accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.value-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.value-title {
    color: var(--table-accent);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.value-description {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    white-space: pre-line;
}

.stats-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--table-accent-light);
    border-radius: 1rem;
    font-size: 0.85rem;
    color: var(--table-accent);
    margin-top: 0.5rem;
}

.metadata {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--input-border);
}

.stat-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.celltype-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* ===============================================
   STATISTICS COMPONENTS
   =============================================== */

.stats-section {
    margin-top: -3rem;
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--table-accent);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* ===============================================
   GRID LAYOUTS
   =============================================== */

.celltype-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.celltype-grid > div {
    flex: 0 0 calc(33.333% - 0.67rem);
    max-width: calc(33.333% - 0.67rem);
}

@media (max-width: 1200px) {
    .celltype-grid > div {
        flex: 0 0 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
}

@media (max-width: 768px) {
    .celltype-grid > div {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.top-row > div {
    flex: 1 1 300px;
}

.tick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

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

.search-container {
    backdrop-filter: blur(10px);
    background: var(--surface-t);
    border-radius: 1rem;
    padding: 2rem;
}

.search-input {
    border: 2px solid var(--input-border);
    background: var(--input-bg);
    color: var(--input-text);
}

.search-input:focus {
    background: var(--input-bg);
    border-color: var(--table-accent);
    box-shadow: 0 0 0 .25rem var(--table-accent-light);
    color: var(--input-text);
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--table-accent-light);
}

/* ===============================================
   FORM COMPONENTS
   =============================================== */

form {
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
}

/* ===============================================
   TABLE COMPONENTS
   =============================================== */

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: .5rem;
    overflow: hidden;
    background: var(--card-bg);
}

thead {
    background: var(--table-accent);
    color: #fff;
}

tbody tr:nth-child(odd) {
    background: var(--table-accent-light);
}

th, td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--muted);
    color: var(--text);
}

tbody tr:hover {
    background: var(--table-hover);
}

/* DataTables specific overrides */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text) !important;
    background: var(--card-bg) !important;
    border-color: var(--input-border) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--table-accent-light) !important;
    border-color: var(--table-accent) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--table-accent) !important;
    border-color: var(--table-accent) !important;
    color: #fff !important;
}

/* ===============================================
   ALERT COMPONENTS
   =============================================== */

.alert-success {
    background-color: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background-color: var(--error-light);
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background-color: var(--info-light);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* ===============================================
   ANALYSIS COMPONENTS
   =============================================== */

.analysis-section {
    margin-top: 3rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--input-border);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.chart-description {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ===============================================
   EXPLORER COMPONENTS
   =============================================== */

.explorer-section {
    background: var(--bg-primary);
    padding: 2rem 0;
    min-height: 100vh;
}

.filter-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--input-border);
    margin-bottom: 1.5rem;
}

.filter-title {
    color: var(--table-accent);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--input-border);
}

.celltype-search {
    position: relative;
}

.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-t);
    border: 1px solid var(--input-border);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--input-border);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.suggestion-item:hover {
    background: var(--table-hover);
}

.granularity-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    background: var(--table-accent-light);
    color: var(--table-accent);
}

.selected-filter {
    display: inline-flex;
    align-items: center;
    background: var(--table-accent-light);
    color: var(--table-accent);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    margin: 0.25rem;
    font-size: 0.875rem;
}

.remove-filter {
    margin-left: 0.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.remove-filter:hover {
    opacity: 1;
}

.condition-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.condition-select:focus {
    background: var(--input-bg);
    border-color: var(--table-accent);
    box-shadow: 0 0 0 0.25rem var(--table-accent-light);
}

.condition-select option {
    background: var(--card-bg);
    color: var(--text);
}

.results-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--input-border);
}

.comparison-group {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--input-border);
}

.comparison-label {
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.sex-selector {
    margin-top: 1rem;
}

.sex-label {
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.tick-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--input-border);
    margin-bottom: 1.5rem;
}

.tick-section > label.form-label {
    display: block;
    text-align: center;
    margin-bottom: 1rem;
}

.tick-section .form-check {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tick-section .form-check-label {
    text-align: right;
    flex: 1;
}

/* ===============================================
   CONDITION TYPE COMPONENTS
   =============================================== */

.condition-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid var(--input-border);
    text-decoration: none;
    display: block;
}

.condition-card:hover {
    transform: translateY(-5px);
    border-color: var(--table-accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.condition-breadcrumb {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.condition-breadcrumb:hover {
    color: var(--table-accent);
}

.condition-title:not(.condition-title-4rem) {
    color: var(--table-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.condition-title-4rem {
    font-size: 4rem;
    font-weight: 700;
    color: var(--table-accent);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    margin-bottom: 1rem;
}

.condition-description {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.value-count {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--table-accent-light);
    border-radius: 1rem;
    font-size: 0.85rem;
    color: var(--table-accent);
}

.last-updated {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--input-border);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.analysis-controls {
    display: flex;
    gap: 1rem;
}

.control-group {
    background: var(--input-bg);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.control-label {
    color: var(--muted);
    margin-right: 0.5rem;
}

.table-wrapper {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 2rem;
}

.table-dark th {
    background: var(--input-bg);
    border: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-dark td {
    border: none;
    vertical-align: middle;
}

.fold-change-up {
    color: var(--table-accent);
}

.fold-change-down {
    color: var(--error-color);
}

/* ===============================================
   DISCLAIMER COMPONENTS
   =============================================== */

.disclaimer-hero {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.disclaimer-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.344 0L13.858 8.485 15.272 9.9l7.9-7.9h-.828zm5.656 0L19.515 8.485 17.343 10.657 28 0h-z' fill='%233d3d3d' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.disclaimer-content {
    background: rgba(33, 37, 41, 0.95);
    border-radius: 1rem;
    padding: 2.5rem;
    margin: -3rem auto 3rem;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer-content h1 {
    font-size: 2.25rem;
    color: #20c997;
    margin-bottom: 1.5rem;
}

.disclaimer-content h2 {
    font-size: 1.75rem;
    color: #20c997;
    margin: 2rem 0 1rem;
}

.disclaimer-content h3 {
    font-size: 1.4rem;
    color: #20c997;
    margin: 1.5rem 0 0.75rem;
}

.disclaimer-content p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.disclaimer-content strong {
    color: #20c997;
    font-weight: 600;
}

.disclaimer-content ul, .disclaimer-content ol {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.disclaimer-content li {
    margin-bottom: 0.75rem;
}

.disclaimer-content blockquote {
    background: rgba(32, 201, 151, 0.1);
    border-left: 4px solid #20c997;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.disclaimer-content blockquote.warning {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
}

.disclaimer-content a {
    color: #20c997;
    text-decoration: none;
    transition: color 0.3s ease;
}

.disclaimer-content a:hover {
    color: #198754;
}

.disclaimer-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
}

.disclaimer-content th {
    background: rgba(32, 201, 151, 0.1);
    color: #20c997;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(32, 201, 151, 0.2);
}

.disclaimer-content td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer-content tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.disclaimer-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.disclaimer-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

/* ===============================================
   MARKDOWN CONTENT STYLES
   =============================================== */

.markdown-content {
    /* Text styling */
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 1rem;
}

/* Headings */
.markdown-content h1 {
    font-size: 2.5rem;
    margin: 2rem 0 1rem;
    color: #20c997;
    font-weight: 700;
}

.markdown-content h2 {
    font-size: 2rem;
    margin: 1.75rem 0 1rem;
    color: #20c997;
    font-weight: 600;
}

.markdown-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: #20c997;
}

/* Paragraphs and spacing */
.markdown-content p {
    margin-bottom: 1rem;
}

/* Lists */
.markdown-content ul,
.markdown-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

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

/* Links */
.markdown-content a {
    color: #20c997;
    text-decoration: none;
    transition: color 0.2s ease;
}

.markdown-content a:hover {
    color: #198754;
    text-decoration: underline;
}

/* Blockquotes */
.markdown-content blockquote {
    border-left: 4px solid #20c997;
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    background: rgba(32, 201, 151, 0.1);
}

/* Code blocks */
.markdown-content pre {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.markdown-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Tables */
.markdown-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.markdown-content th,
.markdown-content td {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-content th {
    background: rgba(32, 201, 151, 0.1);
    font-weight: 600;
}

/* Images */
.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

/* Definition Lists */
.markdown-content dt {
    font-weight: 600;
    color: #20c997;
    margin-top: 1rem;
}

.markdown-content dd {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* Horizontal Rule */
.markdown-content hr {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* ===============================================
   REPORT COMPONENTS
   =============================================== */

.report-hero {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

:root .report-hero {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.report-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374z' fill='%233d3d3d' fill-opacity='0.3'/%3E%3C/svg%3E");
    opacity: 0.3;
}

:root .report-hero::before {
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374z' fill='%23d0d0d0' fill-opacity='0.25'/%3E%3C/svg%3E");
    opacity: 0.25;
}

.report-hero,
.report-hero :where(h1, h2, h3, h4, h5, p, span, div) {
    color: #ffffff;
}

:root .report-hero,
:root .report-hero :where(h1, h2, h3, h4, h5, p, span, div) {
    color: #212529;
}

.report-summary {
    margin-bottom: 2rem;
}

.report-summary .card {
    background: #2d2d2d;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid #20c997;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

:root .report-summary .card {
    background: #fff;
    color: #212529;
    border: 1px solid #198754;
}

.report-summary .card-body p {
    margin-bottom: 0.75rem;
}

.report-summary .card-body p:last-child {
    margin-bottom: 0;
}

.report-summary strong {
    color: inherit;
}

.llm-summary {
    background: #2d2d2d;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid #20c997;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

:root .llm-summary {
    background: #fff;
    color: #212529;
    border: 1px solid #198754;
}

.llm-summary h4 {
    color: inherit;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.llm-summary p {
    margin-bottom: 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

.expiration-notice {
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #198754;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

:root .expiration-notice {
    background: #f8f9fa;
    color: #212529;
}

.accordion-button.collapsed {
    background: #2d2d2d;
    color: #fff !important;
}

:root .accordion-button.collapsed {
    background: #f8f9fa;
    color: #212529 !important;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #198754;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.tick-section {
    flex: 1 1 220px;
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--input-border);
    text-align: center;
}

.top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.top-row > div {
    flex: 1 1 300px;
    min-width: 300px;
}

/* ===============================================
   SEX DIFFERENCES COMPONENTS
   =============================================== */

.sex-hero {
    background: linear-gradient(45deg, var(--surface), var(--card-bg));
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.sex-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374z' fill='%233d3d3d' fill-opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.content-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-badge {
    background: var(--table-accent-light);
    border: 1px solid var(--table-accent);
    color: var(--table-accent);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem;
}

.filter-remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.filter-remove:hover {
    opacity: 1;
}

.table-dark {
    --bs-table-bg: transparent;
}

.table-dark th {
    background: var(--input-bg);
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-dark td {
    border-color: var(--input-border);
}

.loading-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--table-accent);
}

.breadcrumb-item.active {
    color: var(--table-accent);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--muted);
}

/* ===============================================
   GENE DETAIL COMPONENTS
   =============================================== */

.gene-hero {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.gene-hero::before {
    display: none;
}

.gene-symbol {
    font-size: 4rem;
    font-weight: 700;
    color: var(--table-accent);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    margin-bottom: 1rem;
}

.gene-ids {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    color: var(--muted);
}

.gene-id-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.gene-id-badge:hover {
    background: var(--table-accent-light);
    transform: translateY(-2px);
}

.gene-description {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2.5rem;
    margin: -3rem auto 3rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.info-card {
    background: var(--card-bg);
    border-radius: 1rem;
    height: 100%;
    padding: 2rem;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.card-title {
    color: var(--table-accent);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--input-border);
}

.info-list dt {
    color: var(--muted);
    font-weight: 500;
}

.info-list dd {
    color: var(--text);
    margin-bottom: 1rem;
}

.table-container {
    border-radius: 0.5rem;
    overflow: hidden;
}

.gene-link {
    color: var(--table-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gene-link:hover {
    color: var(--table-accent-light);
}

.interaction-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--table-accent-light);
    border-radius: 1rem;
    font-size: 0.85rem;
    color: var(--table-accent);
}

.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background-color: var(--table-hover) !important;
    transform: translateX(5px);
}

.placeholder-glow {
    /* No color override */
}

.spinner-container {
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diff-exp-section {
    margin-top: 2rem;
}

.volcano-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* ===============================================
   SUPERCLUSTER DETAIL COMPONENTS
   =============================================== */

.superclass-stats {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border: 1px solid var(--input-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--input-border);
}

.stat-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--muted);
}

.fine-celltype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.fine-celltype-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--input-border);
}

.fine-celltype-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--table-accent);
}

.fine-celltype-title {
    color: var(--table-accent);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.allen-brain-id {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--table-accent-light);
    border-radius: 1rem;
    font-size: 0.85rem;
    color: var(--table-accent);
    margin-bottom: 1rem;
}

.superclass-intro {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--input-border);
}

.superclass-intro h2 {
    color: var(--table-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.superclass-intro p {
    color: var(--text);
    line-height: 1.6;
}

.superclass-link {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.superclass-link:hover {
    color: var(--table-accent);
}
