@import "theming.css";

/*
 This stylesheet is meant for the various popups we use, whether it be the
 previewer, the browser, the settings menu, or anything alike.
*/

.popup {
	--spacing: var(--padding);
	--top-spacing: calc(var(--spacing) + calc(var(--spacing) * 1.6));

	z-index: 2;
	opacity: 0.0;
	position: fixed;
	overflow-y: scroll;
	pointer-events: none;
	left: var(--spacing);
	right: var(--spacing);
	bottom: var(--spacing);
	top: var(--top-spacing);

	background: var(--bg);
	transform: scale(0.98);
	border-radius: calc(var(--padding) / 3);

	transition-duration: 0.15s;
	transition-property: opacity, transform;
	transition-timing-function: ease-in-out;
}

.popup.blur {
	backdrop-filter: blur(15px);
}

.popup.shown {
	opacity: 1.0;
	pointer-events: all;
	transform: scale(1.0);
}

.popup.small {
	left: 20vw;
	right: 20vw;
	bottom: calc(var(--padding) * 2);
	top: calc(var(--padding) * 2 + var(--top-spacing));
}

#overlay {
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	opacity: 0.0;
	position: fixed;
	background: var(--bg);
	pointer-events: none;
	transition: opacity 0.15s ease-in-out;
}

#overlay.shown {
	opacity: 1.0;
	pointer-events: all;
	backdrop-filter: blur(10px);
}

/* browser/preview popup { */
@keyframes fadein {
	0% {opacity: 0.0}
	100% {opacity: 1.0}
}

.popup webview {
	width: 78%;
	margin: 0 auto;
	filter: opacity(1.0);
	transition: filter 0.15s ease-in-out;
	margin-top: calc(var(--spacing) / 2);
	height: calc(100% - calc(var(--spacing) / 2));
}

.popup webview.loading {
	filter: opacity(0.0);
	pointer-events: none;
}
/* } */

/* settings popup { */

.popup .options details {
	opacity: 1.0;
	transition: 0.15s opacity ease-in-out;
}

.popup .options details:not([open]) {
	opacity: 0.5;
}

.popup .options details:hover:not([open]) {
	opacity: 0.8;
}

.popup .options details summary {
	cursor: pointer;
	list-style-type: none;
}

.popup .options {
	color: white;
	margin: calc(var(--padding) / 2);
}

.popup .options .option,
.popup .options .buttons {
	width: 100%;
	display: flex;
	margin-bottom: var(--padding);
	justify-content: space-between;
}

.popup .overlay {
	z-index: 1;
	color: white;
	opacity: 0.0;
	position: fixed;
	pointer-events: none;
	transform: scale(0.9);
	background: var(--selbg);
	backdrop-filter: blur(15px);
	transition: 0.15s ease-in-out;
	padding: calc(var(--spacing) / 2);
	border-radius: calc(var(--spacing) / 2);
}

.popup .overlay.shown {
	opacity: 1.0;
	pointer-events: all;
	transform: scale(1.0);
}

#options.popup .misc button {
	margin-left: 0px;
	width: auto !important;
	padding-right: calc(var(--padding) / 2) !important;
}

.check {
	display:flex;
	cursor: pointer;
}

.check::before {
	width: 1em;
	height: 1em;
	content: " ";
	background-size: 75%;
	filter: brightness(1.3);
	background-position: center;
	background-repeat: no-repeat;
	transition: 0.15s ease-in-out;
	background-color: var(--selbg);
	margin-right: calc(var(--spacing) / 3);
	border-radius: calc(var(--spacing) / 4);
}

.check.checked::before {
	background-color: rgb(var(--red));
	background-image: url(../icons/check.png);
}

.option .text,
.buttons .text {
	font-weight: 600;
}

.option .text .desc,
.buttons .text .desc {
	opacity: 0.8;
	font-weight: 500;
	font-size: 0.9em;
	max-width: 400px;
	margin-top: calc(var(--padding) / 3);
}

.option .actions input,
.option .actions select {
	width: 100%;
	margin: 0px;
	--spacing: calc(var(--padding) / 3);
}

.option[type=array] .actions input {
	word-spacing: 15px;
	margin-right: 15vw;
}

.buttons .actions {
	text-align: right;
}

.buttons .actions button {
	margin-bottom: calc(var(--padding) / 5);
}

.option .actions button,
.buttons .actions button {
	background: var(--selbg);
}

.title {
	display: flex;
	margin-top: calc(var(--padding) * 2);
	margin-bottom: calc(var(--padding) / 2);
}

.title:first-child {
	margin-top: 0px;
}

.title img {
	width: 30px;
	height: 30px;
	margin: auto 0;
}

.title h2 {
	margin: 0px;
	margin-left: calc(var(--padding) / 3);
}

/* } */
