/**
 * mutation-efficacy.css
 * Estilos especificos de la pagina de Eficacia por Mutacion.
 */

/* ===== Variables ===== */
    :root {
        --amber: #f59e0b;
        --amber-light: #fbbf24;
        --bg-amber-soft: #fffbeb;
        --bg-body: #f8fafc;
        --bg-card: #ffffff;
        --bg-green-soft: #f0fdf4;
        --bg-pink-soft: #fdf2f8;
        --bg-subtle: #f1f5f9;
        --bg-teal-soft: #f0fdfa;
        --bg-violet-soft: #f5f3ff;
        --blue: #3b82f6;
        --border-color: #e2e8f0;
        --pink: #ec4899;
        --primary: #3b82f6;
        --primary-dark: #1d4ed8;
        --red: #ef4444;
        --teal: #0d9488;
        --teal-dark: #065f46;
        --teal-light: #14b8a6;
        /* --text-primary y --text-secondary se heredan del token global
           en theme-variables.css (contraste endurecido, casi negro).
           No redefinir aquí. */
        --violet: #8b5cf6;
        --violet-light: #a78bfa;
    }

/* ===== Molecular Profile Banner ===== */
.profile-banner {
    background: linear-gradient(135deg, #0f172a 0%, var(--text-primary) 50%, #334155 100%);
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.profile-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 90% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 10% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.profile-banner .profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.profile-banner .profile-title {
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-banner .profile-title .dna-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.profile-banner .mutation-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.profile-banner .mutation-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border: 2px solid transparent;
}

.mutation-chip-active {
    background: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.4);
}

.mutation-chip-active:hover {
    background: rgba(139, 92, 246, 0.4);
    color: white;
    border-color: var(--violet);
    transform: translateY(-1px);
}

.mutation-chip-active.selected {
    background: var(--violet);
    color: white;
    border-color: var(--violet-light);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.profile-banner .btn-filter-profile {
    background: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 20px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.profile-banner .btn-filter-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.profile-banner .btn-filter-profile.active {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

/* Manual profile input */
.manual-profile-input {
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.manual-profile-input:focus-within {
    border-color: var(--violet-light);
}

.manual-profile-input .input-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.manual-profile-input .input-header i {
    color: var(--violet);
}

/* Highlighted rows in table */
.efficacy-row-match {
    background: rgba(139, 92, 246, 0.06) !important;
    border-left: 4px solid var(--violet) !important;
}

.efficacy-row-match td:first-child {
    position: relative;
}

.relevance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
    color: white;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===== Treatment Comparator ===== */
.comparator-section {
    background: white;
    border-radius: 20px;
    padding: 28px;
    border: 2px solid var(--border-color);
    margin-top: 24px;
}

.comparator-section .section-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.comparator-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin: 16px 0;
}

.comparator-controls .control-group {
    flex: 1;
    min-width: 180px;
}

.comparator-controls label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.compare-chart-area {
    min-height: 320px;
    position: relative;
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    font-size: 0.88rem;
}

.compare-table thead th {
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 50%, var(--blue) 100%);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    text-align: center;
    border: none;
}

.compare-table thead th:first-child {
    border-radius: 12px 0 0 0;
    text-align: left;
}

.compare-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.compare-table tbody td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid var(--bg-subtle);
}

.compare-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
}

.compare-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.04);
}

.compare-best {
    color: var(--teal);
    font-weight: 800;
}

.compare-empty {
    color: #cbd5e1;
    font-style: italic;
}

