﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Exclusive Chromosome Views - Premium Dark Theme with Gold Accents
 * Styling for By Chromosome, By Region, and Table/Heatmap views.
 */

/* ==========================================================================
   CSS VARIABLES - EXCLUSIVE CHROMOSOME THEME
   ========================================================================== */

:root {
    /* Colors - Premium Gold/Amber Palette */
    --exa-chr-gold: #C4956A;
    --exa-chr-gold-light: #D4B896;
    --exa-chr-gold-dark: #8B6D4F;
    --exa-chr-amber: #d4a017;
    --exa-chr-amber-light: #f4c430;
    
    /* Backgrounds */
    --exa-chr-bg: #0a0a0a;
    --exa-chr-card-bg: #1a1a1a;
    --exa-chr-section-bg: #1a1a1a;
    
    /* Text */
    --exa-chr-text: #ffffff;
    --exa-chr-text-muted: rgba(255, 255, 255, 0.6);
    --exa-chr-text-dark: #1a1a1a;
    
    /* Borders & Shadows */
    --exa-chr-border: rgba(196, 149, 106, 0.2);
    --exa-chr-border-hover: rgba(196, 149, 106, 0.4);
    --exa-chr-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --exa-chr-shadow-hover: 0 8px 30px rgba(196, 149, 106, 0.25);
    --exa-chr-shadow-gold: 0 4px 20px rgba(196, 149, 106, 0.3);
    
    /* Typography */
    --exa-chr-font-display: 'Cormorant Garamond', Georgia, serif;
    --exa-chr-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Layout */
    --exa-chr-radius: 12px;
    --exa-chr-radius-sm: 8px;
    
    /* Transitions */
    --exa-chr-transition-fast: 0.2s ease;
    --exa-chr-transition-medium: 0.3s ease;
    --exa-chr-transition-slow: 0.5s ease;
}

/* ==========================================================================
   BASE CONTAINER
   ========================================================================== */

.exa-chr-view {
    color: var(--exa-chr-text);
    font-family: var(--exa-chr-font-body);
}

/* ==========================================================================
   BY CHROMOSOME VIEW
   ========================================================================== */

.exa-chr-by-chromosome {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exa-chr-chromosome-card {
    background: var(--exa-chr-card-bg);
    border: 1px solid var(--exa-chr-border);
    border-radius: var(--exa-chr-radius);
    overflow: hidden;
    transition: all var(--exa-chr-transition-medium);
    box-shadow: var(--exa-chr-shadow);
}

.exa-chr-chromosome-card:hover {
    border-color: var(--exa-chr-border-hover);
    box-shadow: var(--exa-chr-shadow-hover);
    transform: translateY(-2px);
}

.exa-chr-chromosome-header {
    padding: 1.5rem;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--exa-chr-border);
    transition: background var(--exa-chr-transition-fast);
}

.exa-chr-chromosome-header:hover {
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.1) 0%, transparent 100%);
}

.exa-chr-chromosome-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.exa-chr-chromosome-title-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--exa-chr-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--exa-chr-text);
}

.exa-chr-chromosome-title-text i {
    color: var(--exa-chr-gold);
    font-size: 1.5rem;
}

