@charset "utf-8";

/* Example table */

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

.horstmann_exampletable table th {
    background: #F3F3F4;
    color: #000000;
/*    font-size: .75em;*/
}

.horstmann_exampletable table td {
    /*font-size: 90%;*/
}

.horstmann_exampletable th, .horstmann_exampletable td {
    padding: 0.2em 0.7em 0.2em 0.7em;    
}

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

.horstmann_exampletable td code {
    word-wrap: break-word;
}

/* Correct and incorrect inputs */

.horstmann_exampletable td.hc-good {
    background: #e9f2dd;
}

.horstmann_exampletable td.hc-bad, .horstmann_exampletable input.hc-bad {
    background: #F4D3DD;
}

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

/* Walkthrough */

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

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

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

.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 {
    font-size: 110%;
    letter-spacing:-.5px;
    background: #F3F3F4;
    color: #006cb7;
}

.horstmann_walkthrough td {
    letter-spacing: -1px;
    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 tr.hc-bad > td > input {
    background: rgb(244, 211, 221);
}

.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;
}

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

/* Rearrange */

.horstmann_rearrange .left {
    display: inline-block;
    vertical-align: top;
    overflow: hidden;
    white-space: pre-wrap;
    padding: 1.25em 0.62em 10em 0em;
    /* margin-right: -0.12em; */
    float: left;
    /* height: 100%; */
    width: 45%;
    position: relative;
    border-left: solid thin darkgray;
}

.horstmann_rearrange .right {
    border-left: solid thin black;
    display: inline-block;
    vertical-align: top;
    /* height: auto; */
    /* position: static; */
    padding: 1.25em 0.62em 10em 0.62em;
    overflow: hidden;
    width: 45%;
    float: right;
    white-space: pre-wrap;
    height: 100%;
}

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

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

.horstmann_rearrange .tile {
    margin-top: 0.3em;
    margin-bottom: 0.3em;
    padding: 0.3em;
    width: 100%;
    overflow: hidden;
    background: #F3F3F3;
    user-select: none;
    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 {
    font-family:"DejaVuSans", "Arial", sans-serif;    
}

.horstmann_objectdiagram .arena {
    width: 100%;
}

.horstmann_objectdiagram input {
    text-align: center;
}

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

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

/* Colors */

.horstmann_objectdiagram .object > * > * > * {
   background-color: #DF8489;
}

.horstmann_objectdiagram .array > * > * > * {
    background-color: #ffefa9; /* TODO: Really??? */
}

.horstmann_objectdiagram .var > * > * > td, .horstmann_objectdiagram .fatvar > tbody > tr:first-child > td, .horstmann_objectdiagram .fatvar > tbody > tr > td:last-child  {
    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 .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;
    /* padding: 0.5em; */
}

.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;
    /* padding: 0.5em; */
}

.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: 0.25em;
    font-size: 1.2em;
    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 .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 {
    font-size: 0.8em;
    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:first-child > td, .horstmann_objectdiagram .array > tbody > tr:first-child > td {
    padding-top: 0.5em;
}

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

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

/* 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: 0.6em;
    padding-right: 0.5em;
    display: table-cell;
    vertical-align: middle;
}


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

/* 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;
    top: -3px;
}

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

.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;
}

/* 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;
}

.horstmann_algosim .variableName { 
    text-align: right;
}

.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; 
}
