@charset "utf-8";

/* Example table */

.horstmann_exampletable > table {
    table-layout: fixed;
    width: 100%;
}

/* Firefox adds tbody (even for a th), and the problem author might add thead/tbody */

.horstmann_exampletable > table > tr > th, .horstmann_exampletable > table > * > tr > th { 
    background: #F3F3F4;
    font-size: .75em;
}

.horstmann_exampletable > table > tr > td, .horstmann_exampletable > table > tbody > tr > td {
    background: white;
    font-size: .875em;
}

.horstmann_exampletable > table > tr > th, .horstmann_exampletable > table > * > tr > th, .horstmann_exampletable > table > tr > td, .horstmann_exampletable > table > tbody > tr > td {
    padding: 0.5em 0.7em 0.3em 0.7em;    
}

.horstmann_exampletable > table > tr > td:first-child, .horstmann_exampletable > table > tbody > tr > td:first-child, .horstmann_exampletable > table > tr > td:nth-child(3), .horstmann_exampletable > table > tbody > tr > td:nth-child(3) {
    background: #E9EDF7;
}

.horstmann_exampletable > table > tr > td:nth-child(2), .horstmann_exampletable > table > tbody > tr > td:nth-child(2) {
    text-align: center;
}

.horstmann_exampletable > table > tr > td.hc-good, .horstmann_exampletable > table > tbody > tr > td.hc-good {
    background: #e9f2dd;
}

.horstmann_exampletable > table > tr > td > pre, .horstmann_exampletable > table > tbody > tr > td > pre {
    margin-top: .25em;
}

/* ----------------------------------------------------------- */

/* Walkthrough */

.horstmann_walkthrough code-table {
    margin-top: 1em;
    white-space: nowrap;
    width: 100%;
}

.horstmann_walkthrough pre {
   display: inline-block;
   vertical-align: top;
}

.horstmann_walkthrough pre > span {
    margin-left: 2em;
    display: block;
    white-space: pre;
}

.horstmann_walkthrough pre > span:focus, .horstmann_walkthrough th:focus, .horstmann_objectdiagram span:focus, .horstmann_objectdiagram table:focus, .horstmann_rearrange .tile:focus, .multiple-choice > li:focus {
    /* border: solid 0.2em #c0c0c0; */
}

.horstmann_walkthrough .selected-line {
    background: #ffe06a;
}

.horstmann_walkthrough table {
   display: inline-block;
   vertical-align: top;
   margin-top: 0;
}

.horstmann_walkthrough th, .horstmann_walkthrough td {
    font-weight:normal;
    text-align:center;
    vertical-align: baseline;
    padding: 0.2em;
    cursor: pointer;
}

.horstmann_walkthrough th.hc-hand {
    background: #F3F3F4;
    color: #006cb7;
    min-width: 5em;
}

.horstmann_walkthrough th.hc-hand, .horstmann_walkthrough td.hc-hand {
    font-size: 111%;
}

.horstmann_walkthrough td {
    background: #E9EDF7;
    color: #2E4D79;
}

.horstmann_walkthrough td:empty:after{
  content: "\00a0";
} 

.horstmann_walkthrough .old-value {
    text-decoration: line-through;
}

.horstmann_walkthrough .selected-line::before {
    content: url("../images/paper_clip.png");
    position: absolute;
    transform: translate(-120%, 0%);    
}

.horstmann_walkthrough tr.hc-bad::after {
    content: url("../images/cross.png");
    vertical-align: baseline;
}

.horstmann_walkthrough tr.hc-good::after {
    content: url("../images/tick.png");
    vertical-align: baseline;
}

.horstmann_walkthrough .code-table > pre > .hc-good::before {
    content: url("../images/small-tick.png");
    position: absolute;
    transform: translate(-120%, 0%);
}

.horstmann_walkthrough .code-table > pre > .hc-bad::before {
    content: url("../images/small-cross.png");
    position: absolute;
    transform: translate(-120%, 0%);
}

.horstmann_walkthrough th.hc-good::after {
    content: url("../images/tick.png");
    vertical-align: baseline;
}

.horstmann_walkthrough th.hc-bad::after {
    content: url("../images/cross.png");
    vertical-align: baseline;
}

