@import url("./vars.css");

body {
	position: relative;
	min-height: 98vh;
	background-color: var(--bg-color);
	color: var(--text-color);
}

footer {
	text-align: center;
	position: absolute;
	bottom: 0;
	width: 100%;

	* {
		margin-bottom: 0;
	}
}

#content {
	padding-bottom: 2.5rem;
}

table {
	width: 100%;
	text-align: center;
	vertical-align: middle;
	border-collapse: separate;
	border-spacing: 0;
	margin-top: 10px;

	thead th {
		background-color: var(--bg-dark-color);
	}

	tbody tr:hover {
		background-color: #4f4f4f;
	}

	th {
		border-top: var(--table-border);
		border-bottom: var(--table-border);
		border-right: var(--table-border);
	}

	td {
		border-bottom: var(--table-border);
		border-right: var(--table-border);
	}

	th:first-child,
	td:first-child {
		border-left: var(--table-border);
	}

	th:first-child {
		border-top-left-radius: var(--table-radius);
	}

	th:last-child {
		border-top-right-radius: var(--table-radius);
	}

	tr,
	th,
	td {
		padding: 7px;
	}
}

ul {
	line-height: 1.5;
}

a {
	color: var(--link-color);
	text-decoration: none;

	&:visited {
		color: var(--link-visited-color);
	}

	&:hover {
		color: var(--link-hover-color);
	}
}

button {
	margin-left: 16px;
	background: var(--button-bg-color);
	color: var(--text-color);
	padding: 8px;
	border-style: groove;
	border-color: var(--button-border-color);
	border-bottom-color: var(--primary-color);
	transition-duration: 0.1s;

	&:hover {
		background: var(--button-hover-bg-color);
	}

	&:active {
		background: var(--button-active-bg-color);
		transform: translateY(1px);
	}

	&.disabled {
		opacity: 0.6;
		cursor: not-allowed;
	}

	&.danger {
		border-bottom-color: var(--error-color);
	}
}

input[type="text"] {
	background-color: var(--bg-color);
	border: 1px solid var(--button-border-color);
	border-radius: 5px;
	color: var(--text-color);
	padding: 6px;
	outline: none;

	&:active,
	&:focus {
		border: 1px solid var(--primary-color);
	}
}

input[type="checkbox"],
input[type="radio"] {
	appearance: none;
	position: relative;
	cursor: pointer;
	width: 24px;
	height: 24px;

	& + label {
		cursor: pointer;
	}

	&::before {
		position: absolute;
		width: 100%;
		height: 100%;
		content: "";
		background-color: var(--bg-dark-color);
		border: 1px solid var(--button-border-color);
		border-radius: 5px;
	}

	&:hover::before {
		background-color: var(--bg-light-color);
	}

	&:checked::after {
		position: absolute;
		content: "\2713";
		color: var(--primary-color);
		font-size: 48px;
		top: -16px;
		left: -4px;
		align-content: center;
		text-align: center;
		white-space: pre;
	}

	&:checked:hover::after {
		color: var(--primary-light-color);
	}
}

input[type="radio"] {
	&::before {
		border-radius: 20px;
	}

	&:checked:after {
		font-size: 16px;
		top: 2px;
		left: 6px;
	}

	&:checked::after {
		content: "\25CF";
	}
}

.help {
	display: inline-block;
	vertical-align: middle;
	padding: 0px 8px;

	&:after {
		content: "?";
		font-size: 24px;
	}
}

.tooltip-wrapper {
	position: relative;

	.tooltip {
		visibility: hidden;
		background-color: var(--bg-light-color);
		position: absolute;
		top: -42px;
		color: var(--text-color);
		text-align: center;
		border-radius: 6px;
		padding: 8px;
		opacity: 0;
		transition: opacity 0.3s;
		z-index: 1;
	}

	&:hover .tooltip {
		visibility: visible;
		opacity: 1;
	}
}
