/*

*/

* { 
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
}

h1, h2, h3, h4, h5 {
    margin: 0px;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 2px black;
}

body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;

    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: auto 1fr auto;
    background-color: whitesmoke;

    font-family: Arial, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    overflow: hidden;
}

header {
    padding: 5px 10px 5px 30px;
    background-color: #2b477f;
    box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.3);
    z-index: 1000;

    display: grid;
    grid-template-columns: 1fr 100px;
    grid-template-rows: 30px auto;
    grid-template-areas: "a1 a2" "b1 b2";
}

header .main-title,
header .sub-title {
    color: white;
    font-weight: bold;
    font-size: 24px;
    text-shadow: 2px 2px 2px black;
}

header .main-title {
    grid-area: a1;
}

header .sub-title {
    grid-area: b1;
    font-weight: 100;
    font-size: 18px;
    padding-top: 6px;
}

header .controls {
    grid-area: a2;
    display: flex;
    justify-self: end;
}

header img {
    height: 100%;
}

header svg {
    /*position: absolute;*/
    /*height: 25px;
    width: auto;
    top: 8px;
    right: 5px;

    fill-rule: evenodd;
    fill-rule: nonzero;
    clip-rule: evenodd;
    stroke-linecap: round;
    stroke-linejoin: round;*/
    /*fill: none;
    stroke: #FFF;
    stroke-width: 4px;*/

    cursor: pointer;
}

header .btnSettings {
    fill: none;
    stroke: #FFF;
    stroke-width: 4;
    padding: 5px;
}

header .btnScreen {
    fill: #FFF;
}

header .btnScreen .off {
    display: none;
}

header .btnScreen.on .on {
    display: none;
}

header .btnScreen.on .off {
    display: initial;
}


main {
    position: relative;
    overflow: hidden;
    background-color: rgb(250,250,250);
}

.container {
    position: absolute;
    left: 0px;
    width: 100%;
    height: 100%;

    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 100%;
    grid-template-areas: "nav content";
    
    opacity: 1;
    transition: opacity 1000ms linear 0ms, left 0ms linear 0ms;
}

.container.container-hide {
    left: -105%;
    opacity: 0.01;
    transition: opacity 1000ms linear 0ms, left 0ms linear 1000ms;
}

.content {
    grid-area: content;

    position: absolute;
    width: 100%;
    height: 100%;

    padding: 10px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 100%;
    grid-template-areas: "svg result";

    overflow: hidden;
    opacity: 1;
    transition: all 150ms;
}