.exa-chr-chromosome-title-text span {
    background: linear-gradient(135deg, var(--exa-chr-gold) 0%, var(--exa-chr-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.exa-chr-chromosome-expand {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(196, 149, 106, 0.1);
    color: var(--exa-chr-gold);
    transition: all var(--exa-chr-transition-fast);
}

.exa-chr-chromosome-expand:hover {
    background: rgba(196, 149, 106, 0.2);
    transform: scale(1.1);
}

.exa-chr-chromosome-expand i {
    transition: transform var(--exa-chr-transition-medium);
}

.exa-chr-chromosome-card[aria-expanded="true"] .exa-chr-chromosome-expand i,
.exa-chr-chromosome-card:not(.collapsed) .exa-chr-chromosome-expand i {
    transform: rotate(180deg);
}

.exa-chr-chromosome-progress {
    display: flex;
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.exa-chr-progress-bar {
    height: 100%;
    border-radius: 0;
    transition: width 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* Round only the first and last segments */
.exa-chr-progress-bar:first-child {
    border-radius: 7px 0 0 7px;
}

.exa-chr-progress-bar:last-child {
    border-radius: 0 7px 7px 0;
}

.exa-chr-progress-bar:only-child {
    border-radius: 7px;
}

.exa-chr-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: exa-chr-shimmer 2s infinite;
}

@keyframes exa-chr-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.exa-chr-chromosome-details {
    padding: 1.5rem;
    background: rgba(196, 149, 106, 0.02);
}

.exa-chr-chromosome-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 991px) {
    .exa-chr-chromosome-details-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   BY REGION VIEW - CONTROLS
   ========================================================================== */

.exa-chr-components-controls {
    background: var(--exa-chr-card-bg);
    border: 1px solid var(--exa-chr-border);
    border-radius: var(--exa-chr-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.exa-chr-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.exa-chr-controls-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--exa-chr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.exa-chr-controls-label i {
    color: var(--exa-chr-gold);
}

.exa-chr-sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exa-chr-btn-sort {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--exa-chr-border);
    color: var(--exa-chr-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--exa-chr-radius-sm);
    transition: all var(--exa-chr-transition-fast);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-family: var(--exa-chr-font-body);
}

.exa-chr-btn-sort:hover {
    background: rgba(196, 149, 106, 0.1);
    border-color: var(--exa-chr-gold);
    color: var(--exa-chr-gold);
}

.exa-chr-btn-sort.active {
    background: var(--exa-chr-gold);
    border-color: var(--exa-chr-gold);
    color: var(--exa-chr-text-dark);
}

.exa-chr-filter-controls {
    flex: 1;
    max-width: 280px;
    margin-left: auto;
}

.exa-chr-filter-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.exa-chr-filter-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--exa-chr-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.exa-chr-filter-input {
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 2.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--exa-chr-border);
    border-radius: 20px;
    color: var(--exa-chr-text);
    font-size: 0.875rem;
    transition: all var(--exa-chr-transition-fast);
    font-family: var(--exa-chr-font-body);
}

.exa-chr-filter-input::placeholder {
    color: var(--exa-chr-text-muted);
}

.exa-chr-filter-input:focus {
    outline: none;
    border-color: var(--exa-chr-gold);
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.exa-chr-btn-clear-filter {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--exa-chr-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
    transition: color var(--exa-chr-transition-fast);
    display: none;
}

.exa-chr-btn-clear-filter.visible {
    display: block;
}

.exa-chr-btn-clear-filter:hover {
    color: var(--exa-chr-gold);
}

.exa-chr-summary-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--exa-chr-text-muted);
    flex-wrap: wrap;
}

.exa-chr-stat-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.exa-chr-stat-item i {
    color: var(--exa-chr-gold);
    font-size: 0.8rem;
}

.exa-chr-stat-item strong {
    color: var(--exa-chr-text);
    font-weight: 600;
}

.exa-chr-stat-divider {
    color: var(--exa-chr-text-muted);
    opacity: 0.3;
}

.exa-chr-toggle-all-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    color: var(--exa-chr-gold);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--exa-chr-transition-fast);
}

.exa-chr-toggle-all-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ==========================================================================
   BY REGION VIEW - COMPONENT CARDS
   ========================================================================== */

.exa-chr-components-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exa-chr-component-card {
    background: var(--exa-chr-card-bg);
    border: 1px solid var(--exa-chr-border);
    border-radius: var(--exa-chr-radius);
    box-shadow: var(--exa-chr-shadow);
    margin-bottom: 0;
    transition: all var(--exa-chr-transition-medium);
    overflow: hidden;
    position: relative;
}

.exa-chr-component-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--exa-chr-accent-color, var(--exa-chr-gold));
    border-radius: var(--exa-chr-radius) 0 0 var(--exa-chr-radius);
}

.exa-chr-component-card:hover {
    border-color: var(--exa-chr-border-hover);
    box-shadow: var(--exa-chr-shadow-hover);
    transform: translateY(-2px);
}

.exa-chr-component-card-header {
    display: flex;
    align-items: stretch;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background var(--exa-chr-transition-fast);
}

.exa-chr-component-card-header:hover {
    background: rgba(196, 149, 106, 0.05);
}

.exa-chr-component-info {
    flex: 1;
    min-width: 0;
    padding-right: 1.5rem;
}

.exa-chr-component-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.exa-chr-component-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.35rem;
    box-shadow: 0 0 8px rgba(196, 149, 106, 0.5);
}

.exa-chr-component-titles {
    flex: 1;
    min-width: 0;
}

.exa-chr-component-region-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--exa-chr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.exa-chr-component-region-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--exa-chr-text);
    margin: 0;
    line-height: 1.3;
    font-family: var(--exa-chr-font-body);
}

