/** General markup **/

html, body {
    height: 100%;
    margin: 0;
}

nav {
    height: 38px;
    padding: 4px 1em;
}

nav a, nav button, nav img {
    display: inline-block;
    width: 38px;
    height: 38px;
    vertical-align: middle;
}

div {
    font-family: sans-serif;
}

button {
    color: #FFFFFF;
    outline: none;
    border: none;
    font-size: 16px;
    font-family: sans-serif;
    white-space: nowrap;
    border-radius: 8px;
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

label {
    font-family: sans-serif;
    white-space: nowrap;
}

/** Specific markup **/

#levels {
    display: inline-block;
    width: calc(100% - 452px);
    text-align: center;
}

#levels button {
    color: black;
    border: 2px solid #555;
}

#levels button:first-child {
    border: none;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-right: 30px solid #555;
    border-bottom: 15px solid transparent;
    background: none;
}

#levels button:first-child:disabled {
    border-right-color: #C8C8C8;
    cursor: not-allowed;
}

#levels button:last-child {
    border: none;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-left: 30px solid #555;
    border-bottom: 15px solid transparent;
    background: none;
}

#levels button:last-child:disabled {
    border-left-color: #C8C8C8;
    cursor: not-allowed;
}

#exportButton, #importButton, #shareButton, #scoreButton {
    width: 98px;
    height: 38px;
}

#scoreButton {
    float: right;
}

#importInput {
    display: none;
}

#simulation {
    position: relative;
    box-sizing: border-box;
    padding-bottom: 127px;
    width: 30%;
    height: calc(100% - 46px);
    float: left;
    text-align: center;
}

#simulationVisualisation {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    background-color: #9E9E9E;
}

#simulationBody {
    min-width: 420px;
    overflow-y: scroll;
}

#simulationControls {
    position: absolute;
    height: 127px;
    left: 0;
    right: 0;
    bottom: 0;
}

#simulationControls button {
    width: 30%;
    height: 38px;
}

#scoreboard {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 70%;
    height: calc(100% - 46px);
    z-index: 100;
    text-align: center;
}

#scoreBody {
    height: 100%;
    overflow-y: scroll;
}

#blocklyArea {
    width: 50%;
    height: calc(100% - 46px);
    float: left;
}

#blocklyDiv {
    position: absolute;
}

#toolbox {
    display: none;
}

#simulationHelp {
    position: relative;
    box-sizing: border-box;
    padding-bottom: 127px;
    width: 20%;
    height: calc(100% - 46px);
    float: left;
    background-color: #ddd;
}

#simulationText {
    padding: 16px;
}

#simulationHelpButtons {
    text-align: center;
}

#simulationHelpButtons button {
    width: 45%;
    height: 38px;
}

/** Colours **/

.red {
    background-color: #EF5350;
}

.green {
    background-color: #4CAF50;
}

.blue {
    background-color: #2196F3 !important;
}

.yellow {
    background-color: #FFC107;
}

.gray {
    background-color: #ddd;
}

/** Table formatting **/

table {
    width: 100%;
    font-family: sans-serif;
    border-collapse: collapse;
}

#simulation td {
    width: 16.67%;
    border: 2px solid #9E9E9E;
}

#simulation td:first-child {
    border-right: 2px double black;
}

#simulation td:last-child {
    border-left: 2px double black;
}

#scoreboard td {
    width: 25%;
    border: 2px solid #9E9E9E;
}

thead td {
    border-bottom: 2px double black !important;
}

#scoreboard thead td:not(:first-child):not(:last-child) {
    border-left: 2px double black;
    border-right: 2px double black;
}

#tableBody tr {
    height: 24px;
}

#scoreTableBody tr {
    cursor: pointer;
    height: 48px;
}

#scoreTableBody tr:hover {
    background-color: dimgray;
}

tr:first-child {
    border-top: hidden;
}

#tableBody tr:last-child {
    border-bottom: hidden;
}

/** Input formatting **/

input[type=range] {
    -webkit-appearance: none;
    width: 95%;
    padding: 0;
    outline: none;
    vertical-align: bottom;
}

input[type=range]::-webkit-slider-runnable-track {
    background-color: #d7dbdd;
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type=range]::-moz-range-track {
    background-color: #d7dbdd;
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type=range][disabled]::-webkit-slider-runnable-track {
    background-color: transparent;
    border: 1px solid #d7dbdd;
    cursor: not-allowed;
}

input[type=range][disabled]::-moz-range-track {
    background-color: transparent;
    border: 1px solid #d7dbdd;
    cursor: not-allowed;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    margin-top: -7px;
    border-radius: 100%;
    background-color: #606670;
    height: 18px;
    width: 18px;
    cursor: pointer;
}

input[type=range]::-moz-range-thumb {
    border-radius: 100%;
    background-color: #606670;
    height: 18px;
    width: 18px;
    cursor: pointer;
}
