/* Copyright (c) Microsoft Corporation.
   Licensed under the MIT License. */

@import "./qdk-theme.css";

/* Styles for Q# UX components.

Notes:
 - Variables and class names should be prefixed with "qs-" to minimize conflicts in other contexts.
 - Colors should be defined in terms of CSS variables, so that they can be overridden by the editor theme.
 - Values should be defined in terms of the VS Code theme colors, with fall-backs for other environments.

Define variables as using a VS Code variable by default, e.g. "--vscode-foreground", and then a fallback
value for use in other environments. Use the variable in setting class properties, e.g:

:root {
  --qs-foreground: var(--vscode-foreground, black);
}

.qs-button {
  color: var(--qs-foreground);
}

It is recommended that the page these components are included in using a CSS reset such as
modern-normalize (see https://mattbrictson.com/blog/css-normalize-and-reset for more information).
*/

/* Global variables for styling */

/* TODO: Use the qs- prefixes and apply consistently */
:root {
  --heading-background: #262679;
  --main-background: var(
    --vscode-editor-background,
    var(--jp-layout-color0, #ececf0)
  );
  --main-color: var(
    --vscode-editor-foreground,
    var(--jp-widgets-color, #202020)
  );
  --qs-tr-nth-color: var(
    --vscode-list-hoverBackground,
    var(--jp-layout-color1, var(--colab-secondary-surface-color, #f2f2f2))
  );
  --nav-background: #bed1f4;
  --nav-hover-background: #b3bede;
  --nav-current-background: #b5c5f2;
  --border-color: #768f9c;
  --menu-box-fill: var(--main-background);
  --error-background-color: #ffe3e3;
  --warning-background-color: #fff6d7;
  --bar-selected-outline: #587ddd;
}

/* Results panels */

.results-column {
  grid-area: results;
  margin-left: 0px;
  margin-top: 32px;
  margin-right: 120px;
}

.active-tab {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: underline;
}

.results-labels {
  display: flex;
  height: 32px;
}

.results-labels > div {
  margin-right: 40px;
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
}

.ast-output {
  height: 40vh;
  min-height: 400px;
  width: 100%;
  resize: none;
  white-space: pre;
}

.hir-output {
  height: 40vh;
  min-height: 400px;
  width: 100%;
  resize: none;
  white-space: pre;
}

.rir-output {
  height: 40vh;
  min-height: 400px;
  width: 100%;
  resize: none;
  white-space: pre;
}

.qir-output {
  height: 40vh;
  min-height: 400px;
  width: 100%;
  resize: none;
  white-space: pre;
}

/* Results output */

.output-header {
  font-size: 1.1rem;
  font-weight: 400;
  margin-top: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}

.prev-next {
  font-weight: 200;
  cursor: pointer;
}

.result-label {
  margin-bottom: 24px;
  font-style: italic;
  font-weight: 300;
}

.message-output {
  font-weight: 300;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* State table */

.state-table {
  border-collapse: collapse;
  font-size: 0.9rem;
  width: 100%;
  min-width: 400px;
  margin-bottom: 16px;
}

.state-table thead tr {
  background: var(--nav-background);
}

.state-table tbody tr {
  border-top: 1px solid gray;
}

.state-table td,
.state-table th {
  text-align: center;
  padding: 6px;
  white-space: nowrap;
}

.state-table progress {
  margin-right: 2px;
}

/* Histogram */

.histogram {
  max-height: calc(100vh - 40px);
  max-width: 600px;
  border: 1px solid var(--qdk-widget-outline);
  background-color: var(--qdk-host-background);
}

.bar {
  fill: var(--qdk-shape-fill);
}

.bar:hover {
  stroke: var(--qdk-shape-stroke-hover);
  stroke-width: 0.5;
}

.bar-selected {
  stroke: var(--qdk-shape-stroke-selected);
  fill: var(--qdk-shape-fill-selected);
}

.bar-label {
  font-size: 3pt;
  fill: var(--qdk-text-high-contrast);
  text-anchor: end;
  pointer-events: none;
}

.bar-label-ket {
  font-family: var(--qdk-font-family-monospace);
  font-variant-ligatures: none;
}

.histo-label {
  font-size: 3.5pt;
  fill: var(--qdk-host-foreground);
}

.hover-text {
  font-size: 3.5pt;
  fill: var(--qdk-host-foreground);
  text-anchor: middle;
}

.menu-icon * {
  fill: var(--qdk-host-background);
  stroke: var(--qdk-host-foreground);
}

.menu-box {
  fill: var(--qdk-host-background);
  stroke: var(--qdk-host-foreground);
  stroke-width: 0.1;
}

.menu-item {
  width: 32px;
  height: 10px;
  fill: var(--qdk-menu-fill);
  stroke: var(--qdk-mid-gray);
  stroke-width: 0.2;
}

.menu-item:hover {
  stroke-width: 0.6;
  fill: var(--qdk-menu-fill-hover);
}

.menu-selected {
  /* stroke: #0800ff; */
  fill: var(--qdk-menu-fill-selected);
}

.menu-text {
  font-size: 4.5px;
  pointer-events: none;
  fill: var(--qdk-host-foreground);
}

.menu-separator {
  stroke: var(--qdk-mid-gray);
  stroke-width: 0.25;
}

.help-info {
  fill: var(--qdk-host-background);
  stroke: var(--qdk-mid-gray);
  stroke-width: 0.5;
}

.help-info-text {
  font-size: 4.5px;
  pointer-events: none;
  fill: var(--qdk-host-foreground);
}

/* RE details */

.estimate-details {
  padding: 1em;
}

.estimate-details > summary {
  font-size: 1.1em;
}

.estimate-table {
  margin-top: 1em;
  font-size: 0.9em;
}

.estimate-table tr:nth-child(even) {
  background-color: var(--qs-tr-nth-color);
}

.estimate-cell {
  vertical-align: top;
  padding-right: 8px;
}

.title-cell {
  font-weight: bold;
  white-space: nowrap;
}

.value-cell {
  text-align: center;
  width: 100px;
  white-space: nowrap;
}

.estimate-explanation {
  margin-top: 1em;
  margin-bottom: 1em;
  max-width: 500px;
}

.estimate-assumption {
  margin: 1em;
}

/* Space chart */

#pieChart {
  fill: var(--main-color);
}

.spaceReport {
  display: flex;
  flex-direction: column;
}

.spaceReportHeader {
  font-size: 13px;
  background-color: var(--qs-tr-nth-color);
  border-top: 0.5px gray solid;
  border-bottom: 0.5px gray solid;
  padding: 10px;
}

.spaceReportRow {
  display: flex;
  font-size: 12px;
  padding: 10px 24px;
}

.spaceDetailText {
  width: 200px;
}

.qs-help {
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.qs-help h1 {
  margin-top: 16px;
  margin-bottom: 8px;
  line-height: 1.25;
  font-weight: 600;
  padding-bottom: 0.3em;
  font-size: 2em;
  border-bottom: 1px solid var(--vscode-editorWidget-border);
}

.qs-help h2 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
  line-height: 1.25;
  padding-bottom: 0.3em;
  font-size: 1.4em;
  border-bottom: 1px solid var(--vscode-editorWidget-border);
}

/* Results Table */

.qs-resultsTable-sortedTable {
  border-collapse: collapse;
  margin: 12px 0px;
  outline: none;
}

.qs-resultsTable-sortedTable th,
.qs-resultsTable-sortedTable td {
  padding: 4px 8px;
  text-align: left;
}

.qs-resultsTable-dragEnter {
  background-color: #8888;
  border-left: 1.5px solid blue;
  border-right: 1.5px solid blue;
}

.qs-resultsTable-sortedTable tr:nth-child(even) {
  background: var(--qs-tr-nth-color);
}

.qs-resultsTable-sortedTable tbody tr:hover {
  background: var(--vscode-list-hoverBackground, var(--js-layout-color2));
}

.qs-resultsTable-sortedTableSelectedRow td {
  background: var(--vscode-button-background, var(--jp-layout-color3));
  color: var(--vscode-button-foreground);
  font-weight: 600;
}

.qs-resultsTable-columnMenu {
  display: none;
  width: 160px;
}

.qs-resultsTable-showColumnMenu {
  display: block;
  position: absolute;
  background-color: var(--vscode-menu-background, var(--main-background));
  border: 1px solid #8888;
  padding: 4px;
  z-index: 100;
  text-align: left;
}

.qs-resultsTable-menuItem {
  cursor: pointer;
  background-color: var(--vscode-list-hoverBackground, var(--jp-layout-color1));
  padding: 4px;
  margin: 2px;
  font-size: 14px;
  font-weight: 400;
}

.qs-resultsTable-menuItem:hover {
  background-color: var(--vscode-menu-border, var(--jp-layout-color2));
}

.qs-resultsTable-columnSelected {
  cursor: pointer;
  padding: 4px;
  font-weight: 400;
  font-size: 14px;
  background-color: var(--vscode-button-background, var(--jp-brand-color1));
  color: var(--vscode-button-foreground, var(--jp-ui-inverse-font-color0));
  margin: 2px;
  border-radius: 3px;
}

.qs-resultsTable-headerCell {
  padding-right: 20px;
}

.qs-resultsTable-sortHeaderCell {
  padding-right: 4px;
}

@keyframes codicon-spin {
  100% {
    transform: rotate(360deg);
    transform-origin: center;
  }
}

.codicon-modifier-spin {
  fill: var(--vscode-icon-foreground, gray);
  animation: codicon-spin 1.5s steps(45) infinite;
}

.qs-scatterChart-x-axisTitle,
.qs-scatterChart-y-axisTitle {
  text-anchor: middle;
  font-size: 16px;
  fill: var(--main-color);
}

.qs-scatterChart-y-axisTitle {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

.qs-scatterChart-point {
  r: 2px;
  stroke-width: 4px;
}

.qs-scatterChart-hover:hover {
  r: 4px;
  stroke-width: 4px;
  fill: white;
}

.qs-scatterChart-point-selected {
  r: 8px;
  stroke-width: 4px;
  fill: white;
}

.qs-scatterChart-watermark {
  font-size: 16px;
  fill: var(--main-color);
}

.qs-scatterChart-tooltip,
.qs-scatterChart-selectedInfo {
  position: absolute;
  visibility: hidden;
  background: var(--main-background);
  color: var(--main-color);
  border: var(--border-color) 1px solid;
  padding: 4px;
}

/* This rule adds the little triangle pointer at the top */
.qs-scatterChart-tooltip::after,
.qs-scatterChart-selectedInfo::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent var(--border-color) transparent;
}

.qs-scatterChart-axis,
.qs-scatterChart-tick-line {
  stroke: var(--border-color);
}

.qs-scatterChart-x-tick-text {
  text-anchor: middle;
  fill: var(--main-color);
}

.qs-scatterChart-y-tick-text {
  text-anchor: end;
  fill: var(--main-color);
}

.qs-estimatesOverview-error {
  color: red;
}

.qs-estimatesOverview-saveIcon {
  cursor: pointer;
  width: 3em;
  height: 3em;
  background-color: var(--main-background);
  position: absolute;
  bottom: 5px;
  left: 5px;
  border: none;
}

.qs-estimatesOverview-saveIconSvgPath {
  fill: var(--main-color) !important;
  fill-rule: evenodd !important;
  clip-rule: evenodd !important;
}
