body, html {
	width: 100vw;
	margin: 0;
	text-align: center;
	font-family: "Noto Serif", "Droid Serif", serif;
	color: hsl(0, 0%, 90%);
	background: hsl(0, 0%, 15%);
}

h1 {
	width: fit-content;
	text-align: left;
	margin: 0;
	text-shadow: 0 0 5px rgba(0, 0, 0, 1);
}

section {
	width: 50%;
	min-width: 620px;
	box-sizing: border-box;
	margin: 0 auto;
	padding: 10px;
	border-radius: 10px;
	background: hsl(0, 0%, 20%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

input {
	margin: 5px;
	padding: 3px;
	color: hsl(0, 0%, 90%);
	font-size: 15px;
	font-family: monospace;
	text-align: center;
	text-shadow: 0 0 3px hsl(0, 0%, 0%);
	border-radius: 3px;
	box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
	background: hsl(0, 0%, 22.5%);
	border: 1px solid hsl(0, 0%, 15%);
}

input:focus {
	outline: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

button {
	color: hsl(0, 0%, 90%);
	font-size: 15px;
	font-family: "Noto Serif", "Droid Serif", serif;
	font-weight: bold;
	text-shadow: 0 0 3px hsl(0, 0%, 5%);
	margin: 5px 0;
	background: hsl(0, 0%, 22.5%);
	border: none;
	border-radius: 5px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
	transition: background 0.3s;
}

button:hover {
	background: hsl(0, 0%, 35%);
	cursor: pointer;
}

button:active {
	box-shadow: none;
}

pre {
	text-align: left;
	color: hsl(0, 0%, 90%);
	text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
	white-space: pre-wrap;
	background: #0000;
	padding: 10px;
}

textarea {
	color: hsl(0, 0%, 90%);
	font-family: sans-serif;
	box-sizing: border-box;
	padding: 10px;
	white-space: nowrap;
	border: none;
	background: #0000;
}

textarea:focus {
	outline: none;
}

dialog {
	color: hsl(0, 0%, 90%);
	padding: 10px;
	border: none;
	border-radius: 10px;
	background: hsl(0, 0%, 22.5%);
	box-shadow: 0 0 10px hsl(0, 0%, 5%);
}

dialog::backdrop {
	background: rgba(0, 0, 0, 0.2);
}

dialog h1 {
	font-size: 30px;
}

dialog button {
	background: hsl(0, 0%, 27.5%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
	outline: none;
}

dialog button:hover {
	background: hsl(0, 0%, 37.5%);
}

a {
	color: #8abfff;
}

table {
	font-family: monospace;
	text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
	border: 1px solid hsl(0, 0%, 90%);
	border-collapse: collapse;
	border-spacing: 0;
}

th, td {
	font-size: 15px;
	padding: 3px 10px;
	border: 1px solid hsl(0, 0%, 90%);
}

/* map */
#map-page {
	position: absolute;
	height: calc(100vh - 60px);
}

/* hidden class is because the map breaks if I set display: none (idk why) */
.hidden {
	opacity: 0;
	pointer-events: none;
}

#map {
	width: 100vw;
	height: 100%;
	z-index: 0;
}

.leaflet-layer {
	transition: filter 0.5s;
}

.leaflet-container {
	background: #000 !important;
	transition: background 0.5s;
}

path.leaflet-interactive {
	outline: none;
}

.leaflet-control-zoom-out,
.leaflet-control-zoom-in,
.leaflet-control-zoom-fullscreen.leaflet-fullscreen-icon {
	filter: invert(100%) contrast(50%);
	transition: filter 0.5s;
}

.leaflet-marker-icon.dark {
	filter: invert(100%) brightness(25000%);
	transition: filter 1.4s;
}

.leaflet-marker-icon.light {
	filter: none;
	transition: filter 0.2s;
}

#open-map-settings {
	position: fixed;
	top: 10px;
	right: 10px;
	margin: 0;
	padding: 5px;
}

#map-settings {
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	width: 400px;
	max-width: 90vw;
	height: calc(100vh - 60px);
	border-radius: 0;
	background: hsl(0, 0%, 15%);
	z-index: 2;
	overflow: auto;
}

#map-settings-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0 10px;
}

#map-settings-header > h1 {
	font-size: 40px;
}

#map-settings > section {
	background: hsl(0, 0%, 20%);
	width: calc(100% - 20px);
	min-width: 0;
	margin: 10px;
}

.map-setting {
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: hsl(0, 0%, 90%);
	font-family: monospace;
	font-size: 16px;
	text-align: left;
	text-shadow: 0 0 3px #000;
	margin: 10px 0;
}

