/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * Per-sample IBD chromosome browser styles for regional report sample drawers.
 * Rendered as the first element inside the drawer body (panel card).
 */

.ibd-drawer-chromosome-section {
    margin: 0 0 1.5rem 0;
    padding: 1rem 1.25rem 1.1rem;
    border: 1px solid rgba(201, 164, 48, 0.22);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ibd-drawer-chromosome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.ibd-drawer-chromosome-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: inherit;
}

.ibd-drawer-chromosome-title i {
    color: #c9a430;
    font-size: 0.85rem;
}

.ibd-drawer-chromosome-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    opacity: 0.75;
}

.ibd-drawer-chromosome-legend-gradient {
    width: 64px;
    height: 10px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(201, 164, 48, 0.2) 0%, #c9a430 60%, #e6c659 100%);
}

.ibd-drawer-chromosome-summary {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 0 1rem 0;
    opacity: 0.8;
}

.ibd-drawer-chromosome-summary strong {
    color: #e6c659;
    font-weight: 700;
}

.ibd-drawer-chromosome-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
    padding: 0.4rem 0;
}

.ibd-drawer-chromosome-empty {
    font-size: 0.8rem;
    opacity: 0.75;
    margin: 0;
}

.ibd-chromosome-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ibd-chromosome-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ibd-chromosome-label {
    width: 40px;
    flex: 0 0 40px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

.ibd-chromosome-bar {
    position: relative;
    flex: 1;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.ibd-chromosome-segment {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 10px;
    background-color: #c9a430;
    min-width: 3px;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.ibd-chromosome-segment:hover {
    transform: scaleY(1.2);
    background-color: #e6c659;
    z-index: 10;
}

@media (max-width: 768px) {
    .ibd-drawer-chromosome-section {
        padding: 0.85rem 0.9rem 0.95rem;
    }

    .ibd-chromosome-label {
        width: 32px;
        flex: 0 0 32px;
        font-size: 0.7rem;
    }

    .ibd-chromosome-bar {
        height: 20px;
        border-radius: 10px;
    }
}

/* IBD match portrait cards (Shared DNA Segments section) */

.regional-ibd-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.regional-ibd-match-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(201, 164, 48, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.regional-ibd-match-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9a430, transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.regional-ibd-match-card:hover,
.regional-ibd-match-card:focus {
    border-color: rgba(201, 164, 48, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    outline: none;
}

.regional-ibd-match-card:hover::before,
.regional-ibd-match-card:focus::before {
    opacity: 1;
}

.regional-ibd-match-portrait {
    position: relative;
    flex-shrink: 0;
}

.regional-ibd-match-portrait img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(201, 164, 48, 0.35);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.regional-ibd-match-card:hover .regional-ibd-match-portrait img,
.regional-ibd-match-card:focus .regional-ibd-match-portrait img {
    border-color: #c9a430;
    transform: scale(1.05);
}

.regional-ibd-match-cm-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #c9a430;
    color: #1a1208;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.regional-ibd-match-info {
    flex: 1;
    min-width: 0;
}

.regional-ibd-match-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem 0;
    color: inherit;
    line-height: 1.2;
}

.regional-ibd-match-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.regional-ibd-match-segs {
    font-size: 0.75rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .regional-ibd-matches-grid {
        grid-template-columns: 1fr;
    }

    .regional-ibd-match-portrait img {
        width: 64px;
        height: 64px;
    }
}
