html, body {
	height: 100%;
	padding: 0;
	margin: 0;
}

body {
	font-family: "Roboto", serif;
	font-size: 14px;
	color: #BBB;
	background-color: #333;
	scrollbar-gutter: stable;
}

h1 {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 36px;
	font-weight: bold;
	letter-spacing: 0.1em;
	text-align: center;
	color: #F44;
	margin: 0;
}

h2 {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 12px;
	letter-spacing: 0.13em;
	text-align: center;
	color: #777;
	margin: 0;
	margin-top: 0.8em;
}

.button {
	font-family: "Roboto", serif;
	padding: 8px 12px;
	font-size: 12px;
	letter-spacing: 0.08em;
	border-radius: 5px;
	cursor: pointer;
	color: white;
	display: inline-block;
	background-color: #F44;
	font-weight: bold;
	text-decoration: none;
	text-align: center;
}

.button:hover {
	background-color: #F66;
}

.hollow.button {
	background-color: transparent;
	border: 2px solid #F44;
	padding: 3px 12px 3px 12px;
}

.hollow.button:hover {
	background-color: #F44;
}

.disabled.button {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none; /* Prevent click events */
}

.wide.button {
	padding: 5px 14px 5px 14px;
	font-size: 14px;
	letter-spacing: 0.15em;
}

.tall.button {
	line-height: 1.65em;
}

input[type="checkbox"] {
	margin: 0;
	cursor: pointer;
	accent-color: #F44;
}

label {
	cursor: pointer;
	margin-left: 10px;
}

.hidden {
	display: none !important;
}

.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
	-webkit-user-select: none; /* Safari */
	 -khtml-user-select: none; /* Konqueror HTML */
	   -moz-user-select: none; /* Old versions of Firefox */
	    -ms-user-select: none; /* Internet Explorer/Edge */
	        user-select: none; /* Non-prefixed version, currently
	                              supported by Chrome, Edge, Opera and Firefox */
}



/* First "page" */

#options-page {
	font-size: 12px;
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	height: 100%;
	min-height: 500px;
	overflow-x: hidden;
}

a {
	color: inherit;
	text-decoration: none;
}

.options {
	height: 200px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	position: relative;
}

#options-start {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.button-wrapper {
	width: fit-content;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.option-content .button {
	box-sizing: border-box;
	width: 100%;
}

#optional {
	position: absolute;
	margin-left: -70px;
	margin-top: 8px;
}

#selected-file {
	position: absolute;
	margin-left: 20px;
	margin-top: 8px;
}

#selected-file {
	white-space: nowrap;
}

.x {
	color: white;
	background-color: #F44;
	border-radius: 2px;
	cursor: pointer;
	font-weight: bold;
	text-align: center;
	display: inline-block;
	height: 15px;
	width: 15px;
}

.x + span {
	margin-left: 5px;
}

#spinner {
	position: absolute;
	padding: 5px 14px 5px 14px;
}

.spinner-dual-ring {
	color: #F44;
}

.spinner-dual-ring, .spinner-dual-ring:after {
	box-sizing: border-box;
}

.spinner-dual-ring {
	display: inline-block;
	width: 20px;
	height: 20px;
}

.spinner-dual-ring:after {
	content: " ";
	display: block;
	width: 16px;
	height: 16px;
	margin: 2px;
	border-radius: 50%;
	border: 3px solid currentColor;
	border-color: currentColor transparent currentColor transparent;
	animation: spinner-dual-ring 1.2s linear infinite;
}

@keyframes spinner-dual-ring {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.checkboxes {
	display: flex;
	flex-direction: column;
	justify-content: left;
	gap: 15px;

	div {
		display: flex;
		flex-direction: row;
	}
}

/* https://blog.logrocket.com/creating-beautiful-tooltips-with-only-css/ */

.tooltip {
	position: relative;
	border-bottom: 1px dotted #777;
}

.tooltip:before {
	content: attr(data-tip);
	position: absolute;

	top: 50%;
	transform: scale(0) translateY(-50%);

	width: 200px;
	padding: 10px;
	border-radius: 10px;
	background: #222;
	color: #FFF;
	text-align: center;
	font-size: 12px;
	line-height: 1.2;

	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s ease-in-out, visibility 0s ease-in-out 0.3s, transform 0s linear 0.3s;
}

.tooltip.left:before {
	right: 100%;
	margin-right: 18px;
}

.tooltip.right:before {
	left: 100%;
	margin-left: 18px;
}

.tooltip:after {
	content: "";
	position: absolute;

	top: 50%;
	transform: scale(1) translateY(-50%);

	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s ease-in-out, visibility 0s ease-in-out 0.3s, transform 0s linear 0.3s;
}

.tooltip.left:after {
	right: 100%;
	margin-right: -2px;

	border: 10px solid #222;
	border-color: transparent transparent transparent #222 ;
}

.tooltip.right:after {
	left: 100%;
	margin-left: -2px;

	border: 10px solid #222;
	border-color: transparent #222 transparent transparent;
}

.tooltip:hover:before, .tooltip:hover:after {
	transform: scale(1) translateY(-50%);
	visibility: visible;
	opacity: 1;
	transition: opacity 0.3s ease-in-out;
}

/*
.tooltip {
	font-weight: bold;
	margin-left: 10px;
	border-radius: 1.2ex;
	padding: 1px;
	border: 1px solid grey;
	opacity: 80%;
	cursor: pointer;
}
*/

.footer {
	border-top: 1px solid #F44;
	color: #777;
	font-size: 12px;
	padding-top: 5px;
	padding-bottom: 30px;
}

.social-links {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 20px;
}

.img-rescale {
	width: 40px;
	height: 40px;
	opacity: 0.4;
}

.img-rescale img {
	width: 100%;
	height: auto;
}


/* Second "page" */

#results-page {
	padding-bottom: 60px;
}

