// Base class
.tooltip {
	position: absolute;
	z-index: $z-index-tooltip;
	display: block;
	margin: 0;
	// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
	// So reset our font and text properties to avoid inheriting weird values.
	// @include reset-text();
	font-family: $font-family-base;
    font-style: normal;
    font-weight: $font-weight-base;
    line-height: $line-height-base;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    white-space: normal;
    word-spacing: normal;
    line-break: auto;

	font-size: $font-size-xsmall;
	// Allow breaking very long words so they don't overflow the tooltip's bounds
	word-wrap: break-word;
	opacity: 0;

	&.show { opacity: .9; }

	.tooltip-arrow {
		position: absolute;
		display: block;
		width: .8rem;
		height: .4rem;

		&::before {
			position: absolute;
			content: "";
			border-color: transparent;
			border-style: solid;
		}
	}
}

.bs-tooltip-top {
	padding: .4rem 0;

	.tooltip-arrow {
		bottom: 0;

		&::before {
			top: 0;
			border-width: .4rem .4rem 0;
			border-top-color: $co-base-0;
		}
	}
}

.bs-tooltip-end {
	padding: 0 .4rem;

	.tooltip-arrow {
		left: 0;
		width: .4rem;
		height: .8rem;

		&::before {
			right: 0;
			border-width: .4rem .4rem .4rem 0;
			border-right-color: $co-base-0;
		}
	}
}

.bs-tooltip-bottom {
	padding: .4rem 0;

	.tooltip-arrow {
		top: 0;

		&::before {
			bottom: 0;
			border-width: 0 .4rem .4rem;
			border-bottom-color: $co-base-0;
		}
	}
}

.bs-tooltip-start {
	padding: 0 .4rem;

	.tooltip-arrow {
		right: 0;
		width: .4rem;
		height: .8rem;

		&::before {
			left: 0;
			border-width: .4rem 0 .4rem .4rem;
			border-left-color: $co-base-0;
		}
	}
}

.bs-tooltip-auto {
	&[data-popper-placement^="top"] {
		@extend .bs-tooltip-top;
	}
	&[data-popper-placement^="right"] {
		@extend .bs-tooltip-end;
	}
	&[data-popper-placement^="bottom"] {
		@extend .bs-tooltip-bottom;
	}
	&[data-popper-placement^="left"] {
		@extend .bs-tooltip-start;
	}
}

// Wrapper for the tooltip content
.tooltip-inner {
	max-width: 200px;
	padding: $sp-1 $sp-2;
	color: $co-base-1;
	text-align: center;
	background-color: $co-base-0;
	@if $useBorderRadius { border-radius: $border-radius-1;}
}
