@import "../shared.css";

body {
	color: var(--text-colour, var(--text-colour-normal));
	background-color: var(--background-colour, var(--colour-0));
	margin: 0;
	padding: 8px;
	width: 22em !important;
	height: 30rem;
}

/* Layout */

#loading-wrapper {
	color: var(--text-colour, var(--text-colour-normal));
	background-color: var(--background-colour, var(--colour-0));
	display: flex;
	align-items: center;
	flex-direction: column;
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 1rem;
	z-index: 100;
}

#settings-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;

	> * {
		flex: 0 1 auto;
	}
}

#info-display-wrapper,
#colour-correction-info {
	border-radius: 4px;
	display: block;
	margin: 0;
	padding: 8px;
	text-align: left;
}

hr {
	background-color: var(--transparent-0);
	border-width: 0;
	color: var(--transparent-0);
	height: 1px;
	margin-block: 4px;
	width: 100%;
}

.section-group-title {
	background-image: linear-gradient(to top, transparent, var(--background-colour, var(--colour-0)) 16px);
	font-weight: 600;
	padding: 8px 4px 16px;
	position: sticky;
	text-align: center;
	top: 0;
	z-index: 10;
}

.section-group {
	border: 1px solid var(--transparent-0);
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
    min-height: 0;
	overflow-x: hidden;
	overflow-y: scroll;

	> * {
		flex: 1 1 auto;
	}
}

.section {
	display: contents;
}

.section-title {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	margin-block: 4px;
	text-align: center;

	&::before,
	&::after {
		border-bottom: 1px solid var(--transparent-0);
		content: "";
		flex: 1;
	}
}

#info-display-wrapper,
#colour-correction-info {
	border: 1px solid var(--transparent-0);
	line-height: 1.5rem;
}

.info-display {
	display: none;

	> div {
		display: inline;
	}

	button.info-action {
		background-color: var(--transparent-0);
		display: block;
		margin-top: 0.5em;
		text-align: center;
		width: 100%;

		&:hover {
			background-color: var(--transparent-1);
		}
		&:active {
			background-color: var(--transparent-3);
		}
	}

	.additional-info {
		font-weight: 600;
		font-family: monospace;
	}
}

.PROTECTED_PAGE > .info-display[name="PROTECTED_PAGE"],
.HOME_PAGE > .info-display[name="HOME_PAGE"],
.TEXT_VIEWER > .info-display[name="TEXT_VIEWER"],
.IMAGE_VIEWER > .info-display[name="IMAGE_VIEWER"],
.PDF_VIEWER > .info-display[name="PDF_VIEWER"],
.JSON_VIEWER > .info-display[name="JSON_VIEWER"],
.ERROR_OCCURRED > .info-display[name="ERROR_OCCURRED"],
.FALLBACK_COLOUR > .info-display[name="FALLBACK_COLOUR"],
.COLOUR_PICKED > .info-display[name="COLOUR_PICKED"],
.ADDON_SPECIFIED > .info-display[name="ADDON_SPECIFIED"],
.ADDON_RECOM > .info-display[name="ADDON_RECOM"],
.ADDON_DEFAULT > .info-display[name="ADDON_DEFAULT"],
.THEME_UNIGNORED > .info-display[name="THEME_UNIGNORED"],
.THEME_MISSING > .info-display[name="THEME_MISSING"],
.THEME_IGNORED > .info-display[name="THEME_IGNORED"],
.THEME_USED > .info-display[name="THEME_USED"],
.QS_USED > .info-display[name="QS_USED"],
.QS_FAILED > .info-display[name="QS_FAILED"],
.QS_ERROR > .info-display[name="QS_ERROR"],
.COLOUR_SPECIFIED > .info-display[name="COLOUR_SPECIFIED"] {
	display: contents;
}

/* Button */

button {
	align-items: center;
	background-color: transparent;
	border: none;
	border-radius: 4px;
	color: inherit;
	display: flex;
	margin: 0;
	padding: 8px;
	text-align: left;

	&:hover {
		background-color: var(--transparent-0);
	}
	&:active {
		background-color: var(--transparent-2);
	}
}

/* Slider */

.slider {
	align-items: center;
	display: flex;
	flex-direction: row;
	gap: 0.5rem;
	padding: 8px 16px 8px 8px;

	.slider-title {
		margin-right: auto;
		text-align: center;
	}

	.slider-body {
		align-items: center;
		display: flex;
		justify-content: center;
		text-align: center;
		width: 2.5rem;

		&::after {
			content: "%";
			margin-inline-start: 0.2em;
		}
	}

	button {
		align-items: center;
		background-color: var(--transparent-0);
		border-radius: 50%;
		height: 1.25rem;
		justify-content: center;
		padding: 0;
		width: 1.25rem;

		&:hover {
			background-color: var(--transparent-1);
		}
		&:active {
			background-color: var(--transparent-3);
		}
	}
}