.exa-chr-component-region-combined {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--exa-chr-text);
    margin: 0;
    line-height: 1.3;
}

.exa-chr-component-quick-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.exa-chr-quick-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--exa-chr-text-muted);
}

.exa-chr-quick-stat i {
    font-size: 0.7rem;
    color: var(--exa-chr-gold);
}

.exa-chr-quick-stat.highlight {
    color: var(--exa-chr-gold);
    font-weight: 600;
}

.exa-chr-quick-stat-divider {
    color: var(--exa-chr-text-muted);
    opacity: 0.3;
    font-size: 0.6rem;
}

.exa-chr-expand-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(196, 149, 106, 0.1);
    color: var(--exa-chr-gold);
    transition: all var(--exa-chr-transition-medium);
    margin-left: auto;
}

.exa-chr-expand-indicator i {
    font-size: 0.7rem;
    transition: transform var(--exa-chr-transition-medium);
}

.exa-chr-component-card-header[aria-expanded="true"] .exa-chr-expand-indicator i,
.exa-chr-component-card-header:not(.collapsed) .exa-chr-expand-indicator i {
    transform: rotate(180deg);
}

.exa-chr-component-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 180px;
}

.exa-chr-component-percentage {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--exa-chr-gold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-family: var(--exa-chr-font-display);
    background: linear-gradient(135deg, var(--exa-chr-gold) 0%, var(--exa-chr-amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.exa-chr-component-percentage-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--exa-chr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.exa-chr-component-progress-wrapper {
    width: 100%;
    min-width: 150px;
}

.exa-chr-component-progress {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.exa-chr-component-progress-bar {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--bar-color, var(--exa-chr-gold)) 0%, var(--exa-chr-amber) 100%);
    box-shadow: 0 0 10px rgba(196, 149, 106, 0.4);
    transition: width 0.8s ease-out;
}

/* ==========================================================================
   CHROMOSOME PILLS
   ========================================================================== */

.exa-chr-pills-container {
    padding: 0.75rem 1.5rem 1.25rem 1.5rem;
    border-top: 1px solid var(--exa-chr-border);
    background: linear-gradient(180deg, rgba(196, 149, 106, 0.05) 0%, transparent 100%);
}

.exa-chr-pills-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 0.75rem 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exa-chr-pills-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--exa-chr-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.exa-chr-pills-header-left i {
    color: var(--exa-chr-gold);
}

.exa-chr-leader-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.2) 0%, rgba(212, 160, 23, 0.2) 100%);
    color: var(--exa-chr-gold);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(196, 149, 106, 0.3);
}

.exa-chr-leader-badge i {
    color: var(--exa-chr-amber);
    font-size: 0.7rem;
}

.exa-chr-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.exa-chr-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--exa-chr-border);
    border-radius: 10px;
    color: var(--exa-chr-text);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--exa-chr-transition-fast);
    cursor: pointer;
    min-width: 105px;
    justify-content: center;
    font-family: var(--exa-chr-font-body);
}

.exa-chr-pill:hover {
    background: rgba(196, 149, 106, 0.15);
    border-color: var(--exa-chr-gold);
    color: var(--exa-chr-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 149, 106, 0.3);
}

.exa-chr-pill i {
    font-size: 0.7rem;
    opacity: 0.9;
}

.exa-chr-pill-number {
    font-weight: 700;
}

.exa-chr-pill-percentage {
    opacity: 0.85;
    font-weight: 500;
}

.exa-chr-pill-leader {
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.2) 0%, rgba(212, 160, 23, 0.2) 100%);
    border-color: var(--exa-chr-gold);
    color: var(--exa-chr-gold);
    box-shadow: 0 0 12px rgba(196, 149, 106, 0.4);
}

.exa-chr-pill-leader:hover {
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.3) 0%, rgba(212, 160, 23, 0.3) 100%);
    box-shadow: 0 0 16px rgba(196, 149, 106, 0.5);
}

.exa-chr-pill-leader .exa-chr-leader-icon {
    color: var(--exa-chr-amber);
}

/* ==========================================================================
   TABLE/HEATMAP VIEW
   ========================================================================== */

