/* eidolon-backfill.css — styles for the "Rebuild knowledge graph" surface.
 *
 * Inherits Eidolon's CSS custom properties (--surface, --text, --amber,
 * --border, --muted, --danger) — same palette as eidolon-voice / portrait
 * so the new dialog feels native. Everything is scoped under the
 * `.eidolon-backfill-*` namespace and `#backfill-overlay`.
 */

/* Sidebar button — match .btn-portrait styling but with a subtle
 * amber accent on hover to mark it as a write action. */
.eidolon-backfill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eidolon-backfill-btn:hover {
  border-color: var(--amber, #d3a04b);
  color: var(--amber, #d3a04b);
}

/* ── Modal overlay ─────────────────────────────────────────────── */
.eidolon-backfill-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
}
.eidolon-backfill-overlay.open {
  display: flex;
}

.eidolon-backfill-modal {
  background: var(--surface, #1a1d24);
  border: 1px solid var(--border-hi, #2a2f3a);
  border-radius: 10px;
  width: 560px;
  max-width: 94vw;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  color: var(--text, #d6d9e0);
  font-family: var(--font-ui, "Inter", system-ui, sans-serif);
}

/* ── Header ─────────────────────────────────────────────────────── */
.eidolon-backfill-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #232730);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.eidolon-backfill-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi, #f0f2f6);
}
.eidolon-backfill-close {
  background: transparent;
  border: 0;
  color: var(--muted, #7a7f8c);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.eidolon-backfill-close:hover {
  color: var(--text-hi, #f0f2f6);
}

/* ── Body ──────────────────────────────────────────────────────── */
.eidolon-backfill-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.55;
}
.eidolon-backfill-explainer {
  margin: 0 0 12px 0;
  color: var(--text, #d6d9e0);
}
.eidolon-backfill-eta {
  margin: 0 0 16px 0;
  padding: 10px 12px;
  background: rgba(211, 160, 75, 0.08);
  border-left: 3px solid var(--amber, #d3a04b);
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted, #7a7f8c);
}
.eidolon-backfill-eta strong {
  color: var(--amber, #d3a04b);
}

/* ── Progress bar + counters ──────────────────────────────────── */
.eidolon-backfill-progress {
  margin-top: 8px;
}
.eidolon-backfill-progress.hidden {
  display: none;
}
.eidolon-backfill-bar {
  height: 8px;
  background: var(--border, #232730);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.eidolon-backfill-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(
    90deg,
    var(--amber, #d3a04b) 0%,
    var(--amber-hi, #f0c074) 100%
  );
  transition: width 240ms ease-out;
}
.eidolon-backfill-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  color: var(--muted, #7a7f8c);
}
.eidolon-backfill-counters strong {
  color: var(--text-hi, #f0f2f6);
}
.bf-errors-wrap.hidden {
  display: none;
}

/* ── Final summary block ──────────────────────────────────────── */
.eidolon-backfill-summary {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, #232730);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.7;
}
.eidolon-backfill-summary.hidden {
  display: none;
}
.eidolon-backfill-summary .bf-ok {
  color: var(--success, #6fcf97);
}
.eidolon-backfill-summary .bf-fail {
  color: var(--danger, #e57373);
}
.eidolon-backfill-summary .bf-warn {
  color: var(--amber, #d3a04b);
}

/* ── Footer ────────────────────────────────────────────────────── */
.eidolon-backfill-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border, #232730);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.eidolon-backfill-dry {
  font-size: 11px;
  color: var(--muted, #7a7f8c);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.eidolon-backfill-actions {
  display: flex;
  gap: 8px;
}
.eidolon-backfill-cancel,
.eidolon-backfill-confirm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 5px;
  border: 1px solid var(--border-hi, #2a2f3a);
  background: var(--surface, #1a1d24);
  color: var(--text, #d6d9e0);
  cursor: pointer;
  font-family: inherit;
}
.eidolon-backfill-cancel:hover {
  border-color: var(--muted, #7a7f8c);
}
.eidolon-backfill-confirm {
  background: var(--amber, #d3a04b);
  border-color: var(--amber, #d3a04b);
  color: #0d1018;
  font-weight: 600;
}
.eidolon-backfill-confirm:hover:not(:disabled) {
  background: var(--amber-hi, #f0c074);
  border-color: var(--amber-hi, #f0c074);
}
.eidolon-backfill-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
