/**
 * SMART-ATTR (2026-05-02) — Smart Product Attribution styles
 *
 * Loaded on Add Product, Edit Product, and Quick-Add Product modal.
 * All classes prefixed `.mmsa-*` to avoid collisions with the broader theme.
 */

/* ─── "Auto-detect" link next to each field label ───────────────────── */
.mmsa-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 600;
    color: #0F6CBD;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: inherit;
    line-height: 1.4;
    margin-left: 6px;
    vertical-align: middle;
    transition: background .15s, color .15s;
}
.mmsa-link svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mmsa-link:hover {
    background: #eef2ff;
    color: #0a5a9a;
}
.mmsa-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.20);
}
.mmsa-link.is-disabled {
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}
.mmsa-link.is-loading svg {
    animation: mmsa-spin 0.6s linear infinite;
}
@keyframes mmsa-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ─── Green blink animation on auto-filled fields ───────────────────── */
/* Applied to .select2-container (since the underlying <select> is hidden) */
@keyframes mmsa-blink {
    0%   { background-color: transparent; }
    25%  { background-color: #d1fae5; }
    50%  { background-color: transparent; }
    75%  { background-color: #d1fae5; }
    100% { background-color: transparent; }
}
.select2-container.mmsa-blink .select2-selection {
    animation: mmsa-blink 0.8s ease-in-out;
}

/* ─── "Auto-detected" badge below the field ─────────────────────────── */
.mmsa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 7px;
    margin-top: 4px;
    border-radius: 100px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    width: fit-content;
}
.mmsa-badge.is-shown {
    opacity: 1;
    transform: translateY(0);
}
.mmsa-badge svg {
    width: 10px;
    height: 10px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ─── Inline status messages (no-match, up-to-date, type name first) ── */
.mmsa-msg {
    font-size: 10.5px;
    color: #6b7280;
    margin-top: 3px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .2s, transform .2s;
    min-height: 14px;
    line-height: 1.3;
}
.mmsa-msg.is-shown {
    opacity: 1;
    transform: translateY(0);
}
.mmsa-msg.is-warn { color: #d97706; }
.mmsa-msg.is-info { color: #6b7280; }

/* ─── Label-row layout (label + auto-detect link) ───────────────────── */
.mmsa-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}
.mmsa-label-row label {
    margin-bottom: 0 !important;
    flex: 1;
}
