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

/* Circuit panel */
.qs-circuit-panel p {
  padding: 10px 0px;
}

/* Error div in circuit panel */
.qs-circuit-error {
  padding: 10px 0px;
}

.qs-circuit-error p {
  padding: 10px 0px;
}

/*
  Styles for Q# circuits.
  Copied and modified from the default CSS generated by
  https://github.com/microsoft/quantum-viz.js/blob/288e0cb506ee866ecca1b414c522e2d634f7b36d/src/styles.ts
*/

/* Background color for the circuit diagram */
.qs-circuit {
  background: var(--main-background);
}

/* Wires and gate outlines */
.qs-circuit line,
.qs-circuit circle,
.qs-circuit rect {
  stroke: var(--main-color);
  stroke-width: 1;
}

/* Text for qubit labels */
.qs-circuit text {
  fill: var(--main-color);
  dominant-baseline: middle;
  text-anchor: middle;
  font-family: Arial;
}

/* Background for gates */
.qs-circuit .gate-unitary {
  fill: var(--vscode-button-secondaryBackground, #d9f1fa);
}

/* Text for gates */
.qs-circuit .gate text {
  fill: var(--vscode-button-secondaryForeground, #000000);
}

/* Dot and line for controlled gates */
.qs-circuit .gate > line,
.qs-circuit .control-dot {
  fill: var(--main-color);
}

/* X gate */
.qs-circuit .gate > .oplus > line,
.qs-circuit .gate > .oplus > circle {
  fill: var(--main-background);
  stroke: var(--main-color);
  stroke-width: 2;
}

/* Measurement gate */
.qs-circuit .gate-measure {
  fill: var(--vscode-button-background, #ffde86);
}

/* Measurement gate icon */
.qs-circuit .gate > g > line,
.qs-circuit .arc-measure {
  stroke: var(--vscode-button-foreground, #000000);
  fill: none;
  stroke-width: 1;
}

/* SWAP gate */
.qs-circuit rect.gate-swap {
  fill: transparent;
  stroke: transparent;
}

/* Classical wire */
.qs-circuit .register-classical {
  stroke-width: 0.5;
}

/*
  The following styles are unused so they are unthemed.
  They relate to conditional circuits which are not currently supported.
*/

.qs-circuit .hidden {
  display: none;
}

.qs-circuit .classically-controlled-unknown {
  opacity: 0.25;
}

.qs-circuit .classically-controlled-one .classical-container,
.qs-circuit .classically-controlled-one .classical-line {
  stroke: #4059bd;
  stroke-width: 1.3;
  fill: #4059bd;
  fill-opacity: 0.1;
}

.qs-circuit .classically-controlled-zero .classical-container,
.qs-circuit .classically-controlled-zero .classical-line {
  stroke: #c40000;
  stroke-width: 1.3;
  fill: #c40000;
  fill-opacity: 0.1;
}

.qs-circuit .classically-controlled-btn {
  cursor: pointer;
}

.qs-circuit .classically-controlled-unknown .classically-controlled-btn {
  fill: #e5e5e5;
}

.qs-circuit .classically-controlled-one .classically-controlled-btn {
  fill: #4059bd;
}

.qs-circuit .classically-controlled-zero .classically-controlled-btn {
  fill: #c40000;
}

.qs-circuit .classically-controlled-btn text {
  dominant-baseline: middle;
  text-anchor: middle;
  stroke: none;
  font-family: Arial;
}

.qs-circuit .classically-controlled-unknown .classically-controlled-btn text {
  fill: #000000;
}

.qs-circuit .classically-controlled-one .classically-controlled-btn text {
  fill: #ffffff;
}

.qs-circuit .classically-controlled-zero .classically-controlled-btn text {
  fill: #ffffff;
}

.qs-circuit .qviz .gate-collapse,
.qs-circuit .qviz .gate-expand {
  opacity: 0;
  transition: opacity 1s;
}

.qs-circuit .qviz:hover .gate-collapse,
.qs-circuit .qviz:hover .gate-expand {
  visibility: visible;
  opacity: 0.2;
  transition: visibility 1s;
  transition: opacity 1s;
}

.qs-circuit .gate-expand,
.gate-collapse {
  cursor: pointer;
}

.qs-circuit .gate-collapse circle,
.qs-circuit .gate-expand circle {
  fill: white;
  stroke-width: 2px;
  stroke: black;
}

.qs-circuit .gate-collapse path,
.qs-circuit .gate-expand path {
  stroke-width: 4px;
  stroke: black;
}

.qs-circuit .gate:hover > .gate-collapse,
.qs-circuit .gate:hover > .gate-expand {
  visibility: visible;
  opacity: 1;
  transition: opacity 1s;
}