.exa-chr-table-container {
    background: var(--exa-chr-card-bg);
    border: 1px solid var(--exa-chr-border);
    border-radius: var(--exa-chr-radius);
    box-shadow: var(--exa-chr-shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* --- Legend ---------------------------------------------------------------- */

.exa-chr-table-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(180deg, rgba(196, 149, 106, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--exa-chr-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.exa-chr-legend-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--exa-chr-text);
}

.exa-chr-legend-title i {
    color: var(--exa-chr-gold);
}

/* "27 regions" pill */
.exa-chr-regions-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(196, 149, 106, 0.15);
    color: var(--exa-chr-amber);
    border: 1px solid rgba(196, 149, 106, 0.3);
    letter-spacing: 0.02em;
}

.exa-chr-legend-scale {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exa-chr-legend-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--exa-chr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.exa-chr-legend-gradient {
    width: 160px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #1a1a1a 0%, #8B6D4F 50%, #d4a017 100%);
    border: 1px solid var(--exa-chr-border);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.exa-chr-legend-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--exa-chr-text-muted);
}

/* --- Table wrapper --------------------------------------------------------- */

.exa-chr-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-height: 640px;
    position: relative;
    /* Firefox */
    scrollbar-color: var(--exa-chr-gold) transparent;
    scrollbar-width: thin;
}

.exa-chr-table-wrapper::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.exa-chr-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.exa-chr-table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #1a1a1a 0%, #8B6D4F 50%, #d4a017 100%);
    border-radius: 999px;
}

.exa-chr-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--exa-chr-amber);
}

/* --- Table base ------------------------------------------------------------ */

.exa-chr-heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    background: #0d0d0d;
    font-size: 0.85rem;
    table-layout: fixed;
}

/* --- Header row (flat dark, single underline) ------------------------------ */

.exa-chr-heatmap-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
    /* single underline rule that works with border-spacing */
    box-shadow: inset 0 -1px 0 var(--exa-chr-border);
}

.exa-chr-heatmap-table thead th {
    background: #0d0d0d;
    color: var(--exa-chr-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.6rem 0.4rem 0.7rem;
    text-align: center;
    white-space: nowrap;
}

.exa-chr-heatmap-table thead th:first-child {
    text-align: left;
    padding-left: 1.25rem;
    min-width: 180px;
    width: 180px;
    color: var(--exa-chr-text);
    z-index: 25;
    background: #0d0d0d;
}

.exa-chr-chromosome-header {
    min-width: 58px;
}

.exa-chr-chromosome-header .exa-chr-number {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
}

/* --- Sticky first column --------------------------------------------------- */

.exa-chr-heatmap-table th:first-child,
.exa-chr-heatmap-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #0d0d0d;
}

/* Soft shadow to indicate scroll */
.exa-chr-heatmap-table th:first-child::after,
.exa-chr-heatmap-table td:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    right: -10px;
    bottom: 0;
    width: 10px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0%, transparent 100%);
    pointer-events: none;
}

/* --- Group section header row --------------------------------------------- */

tr.exa-chr-group-row td {
    position: static;               /* must NOT be sticky — overrides td:first-child rule */
    background: transparent;
    padding: 1rem 1.25rem 0.3rem;
    border: none;
    z-index: auto;
}

tr.exa-chr-group-row td::after {
    display: none;                  /* suppress the sticky shadow pseudo-element */
}

.exa-chr-group-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--exa-chr-amber);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.exa-chr-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(212, 160, 23, 0.15);
    color: var(--exa-chr-amber);
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid rgba(212, 160, 23, 0.3);
}

/* --- Region label cell ----------------------------------------------------- */

.exa-chr-region-cell {
    padding: 0.3rem 0.75rem 0.3rem 1.25rem;
    background: #0d0d0d;
    vertical-align: middle;
}

.exa-chr-region-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.exa-chr-region-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--exa-chr-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* --- Data cells ------------------------------------------------------------ */