/* To work around a bug in Safari. Unfortunately, the workaround doesn't work either */
.horstmann_walkthrough .selected-line:focus::before, .horstmann_walkthrough .code-table > pre > .hc-good:focus::before, .horstmann_walkthrough .code-table > pre > .hc-bad:focus::before {
    outline: none; 
}

/* ----------------------------------------------------------- */

/* Rearrange */

.horstmann_rearrange .hc-hand {
    font-size: 111%; /* 1/0.9 */
}

.horstmann_rearrange > div {
    display: table;
    width: 100%;
}

.horstmann_rearrange .left {
    display: table-cell;
    vertical-align: top;
    overflow: hidden;
    white-space: pre-wrap;
    padding: 1.25em 0.62em 5em 0em;    
    width: 50%;
}

.horstmann_rearrange .right {
    border-left: solid thin black;
    display: table-cell;
    vertical-align: top;
    padding: 1.25em 0.62em 1.25em 0.62em;
    overflow: hidden;
    width: 50%;
    white-space: pre-wrap;
}

.horstmann_rearrange .left, .horstmann_rearrange .right {
    user-select: none;
    -moz-user-select: none;      /* Firefox */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none;   /* Safari */
    -ms-user-select: none;       /* Internet Explorer/Edge */        
}


.horstmann_rearrange .levels {
    position: absolute;
    height: 100%;
    top: 0;
}

.horstmann_rearrange .levels > div {
    position: absolute;
    height: 100%;
    border-left: dashed thin blue;
    z-index: -1;
}

.horstmann_rearrange .tile {
    margin-top: 0.3em;
    margin-bottom: 0.3em;
    padding: 0.3em;
    overflow: hidden;
    background: #F3F3F4;
    cursor: move;
}

.horstmann_rearrange .fixed {
    background: #D3D3D3;
    margin-top: 0.6em;
    margin-bottom: 0.6em;    
}

.horstmann_rearrange .hc-bad {
    background: #F4D3DD;
}

.horstmann_rearrange .hc-good {
    background: #e9f2dd;
}

.horstmann_rearrange .dragover * {
    pointer-events: none;
}

/* ----------------------------------------------------------- */

/* Object diagram */

.horstmann_objectdiagram .arenaContainer {
    width: 100%;
    margin: 2em;
    cursor: pointer;
    user-select: none;
    -moz-user-select: none;      /* Firefox */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none;   /* Safari */
    -ms-user-select: none;       /* Internet Explorer/Edge */    
}

.horstmann_objectdiagram .arenaContainer table {
    font-size: inherit; /* Otherwise a browser style sheet rule sets this, which interferes with zooming */
}

.horstmann_objectdiagram .arenaContainer div:first-child {
    width: 100%;
    /* margin-right: 100px; */
}

.horstmann_objectdiagram .object, .horstmann_objectdiagram .var, .horstmann_objectdiagram .fatvar, .horstmann_objectdiagram .array {
    text-align: center;
    border-collapse: collapse;
    margin: 0em;
    hyphens: none;
}

/* Bad object */
.horstmann_objectdiagram .hc-bad > tbody > tr:first-child::after {
    content: url("../images/cross.png");
    vertical-align: baseline;
}

/* Bad span (marked in row) */
.horstmann_objectdiagram tr.hc-bad::after {
    content: url("../images/cross.png");
    vertical-align: baseline;
}


/* Colors */

.horstmann_objectdiagram .object.heap > * > * > *, .horstmann_objectdiagram .array.heap > * > * > * { /* Heap objects and arrays */
   background-color: #DF8489;
}

.horstmann_objectdiagram .object > * > * > * { /* Embedded objects */
   background-color: #FBBC86;
}

.horstmann_objectdiagram .array > * > * > * { /* Embedded arrays */
    background-color: #FFEFA9;
}

.horstmann_objectdiagram .var > tbody > tr > td, .horstmann_objectdiagram .fatvar > tbody > tr:first-child > td, .horstmann_objectdiagram .fatvar > tbody > tr > td:last-child  { /* Variables */
    background-color: #FFEFA9;
}

/* Round corners */

.horstmann_objectdiagram .object > thead > tr > th, .horstmann_objectdiagram .array > thead > tr > th {
    border-top-left-radius: 0.75em;
    border-top-right-radius: 0.75em;
}

