/* frontend/static/css/semantic_review.css
   VERITAS — Semantic Unification Review Centre
   Redesigned v2 — light theme matching site design system
   ============================================================ */

/* ── Page header ─────────────────────────────────────────────────────────── */
.sem-header {
    margin-bottom: 28px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 20px;
}
.sem-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}
.sem-header .subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.sem-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 28px;
}
.sem-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s;
    border-radius: 4px 4px 0 0;
}
.sem-tab:hover { color: #1e293b; }
.sem-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: rgba(37,99,235,0.05);
}

/* ── Tab panels ──────────────────────────────────────────────────────────── */
.sem-panel { display: none; }
.sem-panel.active { display: block; }

/* ── Stat strip ──────────────────────────────────────────────────────────── */
.sem-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.sem-stat {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.sem-stat:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.sem-stat-val {
    font-size: 30px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 6px;
}
.sem-stat-lbl {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
/* Colour variants */
.sem-stat-val.green  { color: #16a34a; }
.sem-stat-val.amber  { color: #d97706; }
.sem-stat-val.red    { color: #dc2626; }
.sem-stat-val.blue   { color: #2563eb; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.sem-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}
.sem-filters input,
.sem-filters select {
    padding: 8px 14px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sem-filters input:focus,
.sem-filters select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.sem-filters input::placeholder { color: #94a3b8; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.sem-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
}
.sem-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.sem-btn:active { transform: translateY(0); }

.sem-btn.primary {
    background: #2563eb;
    color: #fff;
}
.sem-btn.primary:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.sem-btn.success {
    background: #16a34a;
    color: #fff;
}
.sem-btn.success:hover {
    background: #15803d;
    box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.sem-btn.danger {
    background: #dc2626;
    color: #fff;
}
.sem-btn.danger:hover {
    background: #b91c1c;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}
.sem-btn.neutral {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.sem-btn.neutral:hover {
    background: #e2e8f0;
    color: #334155;
}
.sem-btn.amber {
    background: #d97706;
    color: #fff;
}
.sem-btn.amber:hover {
    background: #b45309;
    box-shadow: 0 2px 8px rgba(217,119,6,0.3);
}
.sem-btn.sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ── Data table ──────────────────────────────────────────────────────────── */
.sem-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.sem-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}
.sem-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}
.sem-table td {
    padding: 11px 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    max-width: 300px;
    word-break: break-word;
}
.sem-table tr:hover td { background: #f8fafc; }
.sem-table tr:last-child td { border-bottom: none; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-proposed   { background: #fef3c7; color: #92400e; }
.badge-confirmed  { background: #d1fae5; color: #065f46; }
.badge-rejected   { background: #fee2e2; color: #991b1b; }
.badge-conflict   { background: #fce7f3; color: #9d174d; }
.badge-resolved   { background: #dbeafe; color: #1e40af; }

/* ── Canonical key chips ─────────────────────────────────────────────────── */
.ck-chip {
    display: inline-block;
    padding: 2px 8px;
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
}

/* ── Confidence bar ──────────────────────────────────────────────────────── */
.conf-bar-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.conf-bar      { height: 6px; border-radius: 3px; flex: 1; background: #e2e8f0; }
.conf-fill     { height: 100%; border-radius: 3px; transition: width 0.3s; }
.conf-pct      { font-size: 11px; color: #64748b; white-space: nowrap; }

/* ── Mapping review action column ────────────────────────────────────────── */
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Query builder panel ─────────────────────────────────────────────────── */
.query-builder {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.query-builder h3 {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 18px 0;
}
.query-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.query-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}
.query-field input,
.query-field select {
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.query-field input:focus,
.query-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ── Query result area ───────────────────────────────────────────────────── */
#query-result-area {
    min-height: 180px;
}

/* ── Chart area ──────────────────────────────────────────────────────────── */
.chart-area {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-placeholder {
    color: #94a3b8;
    text-align: center;
}
.chart-placeholder .icon { font-size: 40px; margin-bottom: 8px; }

/* ── Conflict resolution cards ───────────────────────────────────────────── */
.conflict-card {
    background: white;
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.conflict-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.conflict-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}
.conflict-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.conflict-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}
.conflict-sources {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}
.source-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #334155;
}
.source-pill .src-val { font-weight: 700; color: #2563eb; }
.conflict-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.sem-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 15px;
}
.sem-loading-icon {
    font-size: 36px;
    animation: semSpin 1.2s linear infinite;
    display: block;
    margin-bottom: 12px;
}
@keyframes semSpin { to { transform: rotate(360deg); } }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.sem-empty {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
}
.sem-empty .icon { font-size: 40px; margin-bottom: 10px; }

/* ── Toast notifications ─────────────────────────────────────────────────── */
#sem-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.sem-toast-item {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    animation: toastIn 0.3s ease;
    pointer-events: all;
}
.sem-toast-item.success { background: #16a34a; }
.sem-toast-item.error   { background: #dc2626; }
.sem-toast-item.info    { background: #2563eb; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* ── Canonical key multi-select (Query Builder) ──────────────────────────── */
.ck-list {
    max-height: 160px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    background: white;
}
.ck-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    transition: background 0.15s;
}
.ck-list label:hover { background: #f1f5f9; }
.ck-list input[type=checkbox] { accent-color: #2563eb; }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .sem-tabs {
        flex-wrap: wrap;
        gap: 2px;
    }
    .sem-tab {
        padding: 8px 14px;
        font-size: 12px;
    }
    .sem-stats {
        grid-template-columns: 1fr 1fr;
    }
    .query-grid {
        grid-template-columns: 1fr;
    }
}
