/* Binary trees */
.tree {
  min-width: 600px;
  margin: auto;
  position: relative;
}

.tree ul {
  margin: auto;
  padding: 20px 5px 5px 0px;
  position: relative;
}

.tree li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 5px 5px 0px;
}

.tree li::before,
.tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 3px solid var(--bs-gray);
  width: 50%;
  height: 20px;
}

.tree li::after {
  right: auto;
  left: 50%;
  border-left: 3px solid var(--bs-gray);
}

.tree li:only-child::after,
.tree li:only-child::before {
  display: none;
}

.tree li:only-child {
  padding-top: 0;
}

.tree li:first-child::before,
.tree li:last-child::after {
  border: 0 none;
}

.tree li:last-child::before {
  border-right: 3px solid var(--bs-gray);
  border-radius: 0 5px 0 0;
  -webkit-border-radius: 0 5px 0 0;
  -moz-border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
  border-radius: 5px 0 0 0;
  -webkit-border-radius: 5px 0 0 0;
  -moz-border-radius: 5px 0 0 0;
}

.tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 3px solid var(--bs-gray);
  width: 0;
  height: 20px;
}

.tree li .circle:hover {
  background: lightgray;
  color: #000;
  border: 5px solid black;
}

/* Circle in binary trees */
.solidCircle {
  display: inline-block;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  padding: 2px;
  background: #fff;
  border: 3px solid var(--bs-gray);
  color: #000;
  text-align: center;
  font: 14px Arial, sans-serif;
  line-height: 40px;
}

.dashCircle {
  border-radius: 50%;
  width: 50px;
  height: 50px;
  padding: 2px;
  background: #fff;
  border: 3px dashed lightgrey;
  color: #000;
  text-align: center;
  font: 14px Arial, sans-serif;
}

.tree .red {
  background-color: lightcoral;
}

.tree .black {
  background-color: darkgray;
}


/* svg graph */
svg {
  width: 100%;
  height: auto;
  min-height: 180px;
}

circle {
  stroke-width: 2;
  stroke-linecap: round;
  stroke: black;
  fill: white;
}

.source {
  fill: lightgrey;
}

circle.editable:hover {
  stroke-width: 5;
  cursor: -webkit-pointer;
  cursor: pointer;
}

.circleLabels {
  font-size: 20px;
  text-anchor: middle;
  stroke: lightpink;
  stroke-width: 1px;
}

.circleLabels.editable:hover {
  font-weight: bold;
}

line {
  stroke-width: 2;
  stroke: black;
}

/* The Close Button */
.close {
  color: #aaaaaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

/* Floating button*/
.floating-container {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  border-radius: 50px;
  text-align: center;
  box-shadow: 2px 2px 3px #999;
  display: none;
  background-color: rgb(158, 155, 155);
}

.floating-container:hover {
  cursor: -webkit-pointer;
  cursor: pointer;
  background-color: rgb(85, 78, 78);
}

.plusIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 45px;
  color: black;
}

.plusIcon:hover {
  color: lightblue;
}

.colorIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 40px;
  color: rgb(243, 237, 237);
}

#redColor {
  background-color: darkred;
}

#redColor:hover {
  color: darkred;
  background-color: pink;
}

#blackColor {
  background-color: rgb(57, 56, 56);
}

#blackColor:hover {
  color: black;
  background-color: gray;
}

/* MISC */

.footer {
  padding: 10px;
  margin: 10px;
}

.exeTable {
  text-align: center;
  max-width: 600px;
}

/* For correct/wrong messages -- each input */
.lbFwd {
  font-weight: bold;
}

/* Before submit button -- whole task*/
.feedbackMsg {
  color: #2D5C7F;
  display: flex;
  align-items: center;
  font-weight: bold;
}

.vList {
  margin: 5px;
}

#lang:hover {
  cursor: -webkit-pointer;
  cursor: pointer;
}