.map-setting > h1 {
	margin-bottom: 10px;
}

.slider-checkbox {
	display: none;
}

.slider-label {
	height: 20px;
	aspect-ratio: 2;
	display: inline-block;
	margin-left: 5px;
	cursor: pointer;
	background: #c00;
	border-radius: 20px;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
	transition: background 0.35s;
}

.slider-label::before {
	content: "";
	display: block;
	height: 20px;
	aspect-ratio: 1;
	background: hsl(0, 0%, 90%);
	border-radius: 50%;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
	transition: transform 0.35s;
}

#map-theme-slider {
	background: hsl(0, 0%, 30%);
}

#map-theme:checked + #map-theme-slider {
	background: hsl(0, 0%, 80%);
}
#map-theme:checked + #map-theme-slider::before {
	transform: translateX(20px);
}

#map-scale:checked + #map-scale-slider {
	background: #0a0;
}
#map-scale:checked + #map-scale-slider::before {
	transform: translateX(20px);
}

#map-layer {
	padding: 3px;
	color: hsl(0, 0%, 90%);
	font-size: 15px;
	font-family: monospace;
	text-align: center;
	text-shadow: 0 0 3px hsl(0, 0%, 0%);
	border-radius: 3px;
	box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
	background: hsl(0, 0%, 22.5%);
	border: 1px solid hsl(0, 0%, 15%);
}

#map-layer:focus {
	outline: none;
}

#transmitter-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#transmitter-status {
	width: 15px;
	aspect-ratio: 1;
	background: #c00;
	box-shadow: 0 0 10px #c00;
	border-radius: 50%;
}

#transmitter-setup {
	display: block;
	text-align: left;
	font-size: 15px;
	font-family: monospace;
	text-shadow: 0 0 3px #000;
	margin-bottom: 30px;
	overflow-x: auto;
}

#transmitter-server-url-label {
	margin-right: 3px;
}

#transmitter-full-url {
	display: flex;
	justify-content: end;
	align-items: center;
	gap: 5px;
}

#transmitter-server {
	width: 100%;
	flex: 1;
	margin: 0;
}

#transmitter-endpoint {
	font-size: 12px;
}

#save-transmitter-server, #reset-transmitter-server, #transmitter-start-tracking, #transmitter-stop-tracking {
	flex: 1;
	margin: 0 5px;
}

#transmitter-callsign-container {
	gap: 5px;
	margin-top: 30px;
}

#transmitter-callsign {
	width: 100%;
	flex: 1;
	margin: 0;
}

#transmitter-trails-container {
	margin-top: 40px;
}

#transmitter-trails:checked + #transmitter-trails-slider {
	background: #0a0;
}
#transmitter-trails:checked + #transmitter-trails-slider::before {
	transform: translateX(20px);
}

#transmitter-data-table-checkbox:checked + #transmitter-data-table-checkbox-slider {
	background: #0a0;
}
#transmitter-data-table-checkbox:checked + #transmitter-data-table-checkbox-slider::before {
	transform: translateX(20px);
}

#transmitter-data {
	position: fixed;
	left: 0;
	bottom: 90px;
	display: none;
	justify-content: center;
	width: calc(100% - 60px);
	margin: 0 30px;
	padding: 5px;
	z-index: 1;
}

#transmitter-data-container {
	width: fit-content;
	border-radius: 10px;
}

.table-container {
	padding: 15px;
	overflow: auto;
}

.table-container > table {
	width: 100%;
}

/* briefing */
#briefing {
	display: block;
	padding: 10px;
	height: calc(100vh - 60px);
	box-sizing: border-box;
	overflow-y: auto;
}

.float {
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
	border-radius: 5px;
	background: hsl(0, 0%, 22.5%);
}

#flight-info, #flight-plan-metars, #search-metar {
	font-size: 15px;
	line-height: 20px;
}

#clock {
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: hsl(0, 0%, 90%);
	font-family: monospace;
	font-size: 0;
	text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.clock {
	width: 100%;
	vertical-align: middle;
	padding: 2px;
	margin: 5px;
	font-size: 15px;
	line-height: 20px;
	white-space: pre-wrap;
	text-shadow: 0 0 3px hsl(0, 0%, 0%);
}

#c2, #c3 {
	display: none;
}

#ofp-flex-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#ofp-text-size-buttons {
	display: inline;
	filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

