/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

.jp-git-diff-root .jp-git-diff-header {
  flex: 0 0 auto;
}

.jp-git-diff-root .nbdime-root {
  border: var(--codemirror-border);
}

.jp-git-diff-root .jp-Notebook-diff .jp-Metadata-diff {
  border: none;
}

.jp-git-diff-root .jp-Notebook-diff .CodeMirror-merge-r-chunk-end,
.jp-git-diff-root .jp-Notebook-diff .CodeMirror-merge-l-chunk-end {
  border-bottom: none;
}

.jp-git-diff-root .jp-Notebook-diff .CodeMirror-merge-r-chunk-start,
.jp-git-diff-root .jp-Notebook-diff .CodeMirror-merge-l-chunk-start {
  border-top: none;
}

.jp-git-diff-root .jp-Notebook-diff .CodeMirror-merge-r-chunk {
  background-color: var(--jp-git-diff-deleted-color);
}

.jp-git-diff-root
  .jp-Notebook-diff
  .CodeMirror-merge-pane-remote
  .CodeMirror-merge-r-chunk {
  background-color: var(--jp-git-diff-added-color);
}

.jp-git-diff-root .jp-Notebook-diff .CodeMirror-merge-spacer {
  background-color: transparent;
}

.jp-git-diff-root
  .jp-Notebook-diff
  .CodeMirror-merge-pane-remote
  .CodeMirror-merge-spacer {
  background-color: transparent;
}

.jp-git-diff-root .jp-Diff-added .CodeMirror,
.jp-git-diff-root .jp-Diff-added .jp-Diff-renderedOutput,
.jp-git-diff-root .jp-Cellrow-outputs .jp-Diff-twoway .jp-Diff-remote {
  background-color: var(--jp-git-diff-added-color);
  border: none;
}

.jp-git-diff-root .jp-Diff-deleted .CodeMirror,
.jp-git-diff-root .jp-Diff-deleted .jp-Diff-renderedOutput,
.jp-git-diff-root .jp-Cellrow-outputs .jp-Diff-twoway .jp-Diff-base {
  background-color: var(--jp-git-diff-deleted-color);
  border: none;
}

/* Imported from nbdime-jupyterlab */
.jp-git-diff-root .nbdime-Widget {
  display: flex;
  flex-direction: column;
}

.jp-git-diff-root .nbdime-root {
  padding: var(--jp-notebook-padding);
  min-width: 50px;
  min-height: 50px;
  outline: none;
  overflow: auto;
  background: var(--jp-layout-color0);
  color: var(--jp-ui-font-color0);
  flex: 1 1 auto;
}


/* Header syling */

.jp-git-diff-root .nbdime-Diff {
  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
  box-shadow: var(--jp-toolbar-box-shadow);
  background: var(--jp-toolbar-background);
  color: var(--jp-ui-font-color1);
  flex: 0 0 auto;
  padding: 2px;
  z-index: 1;
}

/* Hiding unchanged cells if told to */
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff.jp-Diff-unchanged {
  display: none;
}

/* Show a marker with the number of cells hidden before */
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenBefore]::before,
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenBefore]::before {
  content: attr(data-nbdime-NCellsHiddenBefore) " unchanged cell(s) hidden";
  position: absolute;
  width: 100%;
  top: 0;
  background-color: var(--jp-layout-color2);
  border-top: solid var(--jp-layout-color3) 1px;
  border-bottom: solid var(--jp-layout-color3) 1px;
  text-align: center;
}

/* Show a marker with the number of cells hidden after (for hidden cells at end) */
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenAfter]::after,
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenAfter]::after {
  content: attr(data-nbdime-NCellsHiddenAfter) " unchanged cell(s) hidden";
  position: absolute;
  width: 100%;
  bottom: 0;
  background-color: var(--jp-layout-color2);
  border-top: solid var(--jp-layout-color3) 1px;
  border-bottom: solid var(--jp-layout-color3) 1px;
  text-align: center;
}

.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenBefore],
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenBefore] {
  padding-top: 40px;
}

.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenAfter],
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Diff-addremchunk[data-nbdime-NCellsHiddenAfter] {
  padding-bottom: 40px;
}

/* Marker for when all cells are unchanged and hidden */
.jp-git-diff-root .nbdime-root.jp-mod-hideUnchanged .jp-Notebook-diff[data-nbdime-AllCellsHidden]::after {
  content: "No changes, " attr(data-nbdime-AllCellsHidden) " unchanged cell(s) hidden";
  display: block;
  width: 100%;
  background-color: var(--jp-layout-color2);
  border-top: solid var(--jp-layout-color3) 1px;
  border-bottom: solid var(--jp-layout-color3) 1px;
  text-align: center;
}