.compare-badge-winner {
    display: inline-block;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

/* ===== Efficacy Heatmap ===== */
.heatmap-section {
    background: white;
    border-radius: 20px;
    padding: 28px;
    border: 2px solid var(--border-color);
    margin-top: 24px;
    overflow-x: auto;
}

.heatmap-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.heatmap-table {
    border-collapse: separate;
    border-spacing: 3px;
    width: auto;
    min-width: 100%;
}

.heatmap-table th {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    white-space: nowrap;
    background: var(--bg-body);
    border-radius: 6px;
    position: sticky;
    top: 0;
    z-index: 3;
}

.heatmap-table th .hm-th-text {
    display: inline-block;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.heatmap-table th.gene-header {
    text-align: left;
    min-width: 100px;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 4;
    background: white;
}

.heatmap-table td.gene-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    padding: 8px 12px;
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 1;
    background: white;
}

.heatmap-cell {
    width: 60px;
    height: 44px;
    text-align: center;
    vertical-align: middle;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: default;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.heatmap-cell.no-data {
    background: var(--bg-body);
    color: #cbd5e1;
    font-size: 0.65rem;
    font-weight: 400;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.heatmap-legend-bar {
    height: 12px;
    width: 200px;
    border-radius: 6px;
    background: linear-gradient(to right, var(--bg-amber-soft), var(--amber-light), var(--amber), var(--red), #991b1b);
}

.heatmap-mobile-msg {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.heatmap-mobile-msg i { font-size: 2rem; color: var(--text-secondary); display: block; margin-bottom: 10px; }

/* ===== Network Graph ===== */
.network-section {
    background: white;
    border-radius: 20px;
    padding: 28px;
    border: 2px solid var(--border-color);
    margin-top: 24px;
}

.network-container {
    position: relative;
    height: 450px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fafbfc;
    margin-top: 16px;
}

.network-container svg {
    width: 100%;
    height: 100%;
}

.network-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.network-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.network-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.network-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.92);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 10;
    max-width: 260px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
}

/* ===== Hero Section ===== */
.efficacy-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 50px 0;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.efficacy-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.efficacy-hero h1 {
    color: white;
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.efficacy-hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

/* ===== Stats Cards ===== */
.stat-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--violet), var(--pink));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
    border-color: var(--violet);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal) 0%, var(--violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    line-height: 1.2;
}

#bestTreatment {
    font-size: 1.1rem;
    word-break: break-word;
    line-height: 1.3;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== Filters Section ===== */
.filters-section {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.filters-section h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 25px;
}

.filters-section h4 i {
    color: var(--violet);
}

.filters-section .form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filters-section .form-select,
.filters-section .form-control {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    width: 100%;
}

.filters-section .form-select:focus,
.filters-section .form-control:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ===== Select2 Basic Fixes ===== */
.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    min-height: 42px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.select2-dropdown {
    border: 2px solid var(--violet);
    border-radius: 10px;
    margin-top: 4px;
}

.select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, var(--violet), var(--violet-light)) !important;
    color: #ffffff !important;
}

.filters-section .btn-primary {
    background: #0d6efd;
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s;
}

.filters-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.35);
}

.filters-section .btn-secondary {
    border-radius: 12px;
    padding: 12px 25px;
    font-weight: 600;
}

.filters-section .btn-success {
    background: #056401;
    border: none;
    border-radius: 12px;
    padding: 12px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.filters-section .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.35);
}

/* ===== Chart Container ===== */
.chart-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.chart-container:hover {
    border-color: var(--violet);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
}

.chart-header {
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--teal), var(--violet), var(--pink)) 1;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.chart-header h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
}

.chart-header h4 i {
    color: var(--violet);
    margin-right: 8px;
}

.chart-header p {
    color: var(--text-secondary);
    margin: 8px 0 0 0;
    font-size: 0.95rem;
}

/* ===== Efficacy Card ===== */
.efficacy-card {
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    background: var(--bg-card);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.efficacy-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--teal), var(--violet), var(--pink));
    transform: scaleY(0);
    transition: transform 0.3s;
    transform-origin: top;
}

.efficacy-card:hover {
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
    transform: translateY(-4px);
    border-color: var(--violet);
}

.efficacy-card:hover::before {
    transform: scaleY(1);
}

/* ===== Mutation Badge ===== */
.mutation-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--violet), var(--violet-light));
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 5px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ===== Evidence Levels ===== */
.evidence-level {
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 600;
    margin-left: 10px;
}