.header {
	position: fixed;
	top: 0;
	width: 100%;
	min-width: 700px;
}

.header-title {
	height: 54px;
	background-color: #444;
}

.header-title > h1 {
	font-size: 28px;
	line-height: 54px;
	display: inline-block;
	margin-left: 16px;
}

.search-buttons {
	float: right;
}

.search-buttons > .button {
	margin: 12px;
}

#header-content {
	padding: 16px 16px 8px;
	border-bottom: 1px solid #555;
	background-color: #333;
}

.progress {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	width: 100%;
}

.progress-bar {
	width: 175px;
	height: 8px;
	margin-top: 6px;
	margin-right: 14px;
	overflow: hidden;
	background-color: #EEE;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
	box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

#progress-bar-inner {
	background-color: #F44;
	width: 5%;
	height: 8px;
	border-radius: 4px;
}

.progress-text {
	white-space: nowrap;
	height: 30px;
}

.text-button {
	color: #F44;
	cursor: pointer;
}

textarea {
	width: 100%;
	height: 60px;
	padding-bottom: 8px;
}

.textarea {
	margin-bottom: 14px;
	font-size: 0.8em;
	color: #EEE;
	background-color: #444;
	border-color: #777;
}

.textareaon {
	display: block;
	width: 100%;
	height: 160px;
}

#message {
	width: fit-content;
	max-width: 500px;
	margin: 0 auto;
	padding: 5px;
	text-align: center;
	background-color: #FFC;
	color: #666;
	border-radius: 3px;

	position: fixed;
	top: 140px;
	left: 50%;
	transform: translate(-50%, 0%);
	z-index: 1000;
}

#clusters {
	margin-top: 180px;
	display: flex;
	flex-direction: row;
	row-gap: 30px;
	flex-wrap: wrap;
}

.cluster {
	width: 100%;
	display: flex;
	flex-direction: row;
	gap: 4px;
}

.cluster.collapsed {
	width: auto;
	border: 1px solid #333;
	cursor: pointer;
}

.cluster-num {
	font-family: "Roboto", serif;
	font-size: 1.6em;
	color: #CCC;
	padding: 5px 15px;
	text-align: center;
	cursor: pointer;
}

.cluster-num:hover {
	background-color: #555;
}

.cluster-num.some-selected {
	color: #F44;
}

.cluster-num.all-selected {
	color: white;
	background-color: #F44;
}

.cluster-num.all-selected:hover {
	background-color: #F66;
}

.cluster-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cluster.collapsed .cluster-content {
	display: none;
}

.cluster-imgs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	cursor: pointer;
}

.div-img {
	text-align: center;
	padding: 2px;
}

img {
	vertical-align: middle;
}

.image-dims {
	color: #BBB;
	background-color: #292929;
	letter-spacing: 0.1em;
	font-size: 13px;
	padding: 3px;
}

.cluster-info {
	max-width: calc(100vw - 100px);
}

.img-info {
	color: #CCC;
	white-space: nowrap;
	line-height: 1.42857143;
	cursor: pointer;
	font-family: Inconsolata, Roboto Mono, Courier New, Courier, monospace;
}

.best-part {
	color: white;
	font-weight: bold;
}

.img-info-part {
	display: inline-block;
	color: inherit;
	font-family: inherit;
	background-color: transparent;
	padding: 3px 10px;
	vertical-align: top;
}

.img-info-part.size {
	width: 30px;
}

.img-info-part.date {
	width: 70px;
}

.img-info-part.path {
	word-break: break-all;
	white-space: collapse;
	width: calc(100% - 160px);
}

u {
	color: inherit;
    text-decoration-color: #F44;
}

/*
u.filenameDiff {
	text-decoration: underline;
    text-decoration-color: #F44;
    text-decoration-style: double;
	text-underline-offset: 4px;
	text-decoration-skip-ink: none;
}
*/

.highlighted u {
	color: inherit;
    text-decoration-color: #333;
}

.hovered {
	background-color: #555;
}

.highlighted {
	color: white;
	background-color: #F44;
}

.highlighted.hovered {
	background-color: #F66;
}

#back-to-top {
	position: fixed;
	bottom: 20px;
	right: 20px;
	padding: 10px;
	z-index: 1000;
	border: none;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.2s ease-in-out;
}