.btn {
  margin: 2px
}

code {
  font-family: Consolas, "courier new";
  color: crimson;
  background-color: #f1f1f1f0;
  padding: 2px;
  font-size: 105%;
}

/* Visualizers */
#visualizer-container {
  display:flex;
  flex-direction: column;
  align-items: center;
  row-gap: 2em;
}

#visualizer-container .tree {
  display:flex;
}

.js-bar-graph {
  display: initial;
}

.js-bar-cell, .js-bar-cell-index {
  float:left;
  list-style: none;
  position: relative;
  height: 200px;
  width: 8%;
}

.js-bar-cell-index {
  height: 1.5em;
}

.js-bar-cell + .js-bar-cell-index {
  clear: left;
}

.js-bar-cell > .js-bar, .js-bar-cell-index > .js-index {
  display:flex;
  justify-content: center;
  text-align: center;
  position: absolute;
  width: 100%;
  bottom: 0;
  background-color: #2D5C7F;
  color:white;
  vertical-align: baseline;
  border: 1px solid;
}

.js-index > .js-bar-text {
  opacity: .5;
}

.js-bar-text {
  color:black;
  position: absolute;
  bottom: -22px;
}

.js-bar-cell.animating {
  transition: transform 5s ease-in-out;
}

.low-opac {
  opacity: .4;
}


.arr-vis {
  --size: 50px;
  --lh: 40px;
  height: var(--size);
}

.arr-vis + .control-container {
  margin-top: 1em;
}

.arr-vis .arr-cell {
  display: block;
  float: left;
  width: var(--size);
  height: var(--size);
  line-height: var(--lh);
  text-align: center;
  border: 3px solid gray;
  border-right: 0 none;
  --border-hide-style: dotted;
}

.arr-cell.last {
  border-right: 3px solid gray;
}

.arr-vis .arr-cell + .arr-index {
  clear: left;
}

.arr-vis .arr-index {
  display: block;
  float: left;
  width: var(--size);
  height: var(--size);
  line-height: var(--lh);
  text-align: center;
  opacity: .5;
}

.arr-vis span.dotted-internal-borders:not(:first-child) {
  border-left-style: var(--border-hide-style);
}

#log-container {
  border: 1px solid gray;
  display: none;
  grid-template-columns: 3em 1fr;
  align-items: center;
  align-content: center;
  max-width: 500px;
  padding: 1em;
}

.info-container {
  display: grid;
  background-color: #2D5C7F;
  color: white;
  border-radius: 500000px;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  width: 2em;
  height: 2em;
  place-content: center;
}

.log-text {
  margin: 0;
}

.visual-dropdown {
  margin-bottom: 1em;
}

#speed-slider-label {
  display: block;
  user-select: none;
} 

#speed-slider {
  display: block;
}


.arr-cell.no-border {
  border-color: transparent;
}

.matrix-container, .matrix-content {
  position: relative;
}

.matrix-borders {
  position: absolute;
  width: max-content;
  z-index: 50;
}


.metadata-container {
  border: 1px solid gray;
  display: flex;
  flex-direction: row;
  gap: 1em;
  padding: .5em 1em;
}

.metadata-key {
  font-weight: bolder;
}

.metadata-element {
  margin: 0;
}

.metadata-value {
  margin-left: 5px;
}

.highlighted-index .js-bar-text {
  color: red;
}

.highlighted-index .js-index::after {
  position: absolute;
  content: attr(js-index-highlight);
  top: 1.4em;
  color:red;
}

.graphContainer {
  margin-bottom: 3em;
  width: 100%;
}

.allgraphs-container {
  display:flex;
  max-width: 600px;
  width: 80%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;
}

.buckets-container {
  display:flex;
  flex-direction: row;
  gap: .5em;
  margin-top: 2em;
}

.bucket::before {
  content: attr(data-range);
  position: absolute;
  color: gray;
  text-align: center;
  width: 50px;
  top: -20px;
}

