/* Inline Diff Approval for Chat interface */
.sage-ai-inline-diff-approval,
.sage-ai-diff-approval-dialog-embedded {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
}

.sage-ai-inline-diff-header,
.sage-ai-diff-approval-header {
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--jp-border-color2);
}

.sage-ai-inline-diff-title,
.sage-ai-diff-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--jp-ui-font-color0);
  display: flex;
  align-items: center;
}

.sage-ai-inline-diff-summary,
.sage-ai-diff-summary {
  font-size: var(--jp-ui-font-size0);
  color: var(--jp-ui-font-color0);
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sage-ai-inline-diff-note {
  font-size: 12px;
  color: var(--jp-ui-font-color2);
  font-style: italic;
  margin-bottom: 12px;
}

.sage-ai-inline-diff-actions {
  display: flex;
  /* TODO: Remove the element from the DOM */
  display: none;
  justify-content: end;
  gap: 8px;
  margin-top: 4px;
}

.sage-ai-inline-diff-actions button {
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.sage-ai-inline-diff-actions button:hover {
  transform: translateY(-1px);
}

.sage-ai-inline-diff-actions button:active {
  transform: translateY(0px);
}

.sage-ai-inline-diff-count,
.sage-ai-diff-count {
  display: inline-block;
  background-color: var(--jp-layout-color3);
  color: var(--jp-ui-font-color1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 6px;
  min-width: 18px;
  text-align: center;
}

.sage-ai-confirm-button {
  padding: 4px 8px;
  background-color: var(--jp-inverse-layout-color0);
  color: var(--jp-ui-inverse-font-color0);
  transition: background-color 0.2s ease;
  border-radius: 8px !important;
}

.sage-ai-confirm-button:hover {
  background-color: var(--jp-inverse-layout-color2);
}

.sage-ai-reject-button {
  padding: 0px 8px;
  font-size: var(--jp-ui-font-size1);
  background-color: transparent;
  color: var(--jp-ui-font-color1);
}

/* Styles for embedded diff list and cells */
.sage-ai-diff-approval-dialog-embedded .sage-ai-diff-list {
  margin: 8px 0;
  gap: 8px;
  display: flex;
  flex-direction: column;
}

.sage-ai-diff-cell-item {
  border-radius: 10px;
  border: 0.5px solid var(--jp-border-color2);
  background-color: transparent;
  display: flex;
  flex-direction: column;
}

.sage-ai-diff-content-collapse-icon {
  display: flex;
  cursor: pointer;
  transition: transform 0.2s;
}

.sage-ai-diff-content-collapse-icon:hover {
  transform: scale(1.1);
}

.sage-ai-diff-cell-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.sage-ai-diff-operation {
  display: flex;
}

.sage-ai-diff-content {
  position: relative;
  max-height: 150px;
  overflow-y: hidden;
  background-color: var(--jp-layout-color2);
  border-radius: 0 0 10px 10px;
  border-top: 0.5px solid var(--jp-border-color2);
}

.sage-ai-diff-content .d2h-file-wrapper {
  border-radius: 0 !important;
}

.sage-ai-diff-content.sage-ai-diff-expanded {
  max-height: none;
  overflow-y: visible;
}

/* Gradient overlay that stays at bottom when scrolling */
.sage-ai-diff-gradient-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top, rgba(25, 25, 25, 1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 0 0 4px 4px;
  z-index: 5;
}

[data-jp-theme-light="true"] .sage-ai-diff-gradient-overlay {
  background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, transparent 100%);
}

.sage-ai-diff-cell-id-label {
  color: #1976d2;
  border-radius: 4px;
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
  flex: 1;
}

.sage-ai-diff-old-content,
.sage-ai-diff-new-content {
  padding: 6px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.sage-ai-diff-old-content {
  border-bottom: 1px dashed var(--jp-border-color2);
  color: var(--jp-content-font-color2);
  text-decoration: line-through;
}

.sage-ai-diff-cell-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 8px;
}

.sage-ai-diff-approval-dialog-embedded .cm-editor {
  border-radius: 0 0 10px 10px !important;
  background: var(--jp-layout-color1) !important;
}

.sage-ai-diff-hover-buttons {
  display: flex;
  align-items: center;
}