[data-theme=light],
:root:not([data-theme=dark]) {
	--primary: #002484;
}
footer:[data-theme=light],
footer:not([data-theme=dark]) {
	background: #eee;
}

@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme]) {
	--primary: #002484;
}
footer:not([data-theme]) {
	background: #121215;
}
}

:root {
	--block-spacing-vertical: 20px !important;
}

@media (max-height: 500px) {
  body > footer, body > header, body > main, section {
    --block-spacing-vertical: calc(var(--spacing) * 0.5);
  }
}

body {
	min-height: 100vh;
	display: flex;
	flex-flow: column nowrap;
	justify-content: space-between;
}

body > header {
	background: #002484;
	--primary: white;
}

header #logo {
	display: block;
	height: 40px;
	width: 112px;
	margin: 0;
	background:url('tno.svg')
}

header #logo[aria-busy] {
	background:none;
}

header nav  {
	align-items: center;
}

header nav h2 {
	color: var(--primary-inverse);
	font-size: 1.4rem;
	margin: 0;
	padding: 0;
}

main {
	/* min-height: calc(100vh - 460px); */
	min-height: 100px;
	flex-grow: 1;
}

article {
	transition: opacity 300ms ease-in-out;
}

fieldset {
	padding: 0.5rem;
	border-radius:var(--border-radius);
	margin-bottom: 0.5rem;
	border: 1px solid var(--form-element-border-color);
}

article.htmx-swapping {
	opacity: 0;
	transition: opacity 1s ease-out;
}

article.htmx-added {
	opacity: 0;
}

/* Hide numberinput on webkit */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide numberinput arrows on Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

input:invalid {
	border: 1px solid red;
}
input[type=file]:invalid {
	border: none;
}

button.done {
	background:green;
}

button.delete, a.delete {
	background:maroon;
	opacity: 1;
}


#result {
	display:none;
}

* {
	opacity: 1;
}

.fading {
	opacity: 0;
	transition: opacity 1s ease-out;
	position: absolute;
}

/* Info modal */
.relative {
	position: relative;
}

.info {
	width: unset;
	position: absolute;
	right: 0;
	top: 0;
	padding: 0 0.5rem;
	height: 3rem;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.info.attention {
	background: var(--primary-hover);
}

/* Editable h1 */
.editable-title {
	position: relative;
}

.editable-title #name {
	margin: 0;
	border: 0;
	font-size: var(--font-size);
	height: 60px;
}

.editable-title #name ~ button {
	position: absolute;
	z-index: 99;
	width: auto;
	height: 60px;
	right: 0;
	top: 0;
	border: 0;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

#graph-container {
	width: 100%;
	margin: 0 auto;
	height: 480px;
	position: relative;
}

#other-graphs {
	position: relative;
	width:100%;
}

.graph-container {
	max-height: 80vh;
	height: 420px;
	position: relative;
}

video {
	width: 100%;
}

#videofile {
	padding: 1rem;
}

#videofile::file-selector-button {
	display:none;
}


.hide {
	display: none;
}

#video-container {
	position: relative;
}

#video-controls {
	position: relative;
	margin-top:3rem;
}

#video-controls progress {
	height: 2rem;
	margin: 0;
	vertical-align:unset;
	--progress-color:rgba(0,0,0,0.6);
	background: #ddf;
}

#video-controls #frames {
	display: flex;
	height: 2rem;
	width: 100%;
	position: absolute;
	top: 0;
	flex-flow: row nowrap;
}

#uuid, #frameForm input, #templateForm input{
	display:none;
}

#frames .drag-handle {
	height: calc(2rem + 60px);
	width: calc(2rem + 60px);
	border: 30px solid transparent;
	top: -30px;
	background-clip: padding-box;
	position: absolute;
	border-radius:0.5rem;
	background-color: #e8da49;
	/*border: 2px solid #978c1d;*/
	z-index:99;
	background-repeat: no-repeat;
	background-size: 1.5rem;
	background-position: 50% 50%;
}

#frames #start {
	left: -30px;
	background-image:url('prev.svg');
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

#frames #end {
	right: -30px;
	background-image:url('next.svg');
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

#frames #tail {
	height: 2rem;
	position: absolute;
	width: 0;
	left: 100vw;
	background: rgba(0,0,0,0.6);
	z-index:0;
}

#template {
	position: absolute;
	top: 0;
}

#template .point {
	width:50px;
	height:50px;
	border-radius: 1rem;
	background-color: red;
	opacity: 0.5;
	background-clip: padding-box;
	border:15px transparent solid;
	position: absolute;
	z-index:999;
}

#template #point-one {
	top: -25px;
	left: -25px;
}

#template #point-two {
	bottom: -25px;
	right: -25px;
}

#video-container {
	position: relative;
}
#video-container #template-follow {
	position: absolute;
	top: 0;
}

#measure-container {
	position:relative;
}

#measure-canvas-container {
	position:absolute;
}
#measure-container .point {
	width: 50px;
	height: 50px;
	border:20px transparent solid;
	background-clip: padding-box;
	background-color:green;
	position: absolute;
	z-index:999;
}

#measure-container #measure-point-one {
	left: 10px;
	top: 10px;
}

#measure-container #measure-point-two {
	right: 10px;
	top: 10px;
}
