.jsavcontainer {
  overflow:hidden;
  width: auto;
  padding: 0.7em;
  border: 1px solid black;
  background-color: white;
  position: relative;
}
.jsavcanvas {
  position: relative;
  background-color: inherit;
}

.jsavnode {
  width: 45px;
  height: 45px;
  text-align: center;
  line-height: 45px;
  border: 1px solid black;
  background-color: white;
  color: black;
  opacity: 1;
  padding: 0;
}
.jsavcenter {
  margin-left: auto;
  margin-right: auto;
}

.jsavhighlight .jsavvalue, .jsavarray.jsavbararray .jsavindex.jsavhighlight .jsavvalue{
  background-color: yellow;
  border-width: 4px;
  font-size: 120%;  
}

.jsavvalue {
  height: 100%;
  width: 100%;
  min-height: inherit;
  min-width: inherit;
  background-color: inherit;
}

.jsavautoresize .jsavnode {
  width: auto;
  min-width: 45px;
  height: auto;
  min-height: 45px;
}

/***** STYLING OF THE ARRAY DATA STRUCTURE *****/
.jsavarray {
  position: relative;
  list-style: none;
  min-height: 50px;
  padding: 0;
  clear:both;
}
.jsavarray.jsavindexed {
  margin-bottom: 0;
}
.jsavarray:after {
  content: "";
  clear: both;
  display: block;
}
.jsavindexlabel {
  width: 100%;
  height: 20px;
  line-height: 20px;
  color: black;
  position: absolute;
  vertical-align: middle;
}
.jsavindex span {
  z-index: 99;
  display: block;
}
.jsavhorizontalarray .jsavindex {
  float: left;
  position: relative;
}
/* remove right borders from everything but the last index */
.jsavhorizontalarray .jsavindex:not(:last-of-type) {
  border-right: none;
}
.jsavhorizontalarray .jsavindexlabel {
  bottom: -25px;
}
.jsavhorizontalarray .jsavindex:first-of-type, .jsavhorizontalarray .jsavindex:first-of-type .jsavvalue {
  -ms-border-top-left-radius: 8px;
  -ms-border-bottom-left-radius: 8px;
  -moz-border-top-left-radius: 8px;
  -moz-border-bottom-left-radius: 8px;
  -o-border-top-left-radius: 8px;
  -o-border-bottom-left-radius: 8px;
  -webkit-border-top-left-radius: 8px;
  -webkit-border-bottom-left-radius: 8px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.jsavhorizontalarray .jsavindex:last-of-type, .jsavhorizontalarray .jsavindex:last-of-type .jsavvalue {
  -ms-border-top-right-radius: 8px;
  -ms-border-bottom-right-radius: 8px;
  -moz-border-top-right-radius: 8px;
  -moz-border-bottom-right-radius: 8px;
  -o-border-top-right-radius: 8px;
  -o-border-bottom-right-radius: 8px;
  -webkit-border-top-right-radius: 8px;
  -webkit-border-bottom-right-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.jsavbararray {
  height: 150px;
  overflow: visible;
  padding-bottom: 30px;
}
.jsavbararray .jsavindex {
  height: 100%;
  vertical-align: bottom;
  border: none;
  background-color: #ddd;
  margin-left: 2px;
}
.jsavbararray .jsavvalue {
  z-index: 100;
  bottom: 0;
  background-color: inherit;
}
.jsavbararray .jsavvalue {
  -moz-border-radius: 0;
  -o-border-radius: 0;
  -ms-border-radius: 0;
  -webkit-border-radius: 0;
  border-radius: 0;
}
.jsavbararray .jsavvalue span {
  position: absolute;
  width: inherit;
  bottom: 0;
}
.jsavbararray .jsavvalue, .jsavbararray .jsavvaluebar {
  display: block;
  line-height: 20px;
  padding: 0;
  position: absolute;
  width: 100%;
}
.jsavbararray .jsavvaluebar {
  top: 0;
  background-color: #fff;
}
.jsavbararray.jsavindexed {
  margin-bottom: 25px;
}
.jsavbararray .jsavindexlabel {
  font-size: 90%;
  position: relative;
  top: 100%;
	vertical-align: middle;
}

/* vertical array */
.jsavverticalarray.jsavindexed .jsavindex {
  position: relative;
}
.jsavverticalarray .jsavindex {
  margin-bottom: -1px;
}
.jsavverticalarray .jsavindexlabel {
  position: absolute;
  text-align: right;
  width: auto;
  right: 55px;
}
.jsavverticalarray .jsavindex:first-of-type, .jsavverticalarray .jsavindex:first-of-type .jsavvalue {
  -ms-border-top-left-radius: 8px;
  -moz-border-top-left-radius: 8px;
  -o-border-top-left-radius: 8px;
  -webkit-border-top-left-radius: 8px;
  border-top-left-radius: 8px;
  -ms-border-top-right-radius: 8px;
  -moz-border-top-right-radius: 8px;
  -o-border-top-right-radius: 8px;
  -webkit-border-top-right-radius: 8px;
  border-top-right-radius: 8px;
}
.jsavverticalarray .jsavindex:last-of-type, .jsavverticalarray .jsavindex:last-of-type .jsavvalue {
  -ms-border-bottom-left-radius: 8px;
  -moz-border-bottom-left-radius: 8px;
  -o-border-bottom-left-radius: 8px;
  -webkit-border-bottom-left-radius: 8px;
  border-bottom-left-radius: 8px;
  -ms-border-bottom-right-radius: 8px;
  -moz-border-bottom-right-radius: 8px;
  -o-border-bottom-right-radius: 8px;
  -webkit-border-bottom-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* bar array marker line */
.jsavmark {
  position: absolute;
  display: none;
  background-color: #FF6464;;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  -ms-border-radius: 10px;
  -o-border-radius: 10px;
  border-radius: 10px;
  width: 8px;
  height: 8px;
  z-index: 190;
}
.jsavmarkline {
  position: absolute;
  display: none;
  height:1px;
  background-color: #FF6464;
  background-color: rgba(255, 100, 100, 0.6);
  z-index: 190;
}

/***** END STYLING OF THE ARRAY DATA STRUCTURE *****/

/*** OUTPUT STYLING ***/
.jsavline {
  overflow: visible;
  border: none;
  background-color: inherit;
  height:50px;
}
.jsavscroll {
  overflow: auto; 
  background-color: white; 
  border: 1px solid black;
  height:220px;
}
.jsavoutput .jsavtitle {
  display:block;
  margin-top:2.5em;
  font-size:300%;
  text-align:center;
}

.jsavindex.jsavarrow:before {
  content: "";
  background-color: transparent;
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top: 6px solid black;
  top: -10px;
  left: 17px;
}

/**** END OUTPUT STYLING ***/

.jsavcanvas svg {
  position: absolute;
  height: 100%;
  width: 100%;
}

/**** STYLING THE CONTROLS ****/
.jsavcontrols {
  text-align: center;
}
.jsavcontrols a {
  display: inline-block;
  color: transparent;
  text-indent: 9999px;
  width: 45px;
  height: 45px;
  margin: 15px 40px;
  background-color: #aaa;
  -o-border-radius: 20px;
  -moz-border-radius: 20px;
  -webkit-border-radius: 20px;
  -ms-border-radius: 20px;
  border-radius: 20px;
  background-repeat:no-repeat;
  background-position:50% 50%;
}
.jsavplaying a {
  cursor: default;
}
.jsavcontrols .jsavbegin {
  background-image: url(images/begin.png);
}
.jsavcontrols .jsavend {
  background-image: url(images/end.png);
}
.jsavcontrols .jsavbackward {
  background-image: url(images/backward.png);
}
.jsavcontrols .jsavforward {
  background-image: url(images/forward.png);
}
/**** END STYLING THE CONTROLS ****/

/**** STYLING THE DIALOG ****/
.jsavdialog {
  border: 1px solid black;
  background-color: #fff;
  z-index: 1000;
  position: absolute;
  top: 0; 
  left: 0;
  -moz-border-radius: 6px;
  -ms-border-radius: 6px;
  -o-border-radius: 6px;
  -webkit-border-radius: 6px;
  border-radius: 6px;
}
.jsavmodal {
  z-index: 999;
  background-color: rgb(120, 120, 120);
  background-color: rgba(0, 0, 0, 0.2);
  position: absolute;
  top: 0;
  left: 0;
}
.jsavdialog h2 {
  background-color: #eee;
  border-bottom: 1px dashed black;
  color: black;
  font-size: 1.5em;
  font-weight: bold;
  margin: 0;
  padding: 5px;
  -moz-border-radius: 6px 6px 0 0;
  -ms-border-radius: 6px 6px 0 0;
  -o-border-radius: 6px 6px 0 0;
  -webkit-border-radius: 6px 6px 0 0;
  border-radius: 6px 6px 0 0;
}
.jsavsettings {
  padding: 15px;
}
a.jsavsettings {
  background-image: url(images/settings.png);
  width: 20px;
  height: 20px;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-color: #aaa;
  text-indent: 120%;
  padding: 2px;
  border: 1px solid black;
  -o-border-radius: 3px;
  -ms-border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  float:right; 
  margin-right:10px; 
  display:block;
  white-space: nowrap;
  overflow: hidden;
}
.jsavsettings .jsavhelp {
  font-size: 80%;
  margin-left: 40px;
}
.jsavrow {
  margin: 15px 8px 4px 8px;
}
/**** END STYLING THE DIALOG ****/

/**** MODEL ANSWER ********/
.jsavmodelanswer.jsavcontainer {
  padding: 0;
  padding-bottom: 5px;
  background-color: white;
  border-width: 0;
  border-radius: 8px;
  position: relative;
}
.jsavcontainer svg {
  pointer-events: none;
}
.jsavmodelanswer .jsavcounter {
  float: left;
  left: 10px;
  position: absolute;
  top: 15px;
}
.jsavmodelanswer .jsavcontrols a {
  margin: 5px 20px 0 0;
}
.jsavmodelanswer .jsavcontrols .jsavend {
  margin-right: 0;
}
a.jsavdialogclose {
  background-color: #AAA;
  border: 2px solid white;
  -ms-border-radius: 20px;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  -o-border-radius: 20px;
  border-radius: 20px;
  color: white;
  float: right;
  font-family: monospace;
  font-size: 20px;
  font-weight: normal;
  height: 20px;
  padding: 3px;
  text-align: center;
  text-decoration: none;
  width: 20px;
  line-height: 1;
}

.jsavexercisecontrols {
  position: relative;
}

.jsavexercisecontrols .actionIndicator {
  display: inline-block;
  width: 15px;
  height: 15px;
  position: absolute;
}
.jsavexercisecontrols.active .actionIndicator {
  background-image: url(images/spinner.gif);
}

/********* TREE / GRAPH DATA STRUCTURE *******/

.jsavtree, .jsavgraph, .jsavlist {
  position: relative;
  background-color: inherit;
}
.jsavtreenode, .jsavgraphnode {
  border-radius: 23px;
  position: absolute;
}
.jsavnullnode {
  min-width: 20px;
  border-color: #eee;
  opacity: 0;
}
.jsavnulledge {
  stroke: white;
  stroke: transparent;
  opacity: 0;
}

.jsavedgelabel {
  background-color: inherit;
  z-index: 700;
}

/******** LINKED LIST STRUCTURE ******/
.jsavpointerarea {
  background-color: #eee;
  display: block;
}
.jsavhorizontallist .jsavpointerarea {
  border-left: 1px solid black;
  position: absolute;
  right: 0;
  top: 0;
  width: 10px;
  height: 100%;
}

.jsavverticallist .jsavpointerarea {
  border-top: 1px solid black;
  bottom: 0;
  height: 10px;
  position: absolute;
  width: 100%;
}
.jsavhorizontallist.jsavautoresize .jsavnode {
  min-width: 33px;
  min-height: 45px;
  padding-right: 12px;
}
.jsavverticallist.jsavautoresize .jsavnode {
  min-width: 45px;
  min-height: 33px;
}
.jsavlistnode {
  position: absolute;
}
.jsavlist .jsavedge {
  stroke-width: 2;
}

/******** PSEUDOCODE VIEW *******/
.jsavcode {
  font-family: monospace;
}
ul.jsavcode {
  list-style: none;
  padding: 0;
}
.jsavcodeline {
  background-color: #FAFAFA;
  padding: 2px 10px;
  white-space: pre;
}
.jsavcodeline.jsavpreviousline {
  background-color: #eee;
}
.jsavcodeline.jsavcurrentline {
  background-color: #ccc;
}
.jsavcodeline.jsavhighlight {
  background-color: yellow;
}
.jsavhiddencode {
  display: none !important;
}



/******** Event prevention DIV shutter ******/
.jsavshutter {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
}
.jsavplaying .jsavshutter {
  display: block;
}