.horstmann_objectdiagram .untitled > tbody > tr:first-child > td:first-child {
    border-top-left-radius: 0.75em;
}

.horstmann_objectdiagram .untitled > tbody > tr:first-child > td:last-child {
    border-top-right-radius: 0.75em;
}

.horstmann_objectdiagram .object > tbody > tr:last-child > td:first-child, .horstmann_objectdiagram .array > tbody > tr:last-child > td:first-child {
    border-bottom-left-radius: 0.75em;
}

.horstmann_objectdiagram .object > tbody > tr:last-child > td:last-child, .horstmann_objectdiagram .array > tbody > tr:last-child > td:last-child {
    border-bottom-right-radius: 0.75em;
}

.horstmann_objectdiagram .var > tbody > tr:first-child > td:first-child, .horstmann_objectdiagram .fatvar > tbody > tr:first-child > td:first-child {
    border-top-left-radius: 0.75em;
    border-bottom-left-radius: 0.75em;
}

.horstmann_objectdiagram .var > tbody > tr:first-child > td:last-child, .horstmann_objectdiagram .fatvar > tbody > tr:first-child > td:last-child {
    border-top-right-radius: 0.75em;
    border-bottom-right-radius: 0.75em;
}

.horstmann_objectdiagram .fatvar > tbody > tr:first-child > td:last-child {
    border-bottom-left-radius: 0.75em;
}


/* Headers for objects and arrays */

.horstmann_objectdiagram .object > thead > tr > th, .horstmann_objectdiagram .array > thead > tr > th {
    border-bottom: 0.2em;
    border-left: 0em;
    border-right: 0em;
    border-top: 0em;
    border-style: solid;
    border-bottom-color: #fff;
    padding: .5em 1em .5em 1em;
    font-size: 110%; 
    text-decoration: underline;
}

/* Left column */

.horstmann_objectdiagram .object > tbody > tr > td:first-child {
    text-align: right;
    padding-left: 0.75em;
}

.horstmann_objectdiagram .var > tbody > tr > td:first-child, .horstmann_objectdiagram .fatvar > tbody > tr > td:first-child {
    text-align: right;
    padding-left: 0.75em;
}

/* Separator between left and right column */

.horstmann_objectdiagram .object > tbody > tr > td:first-child:after, .horstmann_objectdiagram .var > tbody > tr:first-child > td:first-child:after, .horstmann_objectdiagram .fatvar > tbody > tr:first-child > td:first-child:after {
    content: "=";
    padding-left: 0.3em;
    padding-right: 0.3em;
}

/* Right column */

.horstmann_objectdiagram .object td:last-child, .horstmann_objectdiagram .var td:last-child {
    padding-right: 0.75em;
}


.horstmann_objectdiagram table > tbody > tr > td > span {
    /* font-size: 80%; */
}

.horstmann_objectdiagram table > tbody > tr > td > span > table {
    /* font-size: 119%; 1/0.84 */
}

.horstmann_objectdiagram .object > tbody > tr > td:last-child > span, .horstmann_objectdiagram .var > tbody > tr > td:last-child > span, .horstmann_objectdiagram .fatvar > tbody > tr > td:last-child > span, .horstmann_objectdiagram .array > tbody > tr > td:first-child > span {
    padding: 0.1em;
    margin: 0.1em;
    background-color: #fff;
    white-space: nowrap;
    display: block;
    min-width: 5em;
    text-align: center;
}

/* Top and bottom padding */

.horstmann_objectdiagram .object > tbody > tr > td {
    padding-top: 0em;
}

.horstmann_objectdiagram .object > tbody > tr > td, .horstmann_objectdiagram .array > tbody > tr > td {
    padding-top: 0em;
    padding-bottom: 0em;
}

.horstmann_objectdiagram .object > tbody > tr:first-child > td, .horstmann_objectdiagram .array > tbody > tr:first-child > td {
    padding-top: 0.1em;
}

.horstmann_objectdiagram .object > tbody > tr:last-child > td, .horstmann_objectdiagram .array > tbody > tr:last-child > td {
    padding-bottom: 0.3em;
}

.horstmann_objectdiagram .var > tbody > tr > td:first-child, .horstmann_objectdiagram .fatvar > tbody > tr > td:first-child {
    padding-top: 0.1em;
    padding-bottom: 0.3em;
}

