:root {
	--grid-unit: 1rem;
	--border-radius-base: 0.5rem;
}

[data-theme="light"] {
	--color-bg: #ffffff;
	--color-fg: #000000;
	--icon-invert: 0;
}

[data-theme="dark"] {
	--color-bg: #2c2c2c;
	--color-fg: #ffffff;
	--icon-invert: 1;
}

body {
	background-color: var(--color-bg);
	color: var(--color-fg);
}

* {
	font-family: "Inter", sans-serif;
}

button {
	background-color: var(--color-bg);
	color: var(--color-fg);
	border-radius: 5px;
}

a:link,
a:visited {
	font-weight: bold;
}

a:link {
	color: rgb(0, 174, 255);
}

a:visited {
	color: rgb(177, 100, 236);
}

input {
	background-color: var(--color-bg);
	color: var(--color-fg);
	border-radius: 5px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

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

::-webkit-scrollbar {
	display: none;
}

.monospace {
	font-family: "JetBrains Mono", monospace;
}

#new-widget {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	color: gray;
	cursor: pointer;
	width: 15rem;
	height: 15rem;
	border-radius: 10px;
	background-color: var(--color-bg);
	border-style: dashed;
	user-select: none;
}

#new-widget > ul {
	list-style-type: none;
	text-align: center;
	padding: 0px;
}

.widget {
	width: 15rem;
	height: 15rem;
	border-width: 3px;
	border-radius: 10px;
	margin-right: 1rem;
	vertical-align: top;
}

.real-widget {
	border-color: rgb(128, 128, 128);
	border-style: solid;
	position: relative;
	overflow: scroll;
}

#widgets {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	padding-left: 10px;
	gap: 1rem;
	align-items: flex-start;
}

#widgets > li {
	margin: 0;
	padding: 0;
}

#heading {
	padding-left: 10px;
}

#plus-icon {
	width: 2rem;
	height: auto;
}

dialog {
	outline: none;
	max-width: 100vw;
	background-color: var(--color-bg);
	border-color: grey;
	color: var(--color-fg);
}

#add-widgets {
	outline: none;
	max-width: none;
	width: 80vw;
}

#add-widgets::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

#new-widgets {
	margin: auto;
	padding: auto;
	width: 100%;
	display: flex;
}

input[type="search"] {
	background: url("icons/search.svg") top left no-repeat;
	height: 2rem;
	padding-left: 30px;
	border-radius: 5px;
	outline: none;
	width: 100%;
	display: flex;
	font-size: 20px;
}

#add-widgets-heading {
	margin-top: 0;
}

.widget-icon-wrapper {
	width: 26px;
	height: 26px;
	border-radius: 2px;
	border-style: solid;
	margin-left: 3px;
	justify-content: center;
	display: flex;
	align-items: center;
}

.widget-icon {
	width: 24px;
	height: 24px;
	mask-size: contain;
}

.widget-add-div-name {
	margin-left: 5px;
}

.add-widget-button {
	position: absolute;
	right: 20px;
	height: 28px;
	width: 28px;
	background: url("icons/plus.svg") center no-repeat;
	border-radius: 10px;
	outline: none;
	cursor: pointer;
}

.info-widget-button {
	position: absolute;
	right: 50px;
	height: 28px;
	width: 28px;
	background: url("icons/info.svg") center no-repeat;
	border-radius: 10px;
	outline: none;
	cursor: pointer;
}

.image-loader {
	width: 10rem;
	aspect-ratio: 1 / 1;
	background: url("icons/loading.gif") no-repeat center;
	background-size: 3rem;
	border: none;
}

#catpic-image {
	width: 100%;
	height: 100%;
	max-height: 12rem;
	cursor: zoom-in;
	object-fit: cover;
}

#catpic-zoom {
	width: fit-content;
	height: fit-content;
	max-width: 90%;
	max-height: 90%;
}

#zoomed-catpic {
	max-width: 90%;
	max-height: 90%;
}

dialog::backdrop {
	background-color: rgba(0, 0, 0, 0.7);
}