.exa-chr-cell-td {
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.exa-chr-cell {
    display: block;
    width: 100%;
    height: 32px;
    border-radius: 4px;
    background: var(--cell-bg, #1a1a1a);
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.exa-chr-cell:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px var(--exa-chr-amber-light), 0 4px 18px rgba(212, 160, 23, 0.45);
    z-index: 5;
}

.exa-chr-cell.is-empty {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.07);
}

.exa-chr-cell.is-empty:hover {
    transform: none;
    box-shadow: none;
}

/* Print-only percentage value (hidden on screen) */
.exa-chr-cell-print-value {
    display: none;
}

/* Row hover highlight (region label column only) */
.exa-chr-heatmap-table tbody tr:hover .exa-chr-region-cell {
    background: rgba(196, 149, 106, 0.06);
}

/* Legacy classes kept in case mobile still references them */
.exa-chr-heatmap-cell-light { color: #f0f0f0; }
.exa-chr-heatmap-cell-dark  { color: #ffffff; }

/* --- Custom tooltip -------------------------------------------------------- */

.exa-chr-tip {
    position: fixed;
    z-index: 1080;
    pointer-events: none;
    min-width: 200px;
    background: #1a1a1a;
    border: 1px solid rgba(196, 149, 106, 0.25);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 0.75rem 0.9rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.exa-chr-tip.is-open {
    opacity: 1;
    transform: translateY(0);
}

.exa-chr-tip-chr {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.15rem;
}

.exa-chr-tip-region {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.exa-chr-tip-pct {
    font-family: var(--exa-chr-font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--exa-chr-gold) 0%, var(--exa-chr-amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.exa-chr-tip-divider {
    border: 0;
    border-top: 1px solid rgba(196, 149, 106, 0.2);
    margin: 0.5rem 0;
}

.exa-chr-tip-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

/* ==========================================================================
   MOBILE CARD VIEW
   ========================================================================== */

@media (max-width: 767.98px) {
    .exa-chr-table-wrapper {
        display: none;
    }
    
    .exa-chr-mobile-cards {
        display: block;
        padding: 1rem;
    }
    
    .exa-chr-table-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .exa-chr-legend-scale {
        width: 100%;
    }
    
    .exa-chr-legend-gradient {
        flex: 1;
        max-width: 200px;
    }
    
    .exa-chr-mobile-toggle-all {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }
    
    .exa-chr-btn-toggle-all {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
        background: rgba(196, 149, 106, 0.1);
        border: 1px solid var(--exa-chr-border);
        border-radius: var(--exa-chr-radius-sm);
        color: var(--exa-chr-gold);
        font-size: 0.8rem;
        font-weight: 500;
        cursor: pointer;
        transition: all var(--exa-chr-transition-fast);
        font-family: var(--exa-chr-font-body);
    }
    
    .exa-chr-btn-toggle-all:hover {
        background: rgba(196, 149, 106, 0.2);
        border-color: var(--exa-chr-gold);
    }
    
    .exa-chr-btn-toggle-all i {
        transition: transform var(--exa-chr-transition-medium);
        font-size: 0.7rem;
    }
    
    .exa-chr-btn-toggle-all.expanded i {
        transform: rotate(180deg);
    }
}

@media (min-width: 768px) {
    .exa-chr-mobile-cards {
        display: none;
    }
}

.exa-chr-mobile-card {
    background: var(--exa-chr-card-bg);
    border: 1px solid var(--exa-chr-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--exa-chr-shadow);
}

.exa-chr-mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--exa-chr-border);
    cursor: pointer;
    transition: background var(--exa-chr-transition-fast);
}

.exa-chr-mobile-card-header:active {
    background: linear-gradient(135deg, rgba(196, 149, 106, 0.15) 0%, transparent 100%);
}

.exa-chr-mobile-card-title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.exa-chr-mobile-card-group {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--exa-chr-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exa-chr-mobile-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--exa-chr-text);
}

.exa-chr-mobile-card-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(196, 149, 106, 0.1);
    color: var(--exa-chr-gold);
    transition: all var(--exa-chr-transition-fast);
}

.exa-chr-mobile-card-toggle i {
    transition: transform var(--exa-chr-transition-medium);
}

.exa-chr-mobile-card.expanded .exa-chr-mobile-card-toggle i {
    transform: rotate(180deg);
}

.exa-chr-mobile-card-body {
    padding: 0.75rem 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.exa-chr-mobile-card.expanded .exa-chr-mobile-card-body {
    max-height: 2000px;
    padding: 0.75rem 1rem;
}

.exa-chr-mobile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.exa-chr-mobile-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
}

.exa-chr-mobile-grid-number {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--exa-chr-text-muted);
    margin-bottom: 0.25rem;
}

.exa-chr-mobile-grid-value {
    font-size: 0.85rem;
    font-weight: 700;
}

.exa-chr-mobile-grid-empty {
    background: rgba(255, 255, 255, 0.05);
    color: var(--exa-chr-text-muted);
}

/* ==========================================================================
   NO RESULTS MESSAGE
   ========================================================================== */

.exa-chr-no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--exa-chr-text-muted);
}

.exa-chr-no-results i {
    color: var(--exa-chr-text-muted);
    opacity: 0.3;
}

