/* Copyright: Ankitects Pty Ltd and contributors
 * License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */

@use "sass/vars";

hr {
    background-color: vars.palette(darkgray, 0);
}

body {
    margin: 20px;
    overflow-wrap: break-word;
    // default background setting to fit with toolbar
    background-size: cover;
    background-repeat: no-repeat;
    background-position: top;
    background-attachment: fixed;
}

// explicit nightMode definition required
// to override default .card styling
body.nightMode {
    background-color: var(--canvas);
    color: var(--fg);
}

img {
    max-width: 100%;
    max-height: 95vh;
}

li {
    text-align: start;
}

#_flag {
    position: fixed;
    [dir="ltr"] & {
        right: 10px;
    }
    [dir="rtl"] & {
        left: 10px;
    }
    top: 0;
    font-size: 30px;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: black;
}

#_mark {
    position: fixed;
    [dir="ltr"] & {
        left: 10px;
    }
    [dir="rtl"] & {
        right: 10px;
    }
    top: 0;
    font-size: 30px;
    color: yellow;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: black;
}

#typeans {
    width: 100%;
    // https://anki.tenderapp.com/discussions/beta-testing/1854-using-margin-auto-causes-horizontal-scrollbar-on-typesomething
    box-sizing: border-box;
}

code#typeans {
    white-space: pre-wrap;
}

.typeGood {
    background: #afa;
    color: black;
}

.typeBad {
    color: black;
    background: #faa;
}

.typeMissed {
    color: black;
    background: #ccc;
}

button {
    margin: 1em 0.5em;
}

.replay-button {
    text-decoration: none;
    display: inline-flex;
    vertical-align: middle;
    margin: 3px;

    svg {
        width: 40px;
        height: 40px;

        circle {
            fill: #fff;
            stroke: #414141;
        }

        path {
            fill: #414141;
        }
    }
}

.nightMode {
    .latex {
        filter: invert(100%);
    }
}

.drawing {
    zoom: 50%;
}
.nightMode img.drawing {
    filter: unquote("invert(1) hue-rotate(180deg)");
}

.editor {
    // border: solid 1px #dadada;
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    letter-spacing: normal;
    line-height: 20px;
    resize: none !important;
    tab-size: 4;

    .hljs {
        padding: 10px;
    }
}


.hljs {
    .passed {
        color: #38c172;
    }

    .failed {
        color: #e3342f;
    }
}

.error {
    color: #e3342f;
}

#test-panel {
    margin: 0 auto;
    box-sizing: border-box;
}

button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.inner {
    text-align: right;
    margin-bottom: 10px;
}

.inner button {
    margin: 0;
    display: inline;
    overflow: hidden;
    line-height: 18px;
}

.inner button.run {
    padding-right: 18px;
    position: relative;
}

.inner button.run .icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #38c172;
}

.inner button.stop {
    padding-right: 18px;
    position: relative;
}

.inner button.stop .icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #e3342f;
}

.inner button.run.disabled .icon {
    border-color: #a0a0a0;
}

.inner button.stop.disabled .icon {
    background-color: #a0a0a0;
}

#codeans {
    height:60vh !important;
    overflow: scroll;
    text-align:left;
}

#progressbar {
    width: 100%;
    padding: 0;
    height: 5px;
    overflow: hidden;
    padding: 0 1px 0 1px;
    display: block;
    box-sizing: border-box;
}

#progressbar .inner-therm, #progressbar .outer-therm {
    box-sizing: border-box;
    border-radius: 0 !important;
}

#progressbar .outer-therm {
    margin: 0 !important;
}

#log {
    height:20vh;
    margin-top: 10px;
    padding-bottom: 10px;
}