.level-1 { 
    background: linear-gradient(135deg, var(--bg-green-soft), #a7f3d0); 
    color: var(--teal-dark); 
}
.level-2a { 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); 
    color: #1e40af; 
}
.level-2b { 
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe); 
    color: #3730a3; 
}
.level-3a { 
    background: linear-gradient(135deg, var(--bg-amber-soft), #fde68a); 
    color: #92400e; 
}
.level-3b { 
    background: linear-gradient(135deg, var(--bg-pink-soft), #fbcfe8); 
    color: #9d174d; 
}
.level-4 { 
    background: linear-gradient(135deg, var(--bg-subtle), var(--border-color)); 
    color: var(--text-primary); 
}

/* ===== Response Rate ===== */
.response-rate {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal) 0%, var(--violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Survival Metric ===== */
.survival-metric {
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    color: white;
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    margin: 10px 0;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
    transition: all 0.3s;
}

.survival-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.4);
}

.survival-metric h6 {
    margin: 0;
    font-weight: 600;
    opacity: 0.9;
}

.survival-metric .value {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 8px;
}

/* ===== Comparison Table ===== */
.comparison-table {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.comparison-table thead {
    background: linear-gradient(135deg, var(--teal) 0%, var(--violet) 100%);
    color: white;
}

.comparison-table thead th {
    border: none;
    padding: 16px;
    font-weight: 700;
}

.comparison-table tbody tr {
    transition: all 0.2s;
}

.comparison-table tbody tr:hover {
    background: linear-gradient(135deg, var(--bg-teal-soft), var(--bg-violet-soft));
}

/* ===== Prognosis Badges ===== */
.prognosis-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.prognosis-favorable, .prognosis-good { 
    background: linear-gradient(135deg, var(--bg-green-soft), #a7f3d0); 
    color: var(--teal-dark); 
}
.prognosis-intermediate { 
    background: linear-gradient(135deg, var(--bg-amber-soft), #fde68a); 
    color: #92400e; 
}
.prognosis-poor { 
    background: linear-gradient(135deg, var(--bg-pink-soft), #fbcfe8); 
    color: #9d174d; 
}
.prognosis-unknown { 
    background: linear-gradient(135deg, var(--bg-subtle), var(--border-color)); 
    color: var(--text-primary); 
}

/* ===== Combination Info ===== */
.combination-info {
    background: linear-gradient(135deg, var(--bg-teal-soft), var(--bg-violet-soft));
    border-left: 4px solid var(--violet);
    padding: 20px;
    border-radius: 12px;
    margin: 15px 0;
    transition: all 0.3s;
}

.combination-info:hover {
    border-left-color: var(--teal);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.1);
}

/* ===== Combinations Footer ===== */
.combinations-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.combinations-footer p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.combinations-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s;
}

.combinations-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.35);
}

/* ===== Loading & No Data ===== */
.loading-spinner {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

.loading-spinner .spinner-border {
    color: var(--violet) !important;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    background: linear-gradient(135deg, var(--bg-body), var(--bg-subtle));
    border-radius: 14px;
    border: 2px dashed var(--border-color);
}

/* ===== Study Reference ===== */
.study-reference {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.study-link {
    color: var(--violet);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.study-link:hover {
    color: var(--teal);
}

/* ===== Modal Styling ===== */
.modal-content {
    border-radius: 20px;
    border: 2px solid var(--border-color);
}

.modal-header {
    border-bottom: 2px solid var(--border-color);
    padding: 20px 25px;
}

.modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 2px solid var(--border-color);
    padding: 15px 25px;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--violet), var(--violet-light));
    border: none;
    border-radius: 10px;
}

/* ===== Responsive ===== */
/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Hero */
    .efficacy-hero { padding: 30px 0; }
    .efficacy-hero h1 { font-size: 1.4rem; }
    .efficacy-hero p { font-size: 0.82rem; }
    
    /* Profile banner */
    .profile-banner { padding: 14px; }
    .profile-banner .profile-header { flex-direction: column; gap: 10px; }
    .profile-banner .profile-title { font-size: 0.88rem; }
    .profile-banner .mutation-chips { gap: 5px; }
    .profile-banner .mutation-chip { font-size: 0.72rem; padding: 5px 10px; }
    .profile-banner .btn-filter-profile { font-size: 0.78rem; padding: 6px 14px; width: 100%; }
    
    /* Manual profile */
    .manual-profile-section { padding: 14px; }
    .manual-profile-section .select2-container { font-size: 0.82rem; }
    
    /* Stats */
    #summaryStats .col-md-3 { flex: 0 0 50%; max-width: 50%; }
    .stat-card { padding: 12px 10px; }
    .stat-card .stat-value, .stat-value { font-size: 1.5rem !important; }
    .stat-card .stat-label { font-size: 0.7rem; }
    
    /* Filters */
    .filters-section { padding: 14px; }
    .filters-section h4 { font-size: 1rem; }
    .filters-section .row .col-md-3,
    .filters-section .row .col-md-2 { flex: 0 0 50%; max-width: 50%; }
    .filters-section .form-select,
    .filters-section .form-control { font-size: 0.82rem; padding: 6px 10px; }
    .filters-section .form-label { font-size: 0.74rem; }
    .filters-section .btn { font-size: 0.82rem; padding: 6px 12px; }
    
    /* Chart containers */
    .chart-container { padding: 14px; margin-bottom: 12px; }
    .chart-container .chart-header h4 { font-size: 1rem; }
    .chart-container .chart-header p { font-size: 0.78rem; }
    
    /* Main charts - full width on mobile */
    .col-lg-8, .col-lg-4, .col-lg-6 { flex: 0 0 100%; max-width: 100%; }
    
    /* Chart.js canvases - constrain height */
    #responseRateChart canvas,
    #survivalChart canvas,
    #evidenceChart canvas,
    #treatmentLineChart canvas {
        max-height: 280px !important;
    }
    
    /* Comparator */
    .comparator-section { padding: 14px; }
    .comparator-section .section-title { font-size: 1rem; }
    .comparator-controls {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .comparator-controls .control-group {
        min-width: 100% !important;
        flex: 1 !important;
    }
    .comparator-controls > div:last-child {
        width: 100%;
    }
    .comparator-controls > div:last-child .btn {
        width: 100%;
    }
    .compare-chart-area canvas { max-height: 260px !important; }
    
    /* Comparator table mobile card layout */
    #compareTableContainer table { font-size: 0.78rem; }
    #compareTableContainer table th,
    #compareTableContainer table td { padding: 6px 8px; }
    
    /* Heatmap - hide on mobile, show message */
    .heatmap-section .heatmap-container { display: none; }
    .heatmap-section .heatmap-legend { display: none !important; }
    .heatmap-mobile-msg { display: block !important; }
    
    /* Network graph */
    .network-section { padding: 14px; }
    .network-section h4 { font-size: 1rem; }
    .network-container { height: 300px !important; }
    .network-legend {
        flex-wrap: wrap !important;
        gap: 6px !important;
        font-size: 0.72rem;
    }
    .network-legend .ms-3 { margin-left: 0 !important; flex-basis: 100%; }
    
    /* Data table - card layout */
    .table-responsive {
        overflow: visible !important;
        overflow-x: visible !important;
    }
    
    .comparison-table thead,
    .comparison-table thead tr,
    .comparison-table thead th {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important; width: 0 !important;
        padding: 0 !important; margin: 0 !important;
        border: none !important; font-size: 0 !important;
        line-height: 0 !important; position: absolute !important;
        left: -9999px !important;
    }
    
    .comparison-table {
        display: block !important; width: 100% !important;
        border: none !important; background: transparent !important;
        box-shadow: none !important; overflow: visible !important;
    }
    .comparison-table tbody { display: block !important; width: 100% !important; }
    .comparison-table tbody tr {
        display: block !important; width: 100% !important;
        background: #fff !important; border-radius: 14px !important;
        padding: 14px !important; margin-bottom: 12px !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
        border-left: 4px solid var(--violet) !important;
        box-sizing: border-box !important;
    }
    .comparison-table tbody td {
        display: flex !important; width: 100% !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important; border: none !important;
        border-bottom: 1px solid var(--bg-subtle) !important;
        box-sizing: border-box !important;
        font-size: 0.84rem;
    }
    .comparison-table tbody td:last-child { border-bottom: none !important; }
    .comparison-table tbody td::before {
        content: attr(data-label);
        font-weight: 600; color: #6b7280;
        font-size: 0.78rem; flex-shrink: 0;
        min-width: 100px; max-width: 100px;
    }
    .comparison-table tbody td > *,
    .comparison-table tbody td { text-align: right; }
    .comparison-table tbody td .mutation-badge,
    .comparison-table tbody td .evidence-badge { margin: 0 !important; }
    
    /* Combinations section */
    .chart-container .combination-card { padding: 12px; }
    
    /* Pagination */
    .pagination-container { flex-wrap: wrap; gap: 4px; }
    .pagination-container select { width: 60px; font-size: 0.78rem; }
    
    /* General spacing */
    .container { padding-left: 10px; padding-right: 10px; }
    .row.mt-4 { margin-top: 16px !important; }
    .mb-4 { margin-bottom: 12px !important; }
    
    /* Select2 touch-friendly */
    .select2-container--bootstrap-5 .select2-selection { min-height: 38px; }
    .select2-results__option { padding: 8px 12px !important; }
}