.exa-chr-no-results h5 {
    color: var(--exa-chr-text);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   FILTERED OUT ITEMS
   ========================================================================== */

.exa-chr-component-card.exa-chr-filtered-out {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 991.98px) {
    .exa-chr-component-card-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .exa-chr-component-info {
        padding-right: 0;
    }
    
    .exa-chr-component-stats {
        align-items: flex-start;
        min-width: auto;
        width: 100%;
    }
    
    .exa-chr-component-progress-wrapper {
        max-width: 280px;
    }
}

@media (max-width: 767.98px) {
    .exa-chr-components-controls {
        padding: 0.875rem 1rem;
    }
    
    .exa-chr-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .exa-chr-sort-controls {
        justify-content: space-between;
    }
    
    .exa-chr-filter-controls {
        max-width: none;
        margin-left: 0;
    }
    
    .exa-chr-summary-stats {
        justify-content: center;
    }
    
    .exa-chr-component-card {
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }
    
    .exa-chr-component-card-header {
        padding: 1rem 1.25rem;
    }
    
    .exa-chr-pills-container {
        padding: 0.5rem 1.25rem 1rem 1.25rem;
    }
    
    .exa-chr-component-region-name,
    .exa-chr-component-region-combined {
        font-size: 1rem;
    }
    
    .exa-chr-component-percentage {
        font-size: 1.25rem;
    }
    
    .exa-chr-pills {
        gap: 0.375rem;
    }
    
    .exa-chr-pill {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 90px;
        border-radius: 8px;
    }
}

@media (max-width: 575.98px) {
    .exa-chr-pill {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 0;
    }
    
    .exa-chr-btn-sort span.d-none.d-sm-inline {
        display: none !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.exa-chr-component-card-header:focus-visible,
.exa-chr-chromosome-header:focus-visible {
    outline: 2px solid var(--exa-chr-gold);
    outline-offset: 2px;
}

.exa-chr-pill:focus-visible,
.exa-chr-btn-sort:focus-visible {
    outline: 2px solid var(--exa-chr-gold);
    outline-offset: 2px;
}

.exa-chr-filter-input:focus-visible {
    outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .exa-chr-component-card,
    .exa-chr-component-card-header,
    .exa-chr-pill,
    .exa-chr-component-progress-bar,
    .exa-chr-expand-indicator i,
    .exa-chr-btn-sort,
    .exa-chr-heatmap-cell {
        transition: none;
    }
}

/* ==========================================================================
   TAB NAVIGATION STYLING
   ========================================================================== */

.exa-chr-view .nav-pills .nav-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--exa-chr-border);
    color: var(--exa-chr-text-muted);
    border-radius: var(--exa-chr-radius-sm);
    padding: 0.5rem 1.25rem;
    margin: 0 0.25rem;
    transition: all var(--exa-chr-transition-fast);
    font-family: var(--exa-chr-font-body);
    font-weight: 500;
}

.exa-chr-view .nav-pills .nav-link:hover {
    background: rgba(196, 149, 106, 0.1);
    border-color: var(--exa-chr-gold);
    color: var(--exa-chr-gold);
}

.exa-chr-view .nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--exa-chr-gold) 0%, var(--exa-chr-amber) 100%);
    border-color: var(--exa-chr-gold);
    color: var(--exa-chr-text-dark);
    box-shadow: var(--exa-chr-shadow-gold);
}

.exa-chr-view .nav-pills .nav-link i {
    font-size: 0.9rem;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .exa-chr-components-controls,
    .exa-chr-table-legend {
        display: none;
    }
    
    .exa-chr-component-card,
    .exa-chr-table-container {
        box-shadow: none;
        border: 1px solid #ddd;
        background: #ffffff;
        color: #000000;
    }
    
    .exa-chr-expand-indicator {
        display: none;
    }
    
    .exa-chr-pills-container {
        display: block !important;
        height: auto !important;
    }
    
    .exa-chr-mobile-cards {
        display: none !important;
    }
    
    .exa-chr-table-wrapper {
        display: block !important;
        max-height: none;
        overflow: visible;
    }

    /* Show percentage values inside cells for print/PDF */
    .exa-chr-cell {
        height: auto;
        padding: 0.2rem 0.1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .exa-chr-cell-print-value {
        display: inline;
        font-size: 0.65rem;
        font-weight: 600;
        color: #000;
    }

    /* Flatten the gradient background for print legibility */
    .exa-chr-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
