/*
 * Copyright (c) 2022 Ford Motor Company
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@use '../../Styles/main';

.tooltip {
	$arrow-size: 12px;

	display: inline-block;
	padding: 6px 18px;

	color: main.$white;
	font-size: 1rem;
	text-align: center;

	background-color: main.$asphalt;

	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(main.$black, 0.25);
	transform: translate(-50%, $arrow-size);
	visibility: hidden;

	opacity: 0;

	transition: opacity 0.7s;

	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 1000;

	@media only screen and (max-width: 610px) {
		display: none;
	}

	&::before {
		display: block;
		width: 0;
		height: 0;

		border-right: $arrow-size solid transparent;

		border-bottom: $arrow-size solid main.$asphalt;
		border-left: $arrow-size solid transparent;
		transform: translateX(-50%);

		content: '';

		position: absolute;
		left: 50%;
		top: -$arrow-size;

		z-index: 999;
	}

	*:hover > & {
		visibility: visible;
		opacity: 1;
	}
}

@include main.dark-theme {
	.tooltip {
		color: main.$dark-asphalt;
		background-color: main.$off-white;

		&::before {
			border-bottom-color: main.$off-white;
		}
	}
}
