/* The Cancer Antibody Atlas Styles */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    height: 100%;
    background: linear-gradient(135deg, #B9DCF2 0%, #F6CFBE 100%);
    background-attachment: fixed;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6; 
    color: #333; 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 90px; /* DESKTOP: Space for sticky header */
}

.container { 
    max-width: 1800px;
    margin: 0 auto; 
    padding: 20px;
    flex: 1 0 auto;
    width: 100%;
}

/* ===== UNIFIED STICKY HEADER - CSS ONLY ===== */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #EEAF94 0%, #146DA4 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 15px 0; /* DESKTOP: Header padding */
    min-height: 90px; /* DESKTOP: Header height */
}

header .container {
    display: flex;
    align-items: center;
    gap: 30px; /* DESKTOP: Gap between logo/title and nav */
    padding: 0 15px; /* DESKTOP: Left/right margins */
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
}

/* DESKTOP: Logo size */
.header-logo {
    position: static !important;
    transform: none !important;
    height: 80px;
    width: auto;
    opacity: 0.95;
    flex-shrink: 0;
    left: auto !important;
    top: auto !important;
    z-index: auto !important;
}

/* DESKTOP: Title size and position */
header h1 {
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
    flex-shrink: 0;
    position: relative;
    top: -12px;
}

/* DESKTOP: Subtitle size and position */
.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.78rem;
    margin: 0;
    line-height: 1.2;
    position: absolute;
    left: 100px;
    top: 48px;
    max-width: 320px;
    white-space: normal;
}

/* DESKTOP: Nav-wrapper positioning - ALIGN WITH CONTAINER */
body > .container > .nav-wrapper {
    position: fixed !important;
    top: 15px !important;
    right: calc((100vw - 1800px) / 2 + 20px) !important; /* Align with container edge */
    left: auto !important;
    z-index: 1001 !important;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 600px !important;
}

/* Fallback for smaller screens */
@media (max-width: 1840px) {
    body > .container > .nav-wrapper {
        right: 20px !important;
    }
}

/* DESKTOP: Search section width */
.search-section {
    flex: 0 0 auto;
    width: 100%;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 10px 50px 10px 14px;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    height: 42px;
    box-sizing: border-box;
}

.search-box:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.search-box::placeholder {
    color: #718096;
    opacity: 0.85;
}

.search-button {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: #146DA4;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
}

.search-button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.search-button:hover {
    background: #0d5380;
}

.search-button:active {
    transform: translateY(-50%) scale(0.95);
}

/* DESKTOP: Nav buttons spacing and width */
.nav-buttons {
    display: flex !important;
    gap: 8px;
    flex-shrink: 0;
    width: 100%;
}

.back-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    height: 32px;
    box-sizing: border-box;
    flex: 1;
    min-width: 0;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== END UNIFIED STICKY HEADER ===== */

/* Info Sections - smaller text for ALL content */
.info-section {
    background: white; 
    border-radius: 12px; 
    padding: 1.5rem; 
    margin: 1rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1); 
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
    line-height: 1.5;
}

.info-section h2 { 
    color: #495057; 
    margin: 0 0 1rem 0; 
    font-weight: 500; 
    font-size: 1.25rem;
}

.info-section h3 {
    color: #495057;
    margin: 1rem 0 0.5rem 0;
    font-weight: 500;
    font-size: 1.1rem;
}

.info-section p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

.info-section ul,
.info-section ol {
    font-size: 0.85rem;
    line-height: 1.5;
}

.additional-info {
    margin-top: 20px; 
    padding-top: 20px; 
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
}

/* Two-Column Top Layout */
.top-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.top-section-grid .info-section {
    margin: 0;
    height: 100%;
}

.top-section-grid .info-section:first-child {
    font-size: 0.85rem;
}

.top-section-grid .info-section:first-child p {
    margin: 0.5rem 0;
    line-height: 1.4;
    font-size: 0.85rem;
}

.top-section-grid .info-section:first-child .external-links {
    margin: 1rem 0 0.5rem 0;
}

