:root {
    --sans-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, "Nimbus Sans L", Roboto, Noto, "Segoe UI", Arial, Helvetica, "Helvetica Neue", sans-serif;
    --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    --bg: #fff;
    --accent-bg: #f5f7ff;
    --text: #212121;
    --text-light: #585858;
    --border: #d8dae1;
    --accent: #0d47a1;
    --code: #d81b60;
    --preformatted: #444;
    --marked: #ffdd33;
    --disabled: #efefef
}

@media (prefers-color-scheme:dark) {
    :root {
        --bg: #212121;
        --accent-bg: #2b2b2b;
        --text: #dcdcdc;
        --text-light: #ababab;
        --border: #666;
        --accent: #ffb300;
        --code: #f06292;
        --preformatted: #ccc;
        --disabled: #111
    }
}

html {
    font-family: var(--sans-font);
    scroll-behavior: smooth
}

body {
    color: var(--text);
    background: var(--bg);
    font-size: 1rem;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

header {
    background: var(--accent-bg);
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 0 .5rem .5rem .5rem;
    box-sizing: border-box;
}

header h1 {
    max-width: 1200px;
    margin: 1rem auto
}

header p {
    max-width: 40rem;
    margin: 1rem auto
}

main {
    padding-top: 1.5rem
}

footer {
    margin-top: 4rem;
    padding: 2rem 0rem 1.5rem 0rem;
    color: var(--text-light);
    font-size: .8rem;
    text-align: center;
    border-top: 1px solid var(--border)
}

footer a,
footer a:visited {
    color: var(--text-light);
}

h1 {
    font-size: 3rem
}

p.reason {
    color: var(--accent);
    margin: 0;
}

h2 {
    font-size: 2.6rem;
    margin-top: 3rem
}

h3 {
    font-size: 2rem;
    margin-top: 3rem
}

h4 {
    font-size: 1.44rem;
    margin-bottom: 0;
}

h5 {
    font-size: 1.15rem
}

h6 {
    font-size: .96rem
}

h1,
h2,
h3 {
    line-height: 1.1
}

@media only screen and (max-width:720px) {
    h1 {
        font-size: 2.5rem
    }

    h2 {
        font-size: 2.1rem
    }

    h3 {
        font-size: 1.75rem
    }

    h4 {
        font-size: 1.25rem
    }
}

div.teaserimg {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
    text-align: center;
}

@media (max-width: 1200px) {
    div.teaserimg {
        width: 100%;
    }
}

table.logotable {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1200px) {
    table.logotable {
        width: 70%;
    }
}

a,
a:visited {
    color: var(--accent)
}

a:hover {
    text-decoration: none
}

[role=button],
a button,
button,
input[type=button],
input[type=reset],
input[type=submit] {
    border: none;
    border-radius: 5px;
    background: var(--accent);
    font-size: 1rem;
    color: var(--bg);
    padding: .7rem .9rem;
    margin: .5rem 0
}

[role=button][aria-disabled=true],
a button[disabled],
button[disabled],
input[type=button][disabled],
input[type=checkbox][disabled],
input[type=radio][disabled],
input[type=reset][disabled],
input[type=submit][disabled],
select[disabled] {
    cursor: default;
    opacity: .5;
    cursor: not-allowed
}

input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    background-color: var(--disabled)
}

input[type=range] {
    padding: 0
}

abbr {
    cursor: help
}

[role=button]:focus,
[role=button]:not([aria-disabled=true]):hover,
button:enabled:hover,
button:focus,
input[type=button]:enabled:hover,
input[type=button]:focus,
input[type=reset]:enabled:hover,
input[type=reset]:focus,
input[type=submit]:enabled:hover,
input[type=submit]:focus {
    filter: brightness(1.4);
    cursor: pointer
}

nav {
    font-size: 1rem;
    line-height: 2;
    padding: 0.5rem 0
}