/* Small phones */
@media (max-width: 480px) {
    .efficacy-hero h1 { font-size: 1.2rem; }
    #summaryStats .col-md-3 { flex: 0 0 50%; max-width: 50%; }
    .stat-card .stat-value, .stat-value { font-size: 1.3rem !important; }
    .filters-section .row .col-md-3,
    .filters-section .row .col-md-2 { flex: 0 0 100%; max-width: 100%; }
    .heatmap-container { max-height: 260px; }
    .network-container { height: 250px !important; }
    .chart-container { padding: 10px; }
    .comparator-section { padding: 10px; }
    .profile-banner .mutation-chip { font-size: 0.68rem; padding: 4px 8px; }
}


/* ============================================================
 * G2 sub-lote — Clases utility para sustituir style="..." inline
 * ============================================================ */

/* Botones con border-radius custom (varios sizes) */
.meff-btn-radius-12  { border-radius: 12px; }
.meff-btn-radius-10  { border-radius: 10px; }

/* Botón "Run comparison" — radius 10 + padding personalizado */
.meff-btn-compare {
    border-radius: 10px;
    padding: 6px 20px;
}

/* Select2 multi-gene — width 100% (atributo style="width:100%" requerido por Select2 init) */
/* NOTA: Select2 obliga al inline style="width:100%" para inicializar bien.
   Lo dejamos inline en HTML — no migramos a clase. */