.top-section-grid .info-section:first-child .external-link {
    padding: 8px 14px;
    font-size: 0.9rem;
}

.top-section-grid .info-section:first-child .additional-info {
    margin-top: 15px;
    padding-top: 15px;
}

.top-section-grid .info-section:last-child h2 {
    margin-bottom: 0.5rem;
}

.top-section-grid .info-section:last-child p {
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Lollipop Plot */
.lollipop-plot {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    overflow: hidden;
}

.lollipop-image {
    max-width: 100%;
    max-height: 450px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.plot-caption {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
    max-width: 1600px;
    margin: 0 auto;
    line-height: 1.4;
    text-align: center;
}

/* Markdown Figure (for larger workflow diagrams) */
.markdown-figure {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    overflow: hidden;
}

.markdown-figure-image {
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.markdown-figure-caption {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
    max-width: 1600px;
    margin: 0 auto;
    line-height: 1.4;
    text-align: center;
}

/* External Links */
.external-links { 
    display: flex; 
    gap: 15px; 
    margin: 1rem 0; 
    flex-wrap: wrap; 
}

.external-link {
    background: #146DA4; 
    color: white; 
    padding: 10px 18px; 
    border-radius: 8px;
    text-decoration: none; 
    font-weight: 500; 
    transition: all 0.2s ease;
    display: inline-block;
}

.external-link:hover { 
    background: #EEAF94; 
    transform: translateY(-2px); 
}

/* Cell Visualization */
.cell-visualization { 
    text-align: center; 
    margin: 2rem 0;
    width: 100%;
    overflow: hidden;
}

.cell-svg-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    background: white; 
    border: 3px solid #dee2e6;
    border-radius: 15px; 
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    width: 100%;
    max-height: 675px;
    margin: 0 auto 1rem auto;
    box-sizing: border-box;
    overflow: hidden;
}

.cell-svg {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important; 
    margin: 0 !important;
    border-radius: 8px; 
    border: 1px solid #f1f3f4;
}

.location-list {
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    justify-content: center; 
    margin-top: 1.5rem;
    padding: 0 10px;
}

.location-item {
    background: #146DA4;
    color: white;
    padding: 8px 15px; 
    border-radius: 25px; 
    font-size: 0.9rem; 
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-item:hover {
    background: #EEAF94;
    transform: translateY(-2px);
}

.svg-error {
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* Gene Grid */
.gene-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px; 
    margin: 2rem 0;
}

.gene-card {
    background: white; 
    border-radius: 12px; 
    padding: 1.8rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    transition: all 0.3s ease;
    border: 1px solid #e9ecef; 
    position: relative;
}

.gene-card::before {
    content: ""; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 4px;
    background: linear-gradient(135deg, #146DA4, #EEAF94);
    border-radius: 12px 12px 0 0;
}

.gene-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 30px rgba(0,0,0,0.15); 
}

.gene-name {
    font-size: 1.4rem; 
    font-weight: 600; 
    color: #146DA4;
    text-decoration: none; 
    margin-bottom: 0.5rem; 
    display: block;
}

.gene-name:hover { 
    color: #EEAF94; 
}

.gene-synonym { 
    color: #6c757d; 
    font-size: 0.9rem; 
    margin-bottom: 0.8rem; 
}

.gene-description { 
    color: #495057; 
    font-size: 0.95rem; 
    line-height: 1.6; 
}

/* Virus Grid */
.virus-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px; 
    margin: 2rem 0;
}

.virus-card {
    background: white; 
    border-radius: 12px; 
    padding: 1.8rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    transition: all 0.3s ease;
    border: 1px solid #e9ecef; 
    position: relative;
}

.virus-card::before {
    content: ""; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 4px;
    background: linear-gradient(135deg, #E04643, #355C7D);
    border-radius: 12px 12px 0 0;
}

.virus-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 30px rgba(0,0,0,0.15); 
}

.virus-name {
    font-size: 1.4rem; 
    font-weight: 600; 
    color: #E04643;
    text-decoration: none; 
    margin-bottom: 0.5rem; 
    display: block;
}

.virus-name:hover { 
    color: #355C7D; 
}

.virus-family { 
    color: #6c757d; 
    font-size: 0.9rem; 
    margin-bottom: 0.8rem; 
}

.virus-description { 
    color: #495057; 
    font-size: 0.95rem; 
    line-height: 1.6; 
}

.section-divider {
    margin: 3rem 0 2rem 0;
    text-align: center;
}

.section-divider h2 {
    color: #495057;
    margin-bottom: 1rem;
}

/* Status Messages */
.status-message {
    background: #d1ecf1; 
    color: #0c5460; 
    padding: 12px 20px; 
    border-radius: 8px;
    margin: 1rem 0; 
    text-align: center; 
    border-left: 4px solid #0c5460;
}

code {
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

/* TCGA Prognostics */
.tcga-heatmap-container {
    margin: 20px 0;
    text-align: center;
}

.tcga-heatmap {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 25px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.tcga-row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.tcga-cell {
    flex: 1;
    max-width: 280px;
    height: 75px;
    border: 2px solid #333;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    padding: 4px;
    text-align: center;
}

.tcga-cell-cancer {
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}

.tcga-cell-pvalue {
    font-size: 0.75em;
    font-weight: 500;
    opacity: 0.9;
}

.tcga-cell[data-value="NA"] {
    background-color: white;
    color: #666;
}

.tcga-cell[data-value*="unprognostic"] {
    background-color: #d6d6d6;
    color: #333;
}

.tcga-cell[data-value*="potential prognostic unfavorable"] {
    background-color: #ff7f7f;
    color: white;
}

.tcga-cell[data-value*="validated prognostic unfavorable"] {
    background-color: #770c19;
    color: white;
}

.tcga-cell[data-value*="potential prognostic favorable"] {
    background-color: #7fbfff;
    color: white;
}

.tcga-cell[data-value*="validated prognostic favorable"] {
    background-color: #146DA4;
    color: white;
}

.tcga-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
}

.tcga-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-item[data-type="NA"] .legend-color {
    background-color: white;
}

.legend-item[data-type="unprognostic"] .legend-color {
    background-color: #d6d6d6;
}

.legend-item[data-type="potential_unfavorable"] .legend-color {
    background-color: #ff7f7f;
}

.legend-item[data-type="validated_unfavorable"] .legend-color {
    background-color: #cc0000;
}

.legend-item[data-type="potential_favorable"] .legend-color {
    background-color: #7fbfff;
}

.legend-item[data-type="validated_favorable"] .legend-color {
    background-color: #0066cc;
}

/* Heatmap Viewer */
.heatmap-viewer {
    width: 100%;
    margin: 20px 0;
}

.heatmap-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.control-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

#huprot-platform-select,
#huscan-filter-select,
#huprot-filter-select,
#phip-filter-select {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

#huprot-platform-select:focus,
#huscan-filter-select:focus,
#huprot-filter-select:focus,
#phip-filter-select:focus {
    outline: none;
    border-color: #146DA4;
}

.data-type-buttons {
    display: flex;
    gap: 5px;
}

.data-btn {
    padding: 8px 16px;
    border: 2px solid #146DA4;
    background: white;
    color: #146DA4;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.data-btn:hover {
    background: #146DA4;
    color: white;
}

.data-btn.active {
    background: #146DA4;
    color: white;
}

.stats-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-btn {
    padding: 6px 12px;
    border: 1px solid #EEAF94;
    background: white;
    color: #EEAF94;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.stats-btn:hover {
    background: #EEAF94;
    color: white;
}

.stats-btn.active {
    background: #EEAF94;
    color: white;
    box-shadow: 0 2px 5px rgba(238, 175, 148, 0.3);
}

.no-stats-message {
    font-style: italic;
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
    padding: 8px 0;
}

.heatmap-container {
    overflow-x: auto;
    overflow-y: visible;
    margin: 20px 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 1400px;
}

.row-label-header {
    background: #495057;
    color: white;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 15;
    min-width: 220px;
    max-width: 220px;
    border-right: 2px solid #333;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.group-header {
    background: #6c757d;
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid #333;
    box-sizing: border-box;
}

.sample-header {
    background: #f8f9fa;
    color: #495057;
    padding: 4px 2px;
    text-align: center;
    font-weight: 500;
    font-size: 0.6rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 100px;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    border: 1px solid #dee2e6;
    word-break: break-all;
    position: sticky;
    top: 0;
    z-index: 8;
    box-sizing: border-box;
    overflow: hidden;
    vertical-align: bottom;
}

.data-row {
    transition: all 0.2s ease;
}

.data-row:hover {
    background-color: rgba(20, 109, 164, 0.1);
}

.data-row.stats-highlighted {
    background-color: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
}

.row-label {
    background: #f8f9fa;
    padding: 6px 8px;
    font-weight: 500;
    border-right: 2px solid #dee2e6;
    position: sticky;
    left: 0;
    z-index: 9;
    min-width: 220px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.stats-highlighted .row-label {
    background: rgba(255, 215, 0, 0.1);
    border-right-color: #FFD700;
}

.data-cell {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #333;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box !important;
    overflow: hidden;
    line-height: 22px;
    text-align: center;
    vertical-align: middle;
}

.data-cell:hover {
    border: 2px solid #146DA4;
    z-index: 5;
    transform: scale(1.1);
}

.stats-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 215, 0, 0.95);
    border: 1px solid #FFA500;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.65rem;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.stats-info {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.stats-info span {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.p-value {
    color: #dc3545;
}

.bh-status {
    color: #28a745;
}

.log-odds {
    color: #6f42c1;
}

.not-significant {
    color: #fd7e14;
    font-style: italic;
}

.heatmap-legend {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.legend-section {
    flex: 1;
}

.legend-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 0.9rem;
}

.legend-item span {
    font-size: 0.8rem;
    color: #495057;
}

.heatmap-error {
    text-align: center;
    padding: 40px 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.error-detail {
    font-size: 0.9rem;
    margin-top: 10px;
    opacity: 0.8;
    font-family: monospace;
}

.no-data-message {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

#huprot-section[style*="display: none"],
#huscan-section[style*="display: none"],
#phip-section[style*="display: none"] {
    display: none !important;
}

#huprot-viewer-container .data-cell[data-platform="635"] {
    background-color: #770C19 !important;
}

#huprot-viewer-container .data-cell[data-platform="532"] {
    background-color: #2E7D32 !important;
}