/* Fat variables */

.horstmann_objectdiagram .fatvar > tbody > tr:first-child > td:first-child {
    height: 3em;
}

.horstmann_objectdiagram .fatvar > tbody > tr:last-child > td:first-child {
    display: block;
    height: 100%;
}

.horstmann_objectdiagram .fatvar > tbody > tr:last-child > td:first-child::after {
    content: " ";
}

.horstmann_objectdiagram .fatvar > tbody > tr:last-child > td:last-child {
    padding: 0;
}

/* Arrays */

.horstmann_objectdiagram .array > tbody > tr > td {
    padding-left: 0.2em;
    padding-right: 0.2em;
}

.horstmann_objectdiagram .array { 
    counter-reset: hc-array-index -1;
}

.horstmann_objectdiagram .array > tbody > tr > td {
    counter-increment: hc-array-index;
}

.horstmann_objectdiagram .array.indexed > tbody > tr::after {
    content: "[" counter(hc-array-index) "]";   
    font-size: 80%;
    padding-left: 0.2em;
    padding-right: 0.5em;
    display: table-cell;
    vertical-align: middle;
}


.horstmann_objectdiagram input.hc-good {
    background-color: #e9f2dd !important;
}

.horstmann_objectdiagram span.hc-good {
    background: #e9f2dd !important;
}

.horstmann_objectdiagram span.pointerStart {
    background-color: blue;
}

/* ----------------------------------------------------------- */

/* Multiple choice, multiple answers */

/* TODO: Unify */

.multiple-choice > li, .horstmann_ma > li {
    list-style: none;
    margin: 0;
    padding: 7px 0px 3px 30px;
}

.multiple-choice > li {
    background: url("../images/box.png") no-repeat left top;
}

.multiple-choice > li.correct.clicked {
    background: url("../images/box_tick.png") no-repeat left top;
}

.multiple-choice > li.clicked {
    background: url("../images/box_cross.png") no-repeat left top;
}  

.horstmann_ma > li {
    background-color: #F3F3F4;
    border-bottom: 4px solid white;
}

.horstmann_ma > li .hc-button.unselected {
    background: gray;
    margin-right:1em;
    margin-bottom:1em;
}

.horstmann_ma > li .hc-button.selected {
    background: #006cb7;
    margin-right:1em;
    margin-bottom:1em;
}

.horstmann_ma > li.hc-good {
   background: url("../images/tick.png") no-repeat left top;
}  

.horstmann_ma > li.hc-bad {
   background: url("../images/cross.png") no-repeat left top;
}

.horstmann_ma > li > pre {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Explanations in multiple choice questions */

.multiple-choice .explanation, .horstmann_ma .explanation {
    background-color:#F3F0DD;
    margin-top: 1em;
    margin-right: 1em;
    padding-bottom:6px;
    padding-top:6px;
    padding-left:6px;
    padding-right:6px;
}

.multiple-choice .explanation p, .horstmann_ma .explanation p {
    color:#000000;
    line-height:1.143;
    margin-bottom:.5em;
    margin-left:0px;
    margin-right:1em;
    margin-top:0;
    text-align:left;
    text-indent:0;
}


/* ----------------------------------------------------------- */

/* Algosim */

.horstmann_algosim .array {
  border-style: none;
  border-collapse:separate;
  border-spacing:0.3em;
}

.horstmann_algosim td.index { 
    text-align: center;
    font-size: .76em;
    background-color: white;
}

.horstmann_algosim .variableName { 
    text-align: right;
    background-color: white;
}

.horstmann_algosim .empty {
    background-color: white;
}

.horstmann_algosim .variable { 
    text-align: center;
    margin: 0.5em;
    min-width: 2.5em;
    min-height: 2.5em;
    padding-top: 0.75em;
    padding-bottom: 0.75em;
    border-style: none;
    background-color: #80d4ce; 
}

.horstmann_algosim .character { 
    text-align: center;
    margin: 0.1em;
    min-width: 1.5em;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    border-style: none;
    background-color: #80d4ce; 
}

.horstmann_algosim .hidden { 
    background-color: #80d4ce; 
}

.horstmann_algosim .variable.highlight { 
    background-color: #ff0000; 
}

.horstmann_algosim .hc-instructions {
    min-height: 1em;
}