#ofp-text-increase {
	width: 30px;
	margin: 0;
	border-top-right-radius: 1px;
	border-bottom-right-radius: 1px;
	box-shadow: none;
}

#ofp-text-decrease {
	width: 30px;
	margin: 0;
	margin-right: 10px;
	border-top-left-radius: 1px;
	border-bottom-left-radius: 1px;
	box-shadow: none;
}

#ofp-container {
	height: 500px;
	overflow-y: auto;
	background: hsl(0, 0%, 20%);
	border-radius: 5px;
}

#ofp-text {
	width: fit-content;
	margin: 20px auto;
	text-align: left;
	padding: 0;
}

#decode-checkbox:checked + #decode-checkbox-slider {
	background: #0a0;
}
#decode-checkbox:checked + #decode-checkbox-slider::before {
	transform: translateX(20px);
}

#decode {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	color: hsl(0, 0%, 90%);
	font-family: monospace;
	font-size: 15px;
	text-shadow: 0 0 3px #000;
}

.metar {
	box-sizing: border-box;
	margin: 10px 0;
	padding: 10px;
}

#search-metar-icao {
	width: 100px;
	text-transform: uppercase;
}

/* scratchpad */
#scratchpad {
	display: none;
	height: calc(100vh - 60px);
}

#canvas {
	position: absolute;
	top: 60px;
	left: 0;
	z-index: 1;
	width: 100%;
	height: calc(100% - 120px);
	background: #0000;
}

#type-template {
	display: none;
	margin: 60px 0;
	font-size: 20px;
	width: 100%;
	height: calc(100% - 60px);
	overflow: auto;
	resize: none;
}

#craft-template {
	display: none;
	grid-template-columns: 100px 1fr;
	grid-template-rows: repeat(5, 1fr);
	margin: 60px 0;
	width: 100%;
	height: calc(100% - 60px);
}

.input-toggle {
	position: absolute;
	box-sizing: border-box;
	z-index: 2;
	padding: 10px;
	margin: 0;
	height: 40px;
	aspect-ratio: 1;
	top: 70px;
	right: 10px;
	background: hsl(0, 0%, 25%);
}

.input-toggle:active {
	box-shadow: none;
}

.input-toggle img {
	height: 100%;
}

.craft-letter {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 60px;
	width: 100%;
	text-shadow: 0 0 3px hsl(0, 0%, 0%);
	background: hsl(0, 0%, 20%);
}

.craft-input {
	display: flex;
	box-sizing: border-box;
	align-items: center;
	font-family: sans-serif;
	font-size: 40px;
	text-align: left;
	text-transform: uppercase;
	padding: 10px;
	overflow-x: auto;
}

.craft-input:focus {
	outline: none;
}

#atis-template {
	display: none;
	grid-template-columns: 1fr;
	grid-template-rows: repeat(3, 1fr) 2fr;
	width: 100%;
	height: calc(100% - 60px);
	margin: 60px 0;
}

.atis-row {
	display: grid;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

#atis-row-1 {
	grid-template-columns: 3fr 1fr 3fr;
	grid-template-rows: 1fr;
}

#atis-row-2 {
	grid-template-columns: 5fr 2fr 5fr;
	grid-template-rows: 1fr;
}

#atis-row-3 {
	grid-template-columns: 2fr 2fr 2fr 4fr;
	grid-template-rows: 1fr;
}

#atis-row-4 {
	grid-template-columns: 1fr 4fr;
	grid-template-rows: 1fr 1fr;
}

.atis-field {
	box-sizing: border-box;
	padding: 5px;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	outline: 1px solid hsl(0, 0%, 90%);
}

#atis-rmks {
	grid-row: 1 / 3;
	grid-column: 2;
}

.atis-field h1 {
	font-size: clamp(1px, 3vw, 20px);
}

.atis-input-scroll {
	height: calc(100% - 30px);
	overflow-y: auto;
}

.atis-input {
	box-sizing: border-box;
	width: 100%;
	font-family: sans-serif;
	font-size: 40px;
	text-align: left;
	text-transform: uppercase;
	padding: 10px;
	overflow: auto;
}

.atis-input:focus {
	outline: none;
}

#scratchpad-options {
	display: flex;
	position: absolute;
	left: 0;
	top: 0;
	z-index: 3;
	justify-content: space-between;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	height: 60px;
	background: hsl(0, 0%, 25%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#scratchpad-options > div {
	display: flex;
	height: 100%;
	align-items: center;
}

.option-button {
	box-sizing: border-box;
	height: 100%;
	width: 100px;
	padding: 10px;
	transition: background 0.3s;
}

