/* Diff Approval Dialog */
.sage-ai-diff-approval-dialog {
  position: absolute;  /* Changed from fixed to absolute for notebook context */
  top: 50%;            /* Center positioning in notebook context */
  left: 50%;
  transform: translate(-50%, -50%);  /* Center both horizontally and vertically */
  width: 80%;
  max-width: 800px;
  max-height: 80vh;    /* Allow more space in notebook context */
  background: var(--jp-layout-color1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sage-ai-diff-approval-header {
  padding: 16px;
  border-bottom: 1px solid var(--jp-border-color2);
  background: var(--jp-layout-color2);
}

.sage-ai-diff-approval-header h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--jp-ui-font-color0);
}

.sage-ai-diff-approval-header p {
  margin: 0;
  font-size: 14px;
  color: var(--jp-ui-font-color2);
}

.sage-ai-diff-list {
  padding: 8px;
  overflow-y: auto;
  max-height: calc(80vh - 140px);
}

.sage-ai-diff-cell-item {
  margin-bottom: 12px;
  border: 1px solid var(--jp-border-color2);
  border-radius: 4px;
  overflow: hidden;
}

.sage-ai-diff-cell-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  background: var(--jp-layout-color2);
  border-bottom: 1px solid var(--jp-border-color2);
}

.sage-ai-diff-type {
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.sage-ai-diff-type-add {
  background-color: var(--jp-success-color3);
  color: var(--jp-success-color0);
}

.sage-ai-diff-type-edit {
  background-color: var(--jp-warn-color3);
  color: var(--jp-warn-color0);
}

.sage-ai-diff-type-remove {
  background-color: var(--jp-error-color3);
  color: var(--jp-error-color0);
}

.sage-ai-diff-summary {
  flex-grow: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sage-ai-diff-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 200px;
  overflow: auto;
}

.sage-ai-diff-old-content,
.sage-ai-diff-new-content {
  margin: 0;
  padding: 8px 12px;
  font-family: var(--jp-code-font-family);
  font-size: 13px;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre;
}

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

.sage-ai-diff-new-content {
  background-color: var(--jp-layout-color1);
}

.sage-ai-diff-cell-actions {
  padding: 8px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--jp-border-color2);
  background: var(--jp-layout-color2);
}

.sage-ai-diff-cell-actions button {
  margin-left: 8px;
}

/* Button styles with improved visibility for bottom positioning */
.sage-ai-confirm-button,
.sage-ai-reject-button {
  padding: 0px 8px;
  font-size: var(--jp-ui-font-size1);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Add subtle shadow for buttons */
}

.sage-ai-confirm-button {
  padding: 0px 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-color1);
}

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

.sage-ai-reject-button:hover {
  text-decoration: underline;
}

/* Approved/Rejected states */
.sage-ai-diff-approved .sage-ai-diff-cell-header {
  background-color: var(--jp-success-color3);
}

.sage-ai-diff-approved .sage-ai-diff-cell-actions {
  background-color: var(--jp-success-color3);
}

.sage-ai-diff-rejected .sage-ai-diff-cell-header {
  background-color: var(--jp-error-color3);
}

.sage-ai-diff-rejected .sage-ai-diff-cell-actions {
  background-color: var(--jp-error-color3);
}

.sage-ai-diff-run .sage-ai-diff-cell-header {
  background-color: var(--jp-info-color3);
}

.sage-ai-diff-run .sage-ai-diff-cell-actions {
  background-color: var(--jp-info-color3);
}

.sage-ai-diff-approval-actions {
  padding: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--jp-border-color2);
  background: var(--jp-layout-color2);
}
