@use 'variables' as *;

// ─── Scores section container ─────────────────────────────────────────────────
.scores-section {
    @include card;
    border-top: none;
    padding: 28px 32px;
}

.scores-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.scores-title {
    @include section-label(0.08em);
}

// ─── Composite badge ──────────────────────────────────────────────────────────
.composite-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composite-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: $gray-500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.composite-value {
    font-size: 1.4rem;
    font-weight: 800;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: $white;
}

// ─── Score bars ───────────────────────────────────────────────────────────────
.score-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
}

.score-row-label {
    width: 90px;
    font-size: 0.82rem;
    font-weight: 600;
    color: $gray-700;
    flex-shrink: 0;
}

.score-bar-wrap {
    flex: 1;
    height: 28px;
    background: $gray-100;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    border-radius: 14px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 40px;
    cursor: pointer;
}

.score-bar-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: $white;

    &.dark {
        color: $gray-700;
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
    }
}

// ─── Score detail tooltips ────────────────────────────────────────────────────
.score-detail {
    background: $gray-900;
    color: #e5e7eb;
    font-size: 0.78rem;
    line-height: 1.6;
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 6px;
    margin-left: 102px;

    &.open { display: block; }

    strong { color: $white; }
}

// ─── Score hints (detail page) ────────────────────────────────────────────────
.scores-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: $gray-400;
    font-size: 0.8rem;
}

// ─── Score chevron ────────────────────────────────────────────────────────────
.score-chevron {
    font-size: 1.3rem;
    color: $gray-400;
    line-height: 1;
    transition: transform 0.2s, color 0.15s;
    flex-shrink: 0;
    margin-left: 4px;

    &.open {
        transform: rotate(90deg);
        color: $indigo;
    }
}

// ─── Editable score elements ──────────────────────────────────────────────────
[data-score-key][data-ein] {
    cursor: pointer;

    &:hover { opacity: 0.82; }
}

// ─── Responsive ───────────────────────────────────────────────────────────────
@media (max-width: $bp-mobile) {
    .score-row-label {
        width: 70px;
        font-size: 0.75rem;
    }

    .score-detail {
        margin-left: 0;
    }
}