.option-button:hover {
	background: hsl(0, 0%, 35%);
	cursor: pointer;
}

.option-icon {
	height: 15px;
	aspect-ratio: 1;
	filter: invert(90%) drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

#hamburger-menu {
	display: none;
}

#hamburger-menu img {
	height: 100%;
	filter: invert(90%) drop-shadow(0 0 5px rgba(0, 0, 0, 0.5))
}

#option-buttons {
	display: flex;
	height: 100%;
}

#dot-menu {
	display: none;
}

#dot-menu img {
	height: 100%;
	filter: invert(90%) drop-shadow(0 0 5px rgba(0, 0, 0, 0.5))
}

#editing-buttons {
	display: flex;
	height: 100%;
}

#scratchpad-templates > div {
	padding: 10px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	grid-gap: 20px;
}

.scratchpad-template {
	display: inline-block;
	box-sizing: border-box;
	padding: 2px;
	width: 100px;
	background: hsl(0, 0%, 27.5%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
	border-radius: 5px;
	transition: background 0.3s;
}

.scratchpad-template:hover {
	background: hsl(0, 0%, 35%);
	cursor: pointer;
}

#saved-scratchpads-container {
	width: 100%;
	overflow-y: auto;
	max-height: 25vh;
}

.saved-scratchpad-option {
	font-family: monospace;
	font-size: 20px;
	text-align: left;
	white-space: pre-wrap;
	cursor: pointer;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 90%;
	height: fit-content;
	margin: 10px auto;
	padding: 5px 8px;
	background: hsl(0, 0%, 27.5%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
	border-radius: 5px;
	transition: background 0.3s;
}

.saved-scratchpad-option > img {
	box-sizing: border-box;
	height: 50px;
	padding: 5px;
	z-index: 4;
	filter: invert(90%) drop-shadow(0 0 10px rgba(0, 0, 0, 0.75));
	transition: filter 0.3s
}

.saved-scratchpad-option > img:hover {
	filter: invert(90%) drop-shadow(0 0 10px rgba(0, 0, 0, 0.75)) opacity(50%);
}

.saved-scratchpad-option > img:active {
	filter: invert(90%) opacity(50%);
}

.saved-scratchpad-option:hover, .scratchpad-template:hover {
	background: hsl(0, 0%, 37.5%);
}

.saved-scratchpad-option:active, .scratchpad-template:active {
	box-shadow: none;
}

#save-status {
	font-size: 15px;
	overflow-x: auto;
	white-space: nowrap;
	opacity: 0.75;
}

/* menu bar */
#pages-menu {
	position: fixed;
	display: flex;
	justify-content: center;
	align-items: center;
	bottom: 0;
	width: 100%;
	height: 60px;
	background: hsl(0, 0%, 25%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
	z-index: 100;
}

.page-button {
	box-sizing: border-box;
	height: 100%;
	width: min(150px);
	padding: 10px 20px;
	white-space: nowrap;
	transition: background 0.3s;
}

.page-button:hover {
	background: hsl(0, 0%, 35%);
	cursor: pointer;
}

.page-icon {
	height: 20px;
	aspect-ratio: 1;
	filter: invert(90%) drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.page-button h1, .option-button h1, .scratchpad-template h1 {
	font-size: 15px;
	text-align: center;
	width: 100%;
	text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* media queries */
@media (max-width: 800px) {
	#hamburger-menu {
		display: block;
	}

	#option-buttons.open {
		display: flex;
	}

	#option-buttons {
		display: none;
		flex-direction: column;
		height: auto;
		position: absolute;
		left: 0;
		top: 60px;
	}

	.option-button {
		background: hsl(0, 0%, 25%);
	}

	#option-buttons .option-button {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 10px;
		width: 100px;
	}

	#option-buttons .option-button h1 {
		text-align: left;
	}
}

@media (max-width: 630px) {
	section {
		width: 100%;
		min-width: auto;
		margin: 0;
	}
}

@media (max-width: 560px) {
	#clock {
		flex-direction: column;
		justify-content: flex-start;
	}

	.clock {
		width: 100%;
	}
}

@media (max-width: 480px) {
	#dot-menu {
		display: block;
	}

	#editing-buttons.open {
		display: flex;
	}

	#editing-buttons {
		display: none;
		flex-direction: column;
		height: auto;
		position: absolute;
		right: 0;
		top: 60px;
	}

	#editing-buttons .option-button {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 10px;
		width: 100px;
	}

	#editing-buttons .option-button h1 {
		text-align: left;
	}
}