:root {
	--tooltip-border-color: rgba(39, 39, 39, 1);
	--tooltip-bg-color: rgba(39, 39, 39, 1);
	--tooltip-text-color: #fff;
	--tooltip-fontfamily: arial;
}

[data-tooltip] {
	position: relative;
	cursor: default;
}

/* content on the top */
[data-tooltip]:hover::before {
	content: attr(data-tooltip);
	font-size: 14px;
	text-align: center;
	position: absolute;
	display: block;
	left: 50%;
	min-width: 150px;
	max-width: 200px;
	bottom: calc(100% + 10px);
	transform: translate(-50%);
	animation: fade-in 300ms ease;
	background: var(--tooltip-bg-color);
	border-radius: 4px;
	padding: 10px;
	color: var(--tooltip-text-color);
	font-style: normal;
	font-family: var(--tooltip-fontfamily);
	z-index: 1;
}

[data-tooltip]:hover::after {
	content: "";
	position: absolute;
	display: block;
	left: 50%;
	width: 0;
	height: 0;
	bottom: calc(100% + 6px);
	margin-left: -3px;
	border: 1px solid var(--tooltip-border-color);
	border-color: var(--tooltip-border-color) transparent transparent transparent;
	border-width: 4px 6px 0;
	animation: fade-in 300ms ease;
	z-index: 1;
}

[data-tooltip][tooltip-position="bottom"]:hover::before {
	bottom: auto;
	top: calc(100% + 10px);
}

[data-tooltip][tooltip-position="bottom"]:hover::after {
	bottom: auto;
	top: calc(100% + 6px);
	border-color: transparent transparent rgba(39, 39, 39, 1);
	border-width: 0 6px 4px;
}

@keyframes fade-in {

	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}
