
/* DROPDOWN Formatting */

.dropdown {
	display: none;
}

.dropdown-container {
	width: 100%;
	position: relative;
}

.dropdown-container:focus {
	outline: 2px solid var(--primary-light);
	border-radius: 5px;
}

.dropdown-display {
	width: 100%;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 1fr auto;
	padding: 8px;
	line-height: 18px;
	border: 1px solid var(--grey-line);
	border-radius: 2px;
	align-items: center;
	background-color: white;
	cursor: pointer;
	white-space: nowrap;
}

.dropdown-display:focus {
	outline: 2px solid var(--primary-light);
}

.dropdown-icon {
	border-left: 1px solid var(--grey-line);
	padding: 0 0 0 8px;
	text-align: center;
	width: 1em;
	height: 1em;
	display: grid;
	place-content: center;
}

.dropdown-icon:before {
	content: "";
	width: 1em;
	height: 1em;
	transform: scale(1);
	transition: 120ms transform ease-in-out;
	box-shadow: inset 1em 1em var(--primary-base);
	transform: rotate(0deg);
	transition: 120ms;
	clip-path: polygon(50% 75%, 0 30%, 100% 30%);
}

.dropdown-active .dropdown-icon:before {
	transform: rotate(180deg);
}

.dropdown-input {
	width: 100%;
	max-height: 80vh;
	background-color: white;
	box-sizing: border-box;
	display: none;
	flex-direction: column;
	padding: 5px;
	border: 1px solid var(--grey-line);
	border-radius: 5px;
	overflow-y: scroll;

	position: absolute;
	max-height: 400px;
	user-select: none;

	z-index: 1000;
}

.dropdown-input-above {
	bottom: 100%;
	margin-bottom: 5px;
}

.dropdown-input-below {
	top: 100%;
	margin-top: 5px;
}

.dropdown-item {
	display: grid;
	width: 100%;
	box-sizing: border-box;
	grid-template-columns: 1em 1fr;
	gap: 0.8em;
	align-items: center;
	padding: 8px;
	cursor: pointer;
	border-radius: 3px;
	transition: 120ms;
}

.dropdown-item:hover {
	background-color: var(--primary-light);
}

.dropdown-item-select {
	  width: 1em;
	  height: 1em;
	  border: 0.15em solid var(--grey-line);
	  border-radius: 0.15em;
	  transform: translateY(-0.075em);
	  background-color: white;
	  display: grid;
	  place-content: center;

}

.dropdown-item[data-selected=true] .dropdown-item-select:before {
	content: "";
	width: 0.75em;
	height: 0.75em;
	transform: scale(1);
	transition: 120ms transform ease-in-out;
	box-shadow: inset 1em 1em var(--primary-dark);
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.dropdown-active .dropdown-input {
	display: flex !important;
}

.dropdown-background {
	display: none;
	width: 100vw;
	height: 100vh;
	position: fixed;
	top: 0;
	left: 0;
}

.dropdown-active .dropdown-background {
	display: block !important;
}

@media (max-width: 600px) {

	.dropdown-active .dropdown-display {
		width: 90%;
		max-width: 400px;
	}

	.dropdown-active.dropdown-container {
		z-index: 1000;
	}

	.dropdown-active {
		position: fixed;
		top: 0;
		left: 0;
		box-sizing: border-box;
		width: 100vw;
		height: 100vh;
		background-color: rgba(0,0,0,0.5);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.dropdown-input {
		width: 90%;
		max-width: 400px;
		position: static;
	}

	.dropdown-item {
		padding: 12px 8px;
	}

}
