/* CSS stylesheet for displaying scipp objects in jupyterlab.
* Original source from
* https://github.com/jsignell/xarray/blob/1d960933ab252e0f79f7e050e6c9261d55568057/xarray/static/css/style.css
*/

.sc-root {
  --sc-background-color0: var(--jp-layout-color0, #fff);
  --sc-background-color1: var(--jp-layout-color1, #fcfcfc);
  --sc-background-color2: var(--jp-layout-color2, #efefef);
  --sc-inverse-background-color0: var(--jp-inverse-layout-color4, #111);
  --sc-font-color0: var(--jp-content-font-color0, #000);
  --sc-font-color1: var(--jp-content-font-color1, #555);
  --sc-font-color2: var(--jp-content-font-color2, #888);
  --sc-font-color3: var(--jp-content-font-color3, #ccc);
  --sc-table-data-color: $data_color;
  --sc-table-coords-color: $coords_color;
  --sc-table-masks-color: $masks_color;
  --sc-table-attrs-color: $attrs_color;
  --sc-table-header-font-color: $header_text_color;
}

.sc-wrap {
  font-size: 14px;
  min-width: 300px;
  max-width: 800px;
}

/* The CSS styling for the inline attributes table */
.sc-var-attrs .sc-wrap{
  padding-left: 3em;
}

.sc-header {
  padding-top: 6px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: solid 1px #ddd;
}

.sc-header > div,
.sc-header > ul {
  display: inline;
  margin-top: 0;
  margin-bottom: 0;
}

.sc-obj-type,
.sc-array-name {
  margin-left: 2px;
  margin-right: 10px;
}

.sc-obj-type {
  color: var(--sc-font-color1);
}

.sc-underlying-size {
  color: var(--sc-font-color2);
}

.sc-sections {
  padding-left: 0 !important;
  display: grid;
  grid-template-columns: 150px auto auto auto 1fr 20px 20px;
}

.sc-section-item {
  display: contents;
}

.sc-section-item input {
  display: none;
}

.sc-section-item input:enabled + label {
  cursor: pointer;
  color: var(--sc-font-color1);
}

.sc-section-item input:enabled + label:hover {
  color: var(--sc-font-color0);
}

.sc-section-summary {
  grid-column: 1 ;
  font-weight: 500;
}

.sc-section-summary > span {
  display: inline-block;
  padding-left: 0.5em;
}

.sc-section-summary-in:disabled + label {
  color: var(--sc-font-color1);
}

.sc-section-summary-in + label:before {
  display: inline-block;
  content: '►';
  font-size: 11px;
  width: 15px;
  text-align: center;
}

.sc-section-summary-in:disabled + label:before {
  color: var(--sc-font-color3);
}

.sc-section-summary-in:checked + label:before {
  content: '▼';
}

.sc-section-summary-in:checked + label > span {
  display: none;
}

.sc-section-summary,
.sc-section-inline-details {
  padding-top: 4px;
  padding-bottom: 4px;
}

.sc-section-inline-details {
  grid-column: 2 / 6;
}

.sc-section-details {
  display: none;
  grid-column: 1 / -1;
  margin-bottom: 5px;
}

.sc-section-summary-in:checked ~ .sc-section-details {
  display: contents;
}

.sc-array-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 20px auto;
}

.sc-array-wrap > label {
  grid-column: 1;
  vertical-align: top;
}

.sc-preview {
  color: var(--sc-font-color2);
}

.sc-array-preview,
.sc-array-data {
  padding: 0 5px !important;
  grid-column: 2;
}

.sc-array-data,
.sc-array-in:checked ~ .sc-array-preview {
  display: none;
}

.sc-array-in:checked ~ .sc-array-data,
.sc-array-preview {
  display: inline-block;
}

.sc-dim-list {
  display: inline-block !important;
  list-style: none;
  padding: 0 !important;
  margin: 0;
}

.sc-dim-list li {
  display: inline-block;
  padding: 0;
  margin: 0!important;
}

.sc-dim-list:before {
  content: '(';
}

.sc-dim-list:after {
  content: ')';
}

.sc-dim-list li:not(:last-child):after {
  content: ',';
  padding-right: 5px;
}

.sc-has-index {
  font-weight: bold;
}

.sc-var-list,
.sc-var-item {
  display: contents;
}

.sc-var-item > div,
.sc-var-item label,
.sc-var-item > .sc-var-name span {
  background-color: var(--sc-background-color1);
  margin-bottom: 0;
}

.sc-var-item > .sc-var-name:hover span {
  padding-right: 5px;
}

.sc-var-list > li:nth-child(odd) > div,
.sc-var-list > li:nth-child(odd) > label,
.sc-var-list > li:nth-child(odd) > .sc-var-name span {
  background-color: var(--sc-background-color2);
}

.sc-var-name {
  grid-column: 1;
}

.sc-var-dims {
  grid-column: 2;
}

.sc-var-dtype {
  grid-column: 3;
  text-align: right;
  color: var(--sc-font-color2);
}
.sc-var-unit{
  grid-column: 4;
  text-align: left;
  color: var(--sc-font-color1);
  max-width: 50pt;
  text-overflow: ellipsis;
}
.sc-value-preview {
  grid-column: 5;
}
.sc-var-preview-variances{
  text-align:right;
}

.sc-sections .sc-section-item .sc-section-summary,
.sc-sections .sc-section-item .sc-section-inline-details,
.sc-section-item .sc-var-list .sc-var-item > div,
.sc-section-item .sc-var-list .sc-var-item > label,
.sc-section-details .sc-var-list .sc-var-item > div,
.sc-section-details .sc-var-list .sc-var-item > label {
  margin-top: 0;
  margin-bottom: 0;
}

.sc-var-name,
.sc-var-dims,
.sc-var-dtype,
.sc-var-unit,
.sc-preview,
.sc-attrs dt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.sc-var-name:hover,
.sc-var-dims:hover,
.sc-var-dtype:hover,
.sc-var-unit:hover,
.sc-attrs dt:hover {
  overflow: visible;
  width: auto;
  z-index: 1;
}

.sc-var-attrs {
  display: block;
}
.sc-var-data {
  display: none;
}
.sc-var-attrs,
.sc-var-data {
  background-color: var(--sc-background-color0) !important;
  padding-bottom: 5px !important;
}

.sc-var-attrs-in:checked ~ .sc-var-attrs {
  display: none;
}
.sc-var-data-in:checked ~ .sc-var-data {
  display: block;
}

.sc-var-data > table {
  float: right;
}

.sc-var-name span,
.sc-var-data {
  padding-left: 25px !important;
}

.sc-var-attrs,
.sc-var-data {
  grid-column: 1 / -1;
}

dl.sc-attrs {
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 125px auto;
}

.sc-attrs dt, dd {
  padding: 0;
  margin: 0;
  float: left;
  padding-right: 10px;
  width: auto;
}

.sc-attrs dt {
  font-weight: normal;
  grid-column: 1;
}

.sc-attrs dt:hover span {
  display: inline-block;
  padding-right: 10px;
}

.sc-attrs dd {
  grid-column: 2;
  white-space: pre-wrap;
  word-break: break-all;
}

.sc-icon-database,
.sc-icon-file-text2 {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1.5em !important;
  stroke-width: 0;
  stroke: currentColor;
  fill: currentColor;
}

label.sc-hide-icon svg{
  opacity: 0;
}

.sc-standalone-var-name{
  grid-column: 1/3;
}

.sc-standalone-var-name span{
  padding-left: 25px;
  padding-right:10px;
}

.sc-table {
  border-collapse: collapse;
}

.sc-title {
  font-weight:bold;
  font-size:1.5em;
}

.sc-subtitle {
  font-weight:normal;
  font-style:italic;
  text-align:left;
  font-size:1.2em;
  padding: 1px;
}

.sc-table th, .sc-table td {
  border: 1px solid var(--sc-inverse-background-color0);
  padding: 0 5px 0 5px;
}

.sc-table th {
  text-align: center;
}

.sc-table tr {
  background-color: var(--sc-background-color1);
  text-align: right;
}

.sc-table tr:hover {
  background-color: var(--sc-background-color2);
}

.sc-table th.sc-data {
  background-color: var(--sc-table-data-color);
  color: var(--sc-table-header-font-color);
}

.sc-table th.sc-coords {
  background-color: var(--sc-table-coords-color);
  color: var(--sc-table-header-font-color);
}

.sc-table th.sc-masks {
  background-color: var(--sc-table-masks-color);
  color: var(--sc-table-header-font-color);
}

.sc-table th.sc-attrs {
  background-color: var(--sc-table-attrs-color);
  color: var(--sc-table-header-font-color);
}

.sc-table th.sc-subheader {
  background-color: var(--sc-background-color2);
}

.sc-table td.sc-padding {
  background-color: var(--sc-background-color1);
  border: 0 solid var(--sc-background-color1);
  height: 1.2em;
}

.sc-label {
  fill: var(--sc-font-color0, #444444);
  text-anchor: middle;
}

.sc-name {
  fill: var(--sc-font-color0, #111111);
}

.sc-inset-line {
  stroke: var(--sc-font-color1);
  stroke-width: 0.05;
  stroke-dasharray: 0.2, 0.2;
}

.sc-log-wrap {
  height: 25ex;
  resize: vertical;
  overflow-y: scroll;
  display: flex;
  flex-direction: column-reverse;
  border: 1px solid;
  border-color: var(--jp-border-color2);
  background-color: var(--sc-background-color1);
}

div.sc-log {
  line-height: 2.5ex;
}

table.sc-log {
  table-layout: auto;
  border-collapse: collapse;
}

tr.sc-log:nth-child(even) {
  background-color: var(--sc-background-color0);
}

tr.sc-log > td {
  vertical-align: top;
  padding-bottom: 0.5ex;
}

.sc-log-time-stamp {
  min-width: 22ch;
  font-family: var(--jp-code-font-family);
  color: var(--sc-font-color2);
}

.sc-log-level {
  min-width: 10ch;
}

tr.sc-log-debug td.sc-log-level {
  color: var(--jp-accent-color1);
}

tr.sc-log-info td.sc-log-level {
  color: var(--jp-info-color1);
}

tr.sc-log-warning td.sc-log-level {
  color: var(--jp-warn-color1);
}

tr.sc-log-error td.sc-log-level {
  font-weight: bold;
  color: var(--jp-error-color2);
}

tr.sc-log-critical td.sc-log-level {
  font-weight: bold;
  color: var(--sc-background-color0);
  background-color: var(--jp-error-color1);
}

.sc-log-message {
  white-space: pre-wrap;
  width: 100%;
}

.sc-log-html-payload {
  white-space: normal;
}

.sc-log-name {
  padding-right: 0.5em;
  text-align: right;
  white-space: pre-wrap;
  color: var(--sc-font-color3);
}