body > footer {
    min-height: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    background-color: #e9ecf2;
    box-shadow: 0px -3px 3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.nav {
    grid-area: nav;
    min-width: 40px;
    border-right: 1px solid #2b477f;
}

.left {
    grid-area: svg;
    padding: 10px;
}

.right {
    grid-area: result;
    padding: 10px;

    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 1fr 50px;
}

.right .table-content {
    overflow-y: auto;
}

.right table {
    width: 100%;
    border: 2px solid black;
    border-spacing: 0;
    border-collapse: collapse;
    font-size: 14px;
    user-select: none;
    caption-side: bottom;
}

.right table tfoot {
    display: none;
}

.right table caption {
    display: none;
    height: 15px;
    /*border: 2px solid black;*/
    border-radius: 0px 0px 15px 15px;
    /*border-top: none;*/
    color: white;
    /*background-color: rgba(43, 71, 127, 0.4);*/
    cursor: pointer;
}

.right table.solution caption {
    display: table-caption;
}

.right table.solution caption:hover {
    background-color: rgba(43, 71, 127, 0.6);
}

.right table.showSolution td,
.right table.showSolution caption {
    pointer-events: none;
}

.right table tr {
    height: 24px;
}

.right table tr:hover {
    background-color: rgba(43, 71, 127, 0.2);
}

.right table tr.selected {
    background-color: rgba(43, 71, 127, 0.2);
}

.right table th,
.right table td {
    width: 100px;
    /*padding: 2px;*/
    min-height: auto;
    border: 1px solid darkgray;
    text-align: center;
}

.right table th:nth-child(1),
.right table td:nth-child(1) {
    width: 20px;
}

.right table td:nth-child(1) {
    background-color: rgba(43, 71, 127, 0.4);
    cursor: pointer;
}

.right table td:nth-child(1):hover {
    background-color: rgba(43, 71, 127, 0.6);
}

.right table th {
    border-bottom: 2px solid black;
    background-color: wheat;
}

.svg {
    height: 100%;
    width: auto;
    overflow: hidden;
    user-select: none;
    /*border: ridge;*/
    padding: 15px;
}


.result {
    display: grid;
    grid-template-columns: auto 60px 150px;
    column-gap: 20px;
    padding: 10px 0px;
}

.result label {
    position: relative;
    justify-self: end;
    align-self: center;
}

.result input::-webkit-outer-spin-button,
.result input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

.result input[type=number] {
    text-align: right;
    border-radius: 5px;
    padding: 0px 5px;

    -moz-appearance:textfield; /* Firefox */
}

.result label::after {
    content: "";
    position: absolute;
    right: -109px;
    top: -12px;
    width: 35px;
    height: 35px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.result.correct label::after {
    background-image: url(../media/q_correct.svg);
}
.result.correct input {
    background-color: rgba(172, 255, 47, 0.3);
}
.result.correct .btn {
    display: none;
}

.result.wrong label::after {
    background-image: url(../media/q_wrong.svg);
}
.result.wrong input {
    background-color: rgba(170, 0, 0, 0.3);
}

.start .controls .btnSettings {
    display: none;
}

/*
    SVG
*/

.logitest_fluss_line {
    fill: none;
    stroke: black;
    stroke-width: 1.5;
    stroke-miterlimit: 3;
}

.logitest_fluss_form {
    fill: rgba(0, 0, 0, 0);
    stroke: black;
    stroke-width: 1.5;
    stroke-miterlimit: 3;
    cursor: pointer;
    z-index: 10;
}

.logitest_fluss_text {
    font-size: 12px;
    fill: black;
    stroke: none;
    text-anchor: middle;
    z-index: 200;
    pointer-events: none;
}

.logitest_fluss_form.selected {
    fill: silver;
    fill: goldenrod;
}


/* 
    Buttons 
*/

.c-btn {
    position: relative;
    display: grid;
    align-items: center;
    justify-items: center;
    font-size: 28px;
    font-weight: bold;
    aspect-ratio: 1;
    padding: 5px;
    color: white;
    text-shadow: 2px 2px 2px black;
    background-color: #2b477f;
    cursor: pointer;
    user-select: none;
}

.controls .c-btn {
    height: 100%;
}

.controls .c-btn.disabled {
    color: darkgray;
    background-color: gray;
    pointer-events: none;
}

.nav .c-btn {
    font-size: 24px;
    font-weight: normal;
    width: 100%;
    justify-items: end;
    z-index: 1;
}

.nav .c-btn.selected {
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    background-color: goldenrod;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.nav .c-btn:hover {
    background-color: rgba(43, 71, 127, 0.6);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.nav .c-btn:active {
    /*background-color: rgba(43, 71, 127, 0.6);*/
    background-color: #2b477f;
    background-color: goldenrod;
    box-shadow: none;
}

.btn {
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 5px 15px;
    border-radius: 200px;
    color: white;
    background-color: #2b477f;
    cursor: pointer;
    user-select: none;
}

.btn:hover {
    /*background-color: rgba(43, 71, 127, 0.6);*/
    background-color: #2b477f;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.6);
}

.btn:active {
    background-color: goldenrod;
    box-shadow: none;
}

.page_hide {
    opacity: 0;
}

.hide {
    display: none;
}

.no_events {
    pointer-events: none;
}

.bgc-red{
    background-color: rgba(255,0,0,0.6);
}

.lc-red{
    stroke: rgba(255,0,0,1.0);
    stroke-width: 3;
}

.tc-red{
    fill: rgba(255,0,0,1.0);
}

.bgc-green{
    background-color: rgba(0,255,0,0.6);
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 100%;
        grid-template-rows: auto 1fr;
        grid-template-areas: "nav"
                             "content";
    }
    .container .nav {
        height: 27px;
        border-right: none;
        border-bottom: 1px solid #2b477f;
    }

    .container .nav .c-btn {
        width: auto;
        height: 100%;
        display: inline-grid;
        font-size: 16px;
    }
}

@media (max-width: 800px) {
    header {
        grid-template-rows: 22px auto;
    }

    header .main-title {
        font-size: 1em;
    }

    header .sub-title {
        font-size: 0.8em;
    }

    .container .nav .c-btn {
        width: auto;
        height: 100%;
        display: inline-grid;
    }

    .content {
        grid-template-columns: 100%;
        grid-template-rows: 65% 35%;
        grid-template-areas: "svg" "result";
    }

    .content .right {
        grid-template-rows: 1fr 34px;
        font-size: 0.8em;
    }

    .svg {
        width: 100%;
    }
}