.featured-badge {
    display: inline-block;
    font-size: 12px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.featured-badge.virus {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

.loading-cards,
.error-message,
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.error-message {
    color: #dc3545;
}

.no-results strong {
    color: #495057;
}

.search-results-header {
    grid-column: 1 / -1;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
}

/* Footer - Sticky to Bottom */
footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #ffffff;
    border-top: 2px solid #dee2e6;
    padding: 20px 0;
    text-align: center;
    width: 100%;
}

footer .container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Virus Visualization */
.virus-visualization {
    text-align: center;
    margin: 1.5rem 0;
    width: 100%;
}

.virus-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    width: 100%;
    max-height: 675px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 300px;
}

.virus-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 635px;
    display: block;
    border-radius: 8px;
}

.virus-image-error {
    padding: 60px 20px;
    text-align: center;
    color: #6c757d;
}

.virus-image-error p {
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
}

/* Collapsible Protein List for Virus Pages */
.protein-list-container {
    position: relative;
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #146DA4;
    border-radius: 4px;
}

.protein-list {
    font-size: 13px;
    line-height: 1.6;
    transition: max-height 0.3s ease;
}

.protein-list.collapsed {
    max-height: 120px;
    overflow: hidden;
}

.protein-list-fade {
    position: absolute;
    bottom: 50px;
    left: 12px;
    right: 12px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #f8f9fa);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.protein-list:not(.collapsed) ~ .protein-list-fade {
    opacity: 0;
}

