@use './styles/utils';

.popup {
	box-shadow: 0px 0px 28px 0 rgba(0, 0, 0, 0.5);
	cursor: default;
	padding: 1em;
	position: absolute;
	top: 72px;
	width: 80vw;
	min-width: 373px;
	max-width: 472px;
	z-index: 1;

	&:before {
		background: transparent;
		border: 12px solid transparent;
		content: '';
		left: 50%;
		position: absolute;
		pointer-events: none;
		top: -24px;
		z-index: 1001;

		@include utils.light-theme($selectorPostfix: ' &') {
			border-bottom-color: var(--color-background--darken-05);
		}

		@include utils.dark-theme($selectorPostfix: ' &') {
			border-bottom-color: var(--color-background--lighten-075);
		}
	}

	@include utils.light-theme($selectorPostfix: ' &') {
		background: var(--color-background--darken-05);
	}

	@include utils.dark-theme($selectorPostfix: ' &') {
		background: var(--color-background--lighten-075);
	}
}

.token-popup__scroller {
	margin-right: -0.4em;
	max-height: 35vh;
	overflow-y: scroll;
	padding-right: 0.4em;
}

.token-popup__hint {
	color: var(--color-foreground--75);
	display: inline-block;
	font-weight: 200;
	margin: 1.25em 0.5em 0 0.25em;
}

.token-popup__title {
	color: var(--color-foreground);
	font-weight: 400;
	margin: 0.25em 0 1em 0;
	text-align: center;
}

.token-popup__table {
	border-collapse: collapse;
	color: var(--color-foreground--75);
	table-layout: fixed;

	& tr:nth-child(even) {
		@include utils.light-theme($selectorPostfix: ' &') {
			background-color: rgba(0, 0, 0, 0.05);
		}

		@include utils.dark-theme($selectorPostfix: ' &') {
			background-color: rgba(255, 255, 255, 0.04);
		}
	}

	& td {
		padding: 6px;

		i {
			opacity: 0.6;
		}
	}

	& td:first-child {
		padding: 6px 12px;
	}

	& td:last-child {
		padding-right: 12px;
		text-align: end;
	}
}

.token {
	background: var(--color-link-foreground--darken-20);
	border-bottom: 2px solid var(--color-link-foreground--darken-20);
	border-radius: 3px;
	color: white;
	cursor: pointer;
	display: inline-block;
	padding: 1px 8px !important;

	&:before {
		content: '${';
	}

	&:after {
		content: '}';
	}

	@include utils.light-theme($selectorPostfix: ' &') {
		background: var(--color-link-foreground--lighten-20);
		border-bottom-color: var(--color-link-foreground--lighten-20);
	}
}