.bucket {
  display:flex;
  flex-direction: column;
  position: relative;
  width: 50px;
}

.bucket .bucket-entry {
  display:block;
  width: 50px;
  height: 50px;
  line-height: 40px;
  text-align: center;
  border: 3px solid gray;
  border-bottom: none;
  --border-hide-style: dotted;
  position: relative;
}

.bucket .bucket-entry:last-child::after, .bucket:empty::after {
  display:block;
  content: '/';
  text-align: center;
  font-size: 20px;
  position: absolute;
  right:50%;
  transform: translateX(50%);
  width: 50px;
  height: 50px;
  border: 3px solid gray;
  box-sizing: border-box;
  line-height: 40px;
  top: 47px;
}

.bucket:empty::after {
  top: 0;
}

.buckets-container {
  margin-bottom: 50px;
}

.csort-auto-margin {
  margin: auto;
}

.csort-subject {
  display: inline-block;
  width: max-content;
}

#csort-11-container .info-button {
  position: relative;
  background-color: #1082fd;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  margin-left:auto ;
}

#csort-11-container .info-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.csort-jspan {
  height : 100%;
  width: 4rem;
  background-color : white;
  border : thin solid rgb(190, 190, 210);
  border-radius : 0.375rem;
  display: flex;
  justify-content: center;
  align-items: center;
}


.csort-jbox {
  position : relative;
  bottom : 1rem;
}

.csort-abcframe {
  border : thin solid rgb(190, 190, 210);
  border-radius : 0.375rem;
}

.csort-row {
  flex-wrap: nowrap;
}

.csort-index {
  border-color : transparent !important;
  opacity : 1 !important;
  flex: auto 1 1;
}

.csort-value {
  flex: auto 1 1;
  user-select: none;
  -webkit-user-select: none;
}

.csort-min-element {
  padding: 2px 4px 2px 4px;
  min-width: 3ch;
}

.csort-lbfwd {
  min-width: 6rem;
  display: flex;
  align-items: center;
}

.csort-arrayname {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-family: "Lucida Console", "Courier New", monospace;
  color: rgb(190, 190, 210);
  padding-right: 0px;
  cursor: default;
}

.csort-correct-bc {
  background-color: green !important;
  color: white !important;
}

.csort-wrong-bc {
  background-color: red !important;
}

.csort-abcframe .btn[locked="true"] {
  background-color: #6c757d;
  cursor: default;
}

.csort-abcframe input[disabled] {
  background-color: #6c757d;
  color: white;
}

.csort-hide {
  display: none;
}


.bfs-canvas {
  height: auto;
  width: 100%;
  border:  1px solid lightgrey;
  border-radius:  0.5rem;
}

.bfs-step {
  min-height: 50px;
  max-width: 50rem;
}

.links line {
  stroke-width: 1px;
}

.nodes circle {
  stroke: #aaa;
  stroke-width: 1px; 
}

.node-label {
  font-family: var(--bs-body-font-family);
  font-size: 0.75rem;
  pointer-events: none;
}

.node-text {
  font-family: var(--bs-body-font-family);
  font-size: 0.5rem;
  stroke: #417541;
  pointer-events: none;
}

.nodes .node-btn {
  transition: stroke-width 0.25s;
  cursor: pointer;
}

.nodes .node-btn:hover {
  stroke-width: 2px;
}


#visualizer-container .tree {
  min-width: auto;
}

@media screen and (max-width:550px) {

  .arr-vis {
    --size: 40px;
    --lh: 30px;
  }

  #visualizer-container .solidCircle {
    width: 40px;
    height: 40px;
    line-height: 30px;
  }
}

@media screen and (max-width: 450px) {
  .arr-vis {
    --size: 30px;
    --lh: 20px;
  }
}

@media screen and (max-width: 350px) {
  .arr-vis {
    --size: 25px;
    --lh: 15px;
  }
}