@font-face {
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    font-family: "Orbitron";
    src: local('Orbitron'),
    url("https://www.core11.eu/fonts/orbitron/orbitron600.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-weight: 400;
    font-display: swap;
    font-family: "Orbitron";
    src: local('Orbitron'),
    url("https://www.core11.eu/fonts/orbitron/orbitron400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --max-width: calc(2 * 800px + 10px + 4px);
    --axis-artist-color: silver;
}

body {
    font-family: Helvetica, sans-serif;
    background-color: black;
    color: #eee;
    user-select: none;
}

#controls div {
    margin-bottom: 5px;
}

#pageWrap {
    max-width: var(--max-width);
    min-width: 300px;
    margin: 0 auto;
}

#commonContainer {
    display: flow-root;
}

#fallbackVideoWrap {
    display: none;
}

#fallbackVideoWrap video {
    max-width: 85%; /* Fit everything vertically too */
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
}

@media screen and (orientation:portrait) {
    #fallbackVideoWrap video {
        max-width: 100%;
    }
}

h1, h2 {
    text-align: center;
    font-family: "Orbitron", sans-serif;
    font-weight: 600;
    margin-top: 0px;
    font-size: 24px;
}

button {
    height: 25px;
    margin-bottom: 10px;
}

#logo {
    margin: 0 auto;
    width: 300px;
    display: block;
}

#headerContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center; /* Prevent stretch */
    margin-bottom: 20px;
}

#headerContactUs {
    display: flex;
    justify-content: center;
    align-items: center; /* Prevent stretch */
}


#canvasContainer {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#cameraCanvas {
    cursor: crosshair;
}

.color-picker-container, .threshold-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-label {
    display: inline-block;
    width: 115px;
}

#colorPicker {
    width: 100px;
    height: 35px;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-left: 2px; /* Use the same like the inbuilt one for the range type input */
    margin-right: 2px;
}

#colorLabels {
    display: flex;
    flex-direction: column;
    margin-bottom: 0px!important;
    text-align: left;
}

#threshold {
    width: 100px;
    border: none;
    padding: 0;
}

#colorSelectionContainer, #colorSelectionCanvas {
    width: 500px;
    height: 100px;
}

#colorSelectionContainer {
    position: relative;
}

.vl {
    border-left: 1px solid rgba(255, 255, 255, 0.3); /* Same like canvas */
    height: 100%;
    position: absolute;
    left: 50%;
    top: 0;
}

#colorSelectionCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

.transparentTitle {
    position: absolute;
    top: 0;
    margin-left: 3px;
    margin-top: 3px;
    padding: 1px;
    font: bold;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.4);
}

#r, #g, #b {
    width: 30px;
}

#info, #hint {
    text-align: center;
    font-style: italic;
    margin-bottom: 10px;
    transition: opacity 3s ease, max-height 0.1s ease 3s; /* collapse starts after fade */
    opacity: 1;
    max-height: 100px; /* It prevents to collapse while fading */
}

.hidden {
    display: none !important;
    visibility: hidden;
}

#info.hidden {
    opacity: 0;
    max-height: 0;
    visibility: hidden;
    pointer-events: none; /* Prevent issues from covering the button after collapse. */
}

#loadingCameraInfo {
    text-align: center;
    margin-bottom: 5px;
}

.ruler {
    position: absolute;
    pointer-events: none;
    z-index: 99;
}

.ruler-right {
    right: -2px;
    height: calc(100% + 0px);
    width: 3px;
    background:
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 0%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 25%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 50%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 75%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 100%/100% 1px no-repeat;
    border: solid 1px transparent; /* Use treansparent border, in order to compensate the effect of canvas border */
}

.ruler-left {
    left: calc(50% - 2px);
    height: 100%;
    width: 3px;
    background:
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 0%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 25%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 50%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 75%/100% 1px no-repeat,
        linear-gradient(var(--axis-artist-color), var(--axis-artist-color)) 0% 100%/100% 1px no-repeat;
    border: solid 1px transparent; /* Use treansparent border, in order to compensate the effect of canvas border */
}

.ruler-bottom {
    bottom: -6px;
    left: 1px;
    width: 100%;
    height: 3px;
    background:
        repeating-linear-gradient(to right,
            var(--axis-artist-color) 0, /* Tick mark color */
            var(--axis-artist-color) 1px, /* Tick thickness */
            transparent 1px,
            transparent calc(100% / 8) /* Space between ticks */
        ),
        linear-gradient(to right, var(--axis-artist-color), var(--axis-artist-color)) 100% 0%/1px 100% no-repeat;
}

.axis-title {
    position: absolute;
    color: var(--axis-artist-color);
    font-size: 0.9em;
    z-index: 99;
    pointer-events: none;
    padding: 1px;
    margin: 1px;
    /* background: rgba(0, 0, 0, 0.3); */
}

.axis-title-bottom-left {
    bottom:calc(0% - 6px);
    left: calc(0% + 2px);
}

.axis-title-bottom-right {
    bottom:calc(0% - 6px);
    left: calc(50% + 2px);
}

.axis-title-left {
    top: calc(0% + 0px);
    left: calc(50% - 5px);
    transform: translateX(-100%);
}

.axis-title-right {
    top:0%;
    left: calc(100% - 1px);
    transform: translateX(-100%);
}

.tick-label {
    position: absolute;
    font-size: 0.7em;
    color: var(--axis-artist-color);
    z-index: 99;
    pointer-events: none; /* Don't interfere with clicks/drags */
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 1px;
    /* background: rgba(0, 0, 0, 0.3); */
}

.tick-label-horizontal {
    transform: translateX(-50%);
    bottom: 1px;
}

.tick-label-vertical {
    transform: translateX(-100%) translateY(50%);
}


@media (width <= 800px) {

    #logo {
        width: 150px;
        display: inline;
    }

    h1, h2 {
        font-size: 18px;
    }

    #headerContainer {
        justify-content: space-between;
    }

    #colorSelectionContainer, #colorSelectionCanvas {
        width: 100%;
    }

    #controls div {
        margin-bottom: 5px;
    }

    #r, #g, #b {
        width: 100px;
        margin-bottom: 40px;
    }

    button {
        width: 100%;
    }

    .titleAndCanvasContainer {
        width: 48%;
    }
}

#controls {
    margin-bottom: 10px;
}

a {
    color: #eee;
}

ul {
    list-style-type: square;
}

#resoucesCollapsible {
    margin-top: 30px;
    color: #999;
}

#resoucesCollapsible:hover {
    color: #eee;
}

#runtimeInfo {
    visibility: collapse;
}

#footer {
    margin-top: 40px;
}

#compatibilityInfo {
    visibility: hidden;
    color: red;
    font-weight: bold;
    font-size: 20px;
    text-align: center;
    margin-bottom: 10px;
}