.protein-expand-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #146DA4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.protein-expand-btn:hover {
    background: #0f5380;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    grid-column: 1 / -1;
}

/* ===== SINGLE MOBILE BREAKPOINT @ 768px ===== */
@media (max-width: 768px) {
    /* MOBILE: Body padding for nav buttons + search sticky header */
    body {
        padding-top: 105px;
    }

    /* MOBILE: Header height when collapsed */
    header {
        min-height: 105px;
        padding: 8px 0;
    }

    header .container {
        padding: 0 10px;
    }

    /* MOBILE: Hide logo, title, subtitle */
    .header-logo,
    header h1,
    .subtitle {
        display: none !important;
    }

    /* MOBILE: Nav-wrapper positioning - keep nav buttons */
    body > .container > .nav-wrapper {
        top: 8px !important;
        left: 10px !important;
        right: 10px !important;
        max-width: calc(100vw - 20px) !important;
        gap: 6px;
    }

    /* MOBILE: Keep nav buttons visible */
    .nav-buttons {
        display: flex !important;
        gap: 6px;
    }

    .back-link {
        font-size: 0.8rem;
        padding: 5px 12px;
        height: 28px;
    }

    /* MOBILE: Search section full width */
    .search-section {
        width: 100%;
        max-width: 100%;
    }

    .search-box {
        height: 38px;
        font-size: 13px;
    }

    .search-button {
        width: 34px;
        height: 34px;
    }

    .search-button svg {
        width: 18px;
        height: 18px;
    }
    
    .container { 
        padding: 15px; 
    }
    
    .top-section-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .top-section-grid .info-section:first-child {
        font-size: 0.85rem;
    }
    
    .top-section-grid .info-section {
        margin: 1rem 0;
        height: auto;
    }
    
    .gene-grid, .virus-grid { 
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    
    .gene-card, .virus-card {
        padding: 1.5rem;
    }
    
    .external-links {
        flex-direction: column;
    }
    
    .external-link {
        text-align: center;
    }
    
    .lollipop-image {
        max-width: 100%;
        max-height: 280px;
    }
    
    .heatmap-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        min-width: 100%;
    }
    
    .data-type-buttons,
    .stats-buttons {
        justify-content: center;
    }
    
    .heatmap-legend {
        flex-direction: column;
        gap: 15px;
    }
    
    .heatmap-table {
        font-size: 0.7rem;
        min-width: 1200px;
    }
    
    .sample-header {
        height: 100px;
        font-size: 0.6rem;
        width: 22px;
    }
    
    .data-cell {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
        font-size: 0.6rem;
    }
    
    .row-label {
        min-width: 200px;
        max-width: 200px;
        font-size: 0.8rem;
    }
    
    .row-label-header {
        min-width: 200px;
        max-width: 200px;
        font-size: 0.8rem;
    }
    
    .tcga-cell {
        width: 140px;
        height: 60px;
        font-size: 0.7em;
    }
    
    .tcga-cell-cancer {
        font-size: 0.75em;
    }
    
    .tcga-cell-pvalue {
        font-size: 0.65em;
    }
    
    .tcga-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tcga-legend {
        flex-direction: column;
        gap: 10px;
    }
    
    .legend-item {
        justify-content: center;
    }
    
    .stats-overlay {
        font-size: 0.6rem;
        padding: 3px 5px;
    }
    
    .stats-info {
        flex-direction: column;
        gap: 3px;
        align-items: flex-start;
    }
    
    footer {
        padding: 20px 0;
        margin-top: 10px;
    }
    
    footer .container {
        padding: 0 15px;
    }
    
    .footer-content {
        font-size: 0.85rem;
    }

    .virus-image-container {
        max-height: 400px;
        min-height: 200px;
        padding: 15px;
    }
    
    .virus-image {
        max-height: 370px;
    }
    
    .virus-image-error {
        padding: 40px 15px;
    }
    
    .virus-image-error p {
        font-size: 1rem;
    }
}

@media print {
    body {
        padding-top: 0;
    }

    header {
        position: static;
    }

    .heatmap-controls {
        display: none;
    }
    
    .heatmap-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .heatmap-table {
        font-size: 0.6rem;
    }
}

/* Add top spacing for two-column layout on subpages */
.container > .top-section-grid {
    margin-top: 20px;
}