nav a,
nav a:visited {
    margin: 0 1rem 0 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    display: inline-block;
    padding: .1rem 1rem;
    text-decoration: none
}

nav a.current {
    color: var(--accent);
    border-color: var(--accent)
}

nav a:hover {
    color: var(--accent);
    border-color: var(--accent)
}

@media only screen and (max-width:750px) {
    nav a {
        border: none;
        padding: 0;
        color: var(--accent);
        text-decoration: underline;
        line-height: 1
    }
}

details {
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    margin-bottom: 1rem
}

summary {
    cursor: pointer;
    font-weight: 700;
    padding: .6rem 1rem
}

details[open] {
    padding: .6rem 1rem .75rem 1rem
}

details[open] summary {
    margin-bottom: .5rem;
    padding: 0
}

details[open]>:last-child {
    margin-bottom: 0
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0
}

div.startbutton {
    border: 1px solid var(--border);
    border-radius: 5px;
    margin-right: 1%;
    margin-bottom: 1%;
    width: 110px;
    float: left;
}

div.startbutton:hover {
    border-color: var(--accent)
}

div.startbutton h1 {
    margin: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
    text-align: center;
}

div.startbutton p {
    margin: 0;
    padding-bottom: 1rem;
    text-align: center;
}

div.startbutton a,
div.startbutton a:visited {
    color: var(--text);
    text-decoration: none;
}

div.startbutton a:hover {
    color: var(--accent);
}