.widget-controls {
	display: flex;
	flex-wrap: wrap;
	top: 0;
	right: 0;
	position: absolute;
	z-index: 2;
}

.widget-control {
	border-top-right-radius: 0px;
	width: 22px;
	height: 22px;
}

.move-left {
	position: relative;
	border: 2px solid rgb(128, 128, 128);
	border-radius: 0;
	border-bottom-left-radius: 5px;
	cursor: e-resize;
}

.move-left::before {
	content: "";
	position: absolute;
	inset: 0px;

	background-color: var(--color-fg);

	-webkit-mask: url("icons/arrow-left.svg") center/contain no-repeat;
	mask: url("icons/arrow-left.svg") center/contain no-repeat;
}

.move-right {
	position: relative;
	border: 2px solid rgb(128, 128, 128);
	cursor: e-resize;
	border-radius: 0;
}

.move-right::before {
	content: "";
	position: absolute;
	inset: 0px;

	background-color: var(--color-fg);

	-webkit-mask: url("icons/arrow-right.svg") center/contain no-repeat;
	mask: url("icons/arrow-right.svg") center/contain no-repeat;
}

.settings-icon {
	position: relative;
	border: 2px solid rgb(128, 128, 128);
	cursor: pointer;
	border-radius: 0;
}

.settings-icon::before {
	content: "";
	position: absolute;
	inset: 2px;

	background-color: var(--color-fg);

	-webkit-mask: url("icons/settings.svg") center/contain no-repeat;
	mask: url("icons/settings.svg") center/contain no-repeat;
}

.delete-widget {
	position: relative;
	border: 2px solid rgb(128, 128, 128);
	cursor: pointer;
	border-radius: 0;
}

.delete-widget::before {
	content: "";
	position: absolute;
	inset: 0px;

	background-color: var(--color-fg);

	-webkit-mask: url("icons/delete.svg") center/contain no-repeat;
	mask: url("icons/delete.svg") center/contain no-repeat;
}

#widgets-list {
	margin-top: 1rem;
}

.widget-add-div {
	border-width: 2px;
	border-color: gray;
	border-style: solid;
	height: 40px;
	display: flex;
	align-items: center;
}

.oilpricecurrency {
	margin-bottom: 0;
	margin-top: 0;
}

.minor-text {
	color: gray;
	font-size: 15px;
}

.no-top-margin {
	margin-top: 0;
}

.no-bottom-margin {
	margin-bottom: 0;
}

.tooltip {
	cursor: help !important;
	text-decoration: underline dotted;
}

.oilpricecurrency > img {
	position: absolute;
	height: 30px;
	width: auto;
}

.widget-description {
	width: 50vw;
	height: 80vh;
}

.clock-time {
	font-size: 3rem;
	margin-top: 0.7rem;
	margin-bottom: 0;
}

#map {
	height: 500px;
	width: 500px;
}

.weather-location {
	margin-top: 0;
	display: inline-block;
	word-break: break-all;
	margin-top: 1.2rem;
}

.pick-location-btn {
	height: 15px;
	width: auto;
	cursor: pointer;
	filter: brightness(0) invert(var(--icon-invert));
}

[data-widget="xkcd"] > * {
	max-width: 100%;
}

#xkcd-zoom {
	width: 90vw;
	height: 90vh;
	overflow: scroll;
}

#zoomed-xkcd {
	width: 70%;
	height: auto;
}

.comic-img {
	cursor: zoom-in;
}

#macaroni-heading {
	border: 2px solid var(--color-fg);
	border-radius: 0 0 10px 10px;
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	background-color: var(--color-bg);
	color: var(--color-fg);

	width: max-content;
	max-width: calc(100vw - 20px);
}

#macaroni-heading > span {
	padding: 5px;
	cursor: pointer;
}

#attribution-dialog,
#about-dialog {
	width: 90%;
}

#icon-macaroni {
	width: 1.5rem;
	height: auto;
	vertical-align: middle;
	filter: brightness(0) invert(var(--icon-invert));
}

#icon-macaroni-span {
	padding: 0;
}

.oil-icon {
	filter: brightness(0) invert(var(--icon-invert));
}