/* Texto pequeño "registra tu perfil" bajo el formulario manual */
.meff-text-help { font-size: 0.82rem; }

/* Link "registra" en color violet */
.meff-link-violet { color: var(--violet); }

/* Iconos grandes coloreados de section titles */
.meff-i-violet { color: var(--violet); }
.meff-i-pink   { color: var(--pink); }
.meff-i-teal   { color: var(--teal); }

/* Section titles bold de heatmap/network */
.meff-section-title-bold {
    font-weight: 800;
    font-size: 1.2rem;
}

/* Description text bajo titles */
.meff-section-desc { font-size: 0.88rem; }

/* Compare results — control flex 2 */
.meff-control-flex-2 { flex: 2; }

/* Compare results — display:none gestionado por JS via .style.display
   (NO migrar a .d-none — contrato JS) */

/* Heatmap legend — display:none gestionado por JS (NO migrar) */

/* Empty state icons del compare */
.meff-empty-icon {
    font-size: 2rem;
    opacity: 0.3;
}

/* Network legend — labels en bold */
.meff-legend-label { font-weight: 600; }

/* Network legend dots — colores específicos según estado */
.meff-dot-green { background: #10b981; }
.meff-dot-amber { background: #f59e0b; }
.meff-dot-red   { background: #ef4444; }
.meff-dot-grey  { background: #94a3b8; }

/* Tamaños extra para los dots de "menos común" / "más común" */
.meff-dot-sm  { width: 8px;  height: 8px; }
.meff-dot-lg  { width: 18px; height: 18px; }

/* Botón "Ver combinaciones" — outline violet */
.meff-btn-outline-violet {
    border-radius: 10px;
    border-color: var(--violet);
    color: var(--violet);
}
