/* =============================================================================
   MwMergeEditor styles — dark-themed data reconciliation workbench
   Matches the mockup aesthetic with confidence borders, colored rows, and chips.
   ============================================================================= */

.mw-me-root {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* NOTE: Header — entity names, timestamps, composite score, stats */

.mw-me-header {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mw-me-header-entities {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mw-me-header-entity {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.mw-me-header-role {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.35);
}

.mw-me-header-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.mw-me-header-date {
    font-size: 11px;
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.3);
}

.mw-me-header-vs {
    color: rgba(255, 255, 255, 0.2);
    font-size: 16px;
}

.mw-me-header-score {
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 100px;
    margin-left: auto;
}

.mw-me-header-score.mw-me-sim-high { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.mw-me-header-score.mw-me-sim-med { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.mw-me-header-score.mw-me-sim-low { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.mw-me-header-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mw-me-stat {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 100px;
}

.mw-me-stat-identical { color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.04); }
.mw-me-stat-auto { color: #60a5fa; background: rgba(96, 165, 250, 0.1); }
.mw-me-stat-union { color: #a78bfa; background: rgba(167, 139, 250, 0.1); }
.mw-me-stat-conflict { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }

/* NOTE: Toolbar */

.mw-me-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    gap: 16px;
    flex-wrap: wrap;
}

.mw-me-toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.mw-me-slider-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.mw-me-slider-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.mw-me-slider-value {
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--mud-palette-primary);
    min-width: 36px;
}

/* NOTE: Table */

.mw-me-table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
}

.mw-me-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.4;
}

.mw-me-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mw-me-col-symbol { width: 32px; text-align: center; }
.mw-me-col-property { min-width: 140px; }
.mw-me-col-sim { width: 90px; text-align: right; }
.mw-me-col-toggle { width: 44px; text-align: center; }
.mw-me-col-action { width: 140px; text-align: right; }
.mw-me-col-result { text-align: center; min-width: 160px; }

.mw-me-table tbody tr {
    transition: filter 0.15s, opacity 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mw-me-table tbody tr:hover {
    filter: brightness(1.25);
}

.mw-me-table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
}

/* NOTE: Confidence left border */

.mw-me-conf-high > td:first-child { box-shadow: inset 3px 0 0 #4ade80; }
.mw-me-conf-med > td:first-child { box-shadow: inset 3px 0 0 #fbbf24; }
.mw-me-conf-low > td:first-child { box-shadow: inset 3px 0 0 #f87171; }

/* NOTE: Row backgrounds — subtle, semi-transparent */

.mw-me-row-identical {
    opacity: 0.45;
}

.mw-me-row-identical:hover {
    opacity: 0.7;
}

.mw-me-row-automerge {
    background: rgba(96, 165, 250, 0.08);
}

.mw-me-row-union {
    background: rgba(167, 139, 250, 0.1);
}

.mw-me-row-conflict {
    background: rgba(251, 191, 36, 0.08);
}

.mw-me-row-flagged {
    background: rgba(248, 113, 113, 0.06) !important;
}

/* NOTE: Symbol column */

.mw-me-cell-symbol {
    text-align: center;
    font-size: 14px;
    width: 32px;
    opacity: 0.7;
}

.mw-me-row-automerge .mw-me-cell-symbol { color: #60a5fa; }
.mw-me-row-union .mw-me-cell-symbol { color: #a78bfa; }
.mw-me-row-conflict .mw-me-cell-symbol { color: #fbbf24; }
.mw-me-row-identical .mw-me-cell-symbol { color: rgba(255, 255, 255, 0.3); }

.mw-me-cell-symbol-inline {
    display: inline;
    margin-right: 6px;
    opacity: 0.6;
}

/* NOTE: Property name */

.mw-me-cell-property {
    font-weight: 500;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
}

.mw-me-row-automerge .mw-me-cell-property,
.mw-me-row-union .mw-me-cell-property,
.mw-me-row-conflict .mw-me-cell-property {
    color: #fff;
}

/* NOTE: Similarity column */

.mw-me-cell-sim {
    text-align: right;
    white-space: nowrap;
}

.mw-me-sim-score {
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
}

.mw-me-sim-high { color: #4ade80; }
.mw-me-sim-med { color: #fbbf24; }
.mw-me-sim-low { color: #f87171; }

.mw-me-sim-algo {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    margin-left: 4px;
}

/* NOTE: Value cells */

.mw-me-cell-value {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.45;
    color: rgba(255, 255, 255, 0.8);
    transition: opacity 0.15s;
}

.mw-me-cell-value.mw-me-chosen {
    opacity: 1;
    font-weight: 600;
    color: #fff;
}

.mw-me-clickable {
    cursor: pointer;
}

.mw-me-clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mw-me-resolved {
    color: #2dd4bf;
}

/* NOTE: Toggle button */

.mw-me-cell-toggle {
    text-align: center;
    width: 44px;
}

.mw-me-toggle-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 3px 8px;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
}

.mw-me-toggle-btn:hover {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
    background: rgba(129, 140, 248, 0.1);
}

/* NOTE: Action chips */

.mw-me-cell-action {
    text-align: right;
}

.mw-me-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: help;
}

.mw-me-action-identical {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
}

.mw-me-action-automerge {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.mw-me-action-union {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.mw-me-action-conflict {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.mw-me-action-keep {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.mw-me-action-donor {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.mw-me-action-custom {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
}

.mw-me-info-icon {
    font-size: 10px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.mw-me-action-chip:hover .mw-me-info-icon {
    opacity: 1;
}

/* NOTE: 3-pane result column */

.mw-me-cell-result {
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.mw-me-result-value {
    cursor: pointer;
    font-weight: 500;
}

.mw-me-result-value:hover {
    text-decoration: underline;
}

.mw-me-result-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 2px;
}

/* NOTE: Footer */

.mw-me-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.mw-me-ref-count {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.mw-me-ref-count strong {
    color: rgba(255, 255, 255, 0.6);
}
