/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by
 * the Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 * 
 */

@font-face {
	font-family: "Roboto";
	font-style: normal;
	src: local("Roboto Regular"), url("/public/fonts/roboto-regular.woff2") format("woff2");
}

@font-face {
	font-family: "Roboto";
	font-style: italic;
	src: local("Roboto Italic"), url("/public/fonts/roboto-italic.woff2") format("woff2");
}

@font-face {
	font-family: "Roboto Mono";
	font-style: normal;
	src: local("Roboto Mono Regular"), url("/public/fonts/roboto-mono-regular.woff2") format("woff2");
}

html, body {
	font-family: "Roboto", sans-serif;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

h1 {
	margin-top: 0;
	font-weight: normal;
}

embed {
	width: 100%;
	height: 100vh;
}

/* First-level container */

#split {
	display: block;
	min-height: 100vh;
}

/* Query panel */

#request {
	position: fixed;
	padding: 2em;
	background-color: rgba(0, 0, 0, 0.9);
	color: white;
	margin-left: -27em;
	width: 25em;
	height: 100vh;
	overflow-y: auto;
	z-index: 2;
}

#request-open:checked + #request {
	margin-left: 0;
}

#request-open:not(:checked) + #request > #request-open-label {
	display: block;
}

#request-open {
	display: none;
}

#request-open-label {
	display: none ;
	margin-right: -1.4em;
}

#request-reduce-label {
	display: block;
}

#request-reduce-label,
#request-open-label {
	vertical-align: middle;
	text-align: right;
}

#request-reduce-label img,
#request-open-label img {
	vertical-align: middle;
}

#response {
	position: relative;
	flex-grow: 1;
	height: 100vh;
	margin-left: 2em;
	overflow: scroll;
}

#logo {
	display: none;
	max-width: 75%;
}

#query {
	margin: 1em 0 0 0;
	height: 20em;
	width: calc(100% - 2em);
	border: 1px solid lightgrey;
	border-bottom-color: white;
	border-top-left-radius: 1em;
	border-top-right-radius: 1em;
	padding: 1em;
	font-family: "Roboto Mono", monospace;
	font-size: small;
	resize: none;
}

#query:not([data-query-hash = '782dbad30f7a775131e2e73cc63cd4959cfd2da4']) + div #control-media-container {
	display: none;
}

#result-format-label {
	width: 100%;
	border-left: 1px solid lightgrey;
	border-right: 1px solid lightgrey;
	background-color: white;
	color: grey;
	padding: 1em 0;
	text-align: center;
	font-size: small;
	font-style: italic;
}

/* Controls */

#controls {
	display: flex;
	width: calc(100% + 1px);
}

#controls > * {
	flex: 1;
}

#controls input[type="radio"] {
	display: none;
}

#controls input[type="radio"] + label {
	display: block;
	background-color: #f4f4f4;
	border-left: 1px solid lightgrey;
	border-right: 1px solid lightgrey;
	border-bottom: 1px solid lightgrey;
	color: grey;
	text-align: center;
	padding: 1em 0;
}

#controls input[type="radio"]:checked + label {
	background-color: #cccccc;
	color: black;
}

#controls input[type="radio"]:disabled + label {
	background-color: #e0e0e0;
}

#controls > *:nth-child(1) input[type="radio"] + label {
	border-bottom-left-radius: 1em;
}

#controls > *:last-child input[type="radio"] + label {
	border-bottom-right-radius: 1em;
}

#send {
	display: block;
	width: 100%;
	background-color: #3870aa;
	color: white;
	border: none;
	border-radius: 1.3em;
	margin-top: 1em;
	padding: 1em 0;
}

/* Request waiting bar */

#status {
	display: none;
	position: absolute;
	font-weight: bold;
	font-size: x-small;
	width: 40%;
	background-image: repeating-linear-gradient(-44.2deg, #6c6c6c, #6c6c6c 20px, #df6280 20px, #df6280 40px);
	animation: wait linear 0.5s infinite;
	
	color: white;
	padding: 0.5em 1em;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-radius: 1em;
}

#status.working {
	display: block;
}

/* Result panel */

#result {
	min-height: 100vh;
	z-index: 0;
}

#result-grid {
	display: grid;
	gap: 1px 1px;
	background-color: lightgray;
}

#result-grid > * {
	background-color: white;
	padding: 0.5em 1em;
}

#result-grid > .header {
	font-weight: bold;
	text-align: center;
}

@keyframes wait {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 59px 0px;
  }
}

/* Desktop */
@media only screen and (min-width: 64rem) {
	#split {
		display: flex;
	}
	
	#request {
		position: static;
		margin-left: 0;
		flex-shrink: 0;
		background-color: black;
	}
	
	#response {
		margin-left: 0;
	}
	
	#request-open-label {
		display: none !important;
	}
	
	#request-reduce-label {
		display: none;
	}
	
	#logo {
		display: block;
	}
}
