@use 'variables' as *;

// ─── Add custom score button ──────────────────────────────────────────────────
.add-custom-score-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    color: $gray-500;
    background: $gray-50;
    border: $border-width dashed $gray-300;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;

    &:hover:not(:disabled) {
        border-color: $red-primary;
        border-style: solid;
        color: $red-primary;
        background: $red-ghost;
    }

    &:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    // Detail-page variant: sits inside .score-bars-actions flex row
    &--detail {
        flex: 1;
        justify-content: center;
        border-radius: 10px;
    }
}

// ─── Detail-page remove button ────────────────────────────────────────────────
.remove-custom-scores-btn--detail {
    flex: 1;
    justify-content: center;
}

// ─── Detail-page button row ───────────────────────────────────────────────────
.score-bars-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

// ─── Custom score modal ───────────────────────────────────────────────────────
.csm-modal { max-width: 400px; }

.csm-hint {
    font-size: 0.84rem;
    color: $gray-500;
    margin-bottom: 20px;
    line-height: 1.5;
}

.csm-field { margin-bottom: 18px; }

.csm-label {
    display: block;
    @include section-label;
    margin-bottom: 7px;
}

.csm-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: $border-width solid $gray-300;
    border-radius: 9px;
    outline: none;
    background: $white;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: $navy;

    &:focus {
        border-color: $red-primary;
        box-shadow: 0 0 0 3px rgb(from var(--red-primary) r g b / 0.1);
    }

    &--error {
        border-color: $red-primary !important;
        box-shadow: 0 0 0 3px rgb(from var(--red-primary) r g b / 0.15) !important;
    }
}

.csm-preview {
    margin-top: 10px;
    padding: 8px 10px;
    background: $gray-50;
    border-radius: 8px;
    border: 1px solid $border-color;
}

.csm-actions { margin-top: 4px; }

.csm-delete-btn {
    background: #fff5f5;
    color: $red-primary;
    border: $border-width solid $red-pale;

    &:hover {
        background: $red-faint;
        border-color: $red-primary;
    }
}

// Weight label row with toggle (inside CSM)
.csm-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;

    .csm-label { margin-bottom: 0; }
}
