/* ── Diff Review Styles ─────────────────────────────────
 * Covers: inline diff view, navigator change indicators,
 * and changes summary card in chat panel.
 */

/* ── Navigator Change Indicators ─────────────────────── */

.tree-item-changed {
  background: hsla(45, 80%, 50%, 0.06);
}

.tree-change-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.tree-change-modified {
  background: hsla(45, 85%, 55%, 0.2);
  color: hsl(45, 90%, 65%);
}

.tree-change-new {
  background: hsla(140, 70%, 45%, 0.2);
  color: hsl(140, 70%, 60%);
}

/* ── Inline Diff View (Editor) ───────────────────────── */

.inline-diff-container {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace);
  font-size: 13px;
  line-height: 1.6;
  background: var(--color-bg-primary);
  padding: 0;
}

.inline-diff-line {
  display: flex;
  align-items: stretch;
  min-height: 22px;
  border-bottom: 1px solid transparent;
}

.inline-diff-gutter {
  width: 28px;
  min-width: 28px;
  text-align: center;
  user-select: none;
  color: var(--color-text-muted);
  font-weight: 600;
  flex-shrink: 0;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-diff-text {
  flex: 1;
  padding: 0 var(--space-3);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Added lines — green */
.inline-diff-added {
  background: hsla(140, 70%, 35%, 0.15);
}
.inline-diff-added .inline-diff-gutter {
  background: hsla(140, 70%, 35%, 0.25);
  color: hsl(140, 70%, 65%);
}
.inline-diff-added .inline-diff-text {
  color: hsl(140, 60%, 80%);
}

/* Deleted lines — red */
.inline-diff-deleted {
  background: hsla(0, 70%, 40%, 0.15);
}
.inline-diff-deleted .inline-diff-gutter {
  background: hsla(0, 70%, 40%, 0.25);
  color: hsl(0, 70%, 65%);
}
.inline-diff-deleted .inline-diff-text {
  color: hsl(0, 60%, 80%);
  text-decoration: line-through;
  text-decoration-color: hsla(0, 60%, 60%, 0.4);
  text-decoration-thickness: 1px;
}

/* Context lines */
.inline-diff-context {
  background: transparent;
}
.inline-diff-context .inline-diff-gutter {
  background: transparent;
}
.inline-diff-context .inline-diff-text {
  color: var(--color-text-secondary);
}

/* ── Changes Summary Card (Chat Panel) ───────────────── */

.changes-summary-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-3) 0;
  max-width: 100%;
}

.changes-summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.changes-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--color-accent-text);
}

.changes-summary-icon svg {
  width: 16px;
  height: 16px;
}

.changes-summary-title {
  font-weight: var(--font-semi);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

.changes-summary-count {
  font-size: 10px !important;
}

.changes-summary-totals {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  font-family: var(--font-mono, monospace);
}

.changes-stat-added {
  color: hsl(140, 70%, 60%);
}

.changes-stat-deleted {
  color: hsl(0, 70%, 65%);
}

/* File list */
.changes-file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-3);
}

.changes-file-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  transition: background var(--transition-fast);
  font-size: var(--text-sm);
}

.changes-file-row:hover {
  background: var(--color-bg-hover);
}

.changes-row-accepted {
  opacity: 0.7;
  background: hsla(140, 50%, 40%, 0.08) !important;
}

.changes-row-rejected {
  opacity: 0.5;
  background: hsla(0, 50%, 40%, 0.08) !important;
  text-decoration: line-through;
  text-decoration-color: hsla(0, 50%, 50%, 0.3);
}

.changes-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
}

.changes-file-icon svg {
  width: 14px;
  height: 14px;
}

.changes-file-path {
  flex: 1;
  color: var(--color-accent);
  cursor: pointer;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changes-file-path:hover {
  text-decoration: underline;
}

.changes-file-stats {
  display: flex;
  gap: var(--space-1);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: var(--font-semi);
  flex-shrink: 0;
}

.changes-file-status {
  flex-shrink: 0;
}

.changes-file-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* Accept All / Reject All buttons */
.changes-summary-actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.changes-summary-actions .btn {
  flex: 1;
}

/* Button small variants for inline actions */
.btn-xs {
  font-size: 11px;
  padding: 2px 6px;
  height: 22px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ── Ingestion Status Badges (Navigator) ─────────────── */

.tree-ingestion-badge {
  margin-left: auto;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.7;
  cursor: help;
}

.tree-ingestion-badge.ingested {
  opacity: 0.8;
}

.tree-ingestion-badge.not-ingested {
  opacity: 0.3;
  font-size: 9px;
}

.tree-ingestion-badge.indexed {
  opacity: 0.6;
}

.tree-ingestion-badge.unsupported {
  opacity: 0.5;
  font-size: 9px;
  cursor: help;
}