div.namebox {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


a.codebutton,
a.codebutton:visited {
    margin: 0 0 0 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    padding-left: 0.2em;
    padding-right: 0.2em;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    text-decoration: none;
    line-height: 1;
    font-size: 0.9rem;
}

a.codebutton:hover {
    border-color: var(--accent);
    color: var(--accent);
}

td,
th {
    border: 1px solid var(--border);
    text-align: left;
    padding: .4rem;
    white-space: nowrap;
}

th.leftbig,
td.leftbig {
    border-left-width: 3px
}

td.num {
    padding-top: .4rem;
    padding-bottom: .4rem;
    padding-left: 1.6rem;
    padding-right: 1.6rem;
    text-align: center;
}

th {
    background: var(--accent-bg);
    font-weight: 700;
    font-style: italic;
}

th.clickable {
    padding: 0;
    white-space: nowrap;
    text-align: center;
}

th.clickable:hover {
    background: var(--bg);
}

th.clickable a {
    padding: .4rem;
    display: block;
    text-decoration: none;
    color: var(--text);
}

td.citation {
    border: none;
    font-size: 0.7rem;
    padding-top: 0;
    padding-bottom: .1rem;
    padding-left: 0.4rem;
}

td.noborder {
    border: none;
}

table.noborder td,
table.noborder th {
    border: none;
    background: none;
}

/* tr:nth-child(even) {
    background: var(--accent-bg)
} */

table caption {
    font-weight: 700;
    margin-bottom: .5rem
}

input,
select,
textarea {
    font-size: inherit;
    font-family: inherit;
    padding: .5rem;
    margin-bottom: .5rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    box-shadow: none;
    box-sizing: border-box;
    width: 100%;
    width: -moz-available;
    /* For Mozzila */
    width: -webkit-fill-available;
    /* For Chrome */
    width: stretch;
    /* Unprefixed */
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none
}

select {
    background-image: linear-gradient(45deg, transparent 49%, var(--text) 51%), linear-gradient(135deg, var(--text) 51%, transparent 49%);
    background-position: calc(100% - 20px), calc(100% - 15px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat
}

select[multiple] {
    background-image: none !important
}

input[type=checkbox],
input[type=radio] {
    vertical-align: bottom;
    position: relative
}

input[type=radio] {
    border-radius: 100%
}

input[type=checkbox]:checked,
input[type=radio]:checked {
    background: var(--accent)
}

input[type=checkbox]:checked::after {
    content: " ";
    width: .1em;
    height: .25em;
    border-radius: 0;
    position: absolute;
    top: .05em;
    left: .18em;
    background: 0 0;
    border-right: solid var(--bg) .08em;
    border-bottom: solid var(--bg) .08em;
    font-size: 1.8em;
    transform: rotate(45deg)
}

input[type=radio]:checked::after {
    content: " ";
    width: .25em;
    height: .25em;
    border-radius: 100%;
    position: absolute;
    top: .125em;
    background: var(--bg);
    left: .125em;
    font-size: 32px
}

@media only screen and (max-width:720px) {

    input,
    select,
    textarea {
        width: 100%
    }
}

input[type=checkbox],
input[type=radio] {
    width: auto
}

input[type=file] {
    border: 0
}

hr {
    color: var(--border);
    border-top: 1px;
    margin: 1rem auto
}

mark {
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--marked)
}

main img,
main video {
    max-width: 100%;
    height: auto;
    border-radius: 5px
}

img.resultimg {
    width: 95%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

figure {
    margin: 0
}

figcaption {
    font-size: .9rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1rem
}

blockquote {
    margin: 2rem 0 2rem 2rem;
    padding: .4rem .8rem;
    border-left: .35rem solid var(--accent);
    color: var(--text-light);
    font-style: italic
}

cite {
    font-size: .9rem;
    color: var(--text-light);
    font-style: normal
}

code,
kbd,
pre,
pre span,
samp {
    /* font-size: 1.075rem; */
    font-family: var(--mono-font);
    color: var(--text-light)
}

kbd {
    color: var(--preformatted);
    border: 1px solid var(--preformatted);
    border-bottom: 3px solid var(--preformatted);
    border-radius: 5px;
    padding: .1rem
}

pre {
    padding: 1rem 1.4rem;
    max-width: 100%;
    overflow: auto;
    overflow-x: auto;
    color: var(--preformatted);
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: 5px
}

pre code {
    color: var(--preformatted);
    background: 0 0;
    margin: 0;
    padding: 0
}

/* Make the logout button look like a link */
.inline {
    display: inline;
}

.link-button {
    background: none !important;
    border: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    padding: 0em;
    margin: 0em;
    text-align: center;
}

.link-button:hover {
    color: var(--accent) !important;
    filter: none !important;
    text-decoration: none;
}

/* Make form errors RED */
.errorlist {
    color: red;
}

/* Mark required fields in forms */
.required label::after {
    content: ' *';
    color: red;
}

/* Force captcha to be full width */
input[id^='id_captcha'] {
    width: auto;
}

form {
    display: flex;
    margin: auto;
    flex-direction: column;
    align-items: center;
    width: fit-content;
}

/* Delete button  */
button.btn-danger {
    background-color: #dc3545;
}

button.btn-danger:hover {
    background-color: #c82333 !important;
    filter: none
}

/* For image comparison sliders  */
.before figcaption,
.after figcaption {
    background: #fff;
    border: 1px solid #c0c0c0;
    border-radius: 12px;
    color: #2e3452;
    opacity: 0.8;
    padding: 12px;
    position: absolute;
    bottom: -24px;
    transform: translateY(-50%);
    line-height: 100%;
}

.before figcaption {
    left: 12px;
}

.after figcaption {
    right: 12px;
}

.auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    margin: auto;
    gap: 2%;
}

img-comparison-slider>figure>img {
    aspect-ratio: 1;
    object-fit: contain;
    width: 100%;
}

img-comparison-slider {
    display: flex;
}

/* For upload pbar */
progress {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

span.inline-code {
    background: #ddd;
    border-radius: 4px;
    font-family: monospace;
    padding: 0 4px;
    white-space: nowrap;
}

@media (prefers-color-scheme:dark) {
    span.inline-code {
        background: #484848;
    }
}

/* Make rows comparable */
.selected-row {
    background-color: #ececec;
    font-weight: bold;
}

@media (prefers-color-scheme:dark) {
    .selected-row {
        background-color: #484848;
    }
}
