.kv-multiple-select {
	$m: &;
	$fontSize: 13px;

	position: relative;
	font-size: $fontSize;
	font-weight: 500;
	z-index: 100;

	&-control {
		@extend .kv-button, .kv-button-secondary;

		display: flex;
		align-items: center;
		justify-content: space-between;

		width: 100%;
		text-align: left;
		margin-top: 1px;
		cursor: pointer;

		.kv-counter {
			width: 18px;
			min-width: 18px;
			height: 18px;
			min-height: 18px;
			line-height: 18px;
			text-align: center;
			background-color: #454545;
			border-radius: 50%;
			font-size: 11px;
			color: white;
			padding-left: 1px;
		}
	}

	&-container {
		@extend .kv-p-2;

		width: 100%;
		z-index: 100;

		border: 1px solid #cccccc;
		background-color: $color-buttonface;

		#{$m}-dataset-container .view-content {
			@extend .kv-p-2;
			display: flex;
			flex-direction: column;
			position: absolute;
			left: 0;
			right: 0;
			width: calc(100% + 2px);
			max-height: 300px;
			margin: 0.35rem -1px 0 -1px;
			padding-top: 0.15rem !important;
			border: 1px solid #cccccc;
			border-top: none;
			background-color: $color-buttonface;
			overflow: auto;

			&.loading:after {
				top: calc(50% - 20px);
			}

			label.kv-form-label-button {
				margin: 1px 0;
				border: none;
				border-radius: 3px;
				font-size: $fontSize;
				font-weight: 600;
				color: #505050;
				cursor: pointer;
				user-select: none;
				transition: none;

				&:hover {
					background-color: #d0cfcf;
				}

				&.selected {
					background-color: #d0cfcf;
				}

				&.kv-justify {
					& > span {
						line-height: 20px;
					}

					.kv-form-label-type {
						float: left;
						width: 92px;
						margin-right: 8px;
						padding: 0 3px;
						border-radius: 10px;
						background-color: #bbb;
						text-transform: uppercase;
						font-size: 10px;
						font-weight: 500;
						color: white;
					}

					.kv-form-label-name {
						float: left;
						max-width: calc(100% - 45% - 50px);
						text-transform: capitalize;

						&.kv-form-label-full-width {
							max-width: calc(100% - 100px);
						}
					}

					.kv-form-label-extra {
						float: right;
						max-width: calc(100% - 55% - 50px);
						font-size: 11px;
					}
				}
			}

			label.kv-form-label-button.kv-featured-last {
				position: relative;
			}

			label.kv-form-label-button.kv-featured-last:after {
				content: '';
				position: absolute;
				bottom: 0;
				left: 0;
				width: 100%;
				height: 0;
				border-top: dashed 1px #aaa;
			}

			#{$m}-search-message {
				padding: 8px;
				line-height: 1.5;
			}
		}

		.kv-polygon-key-container .view-content {
			@extend .kv-p-2;
			display: flex;
			flex-direction: column;
			padding:0 !important;
			position: absolute;
			left: 0;
			right: 0;
			width: calc(100% + 2px);
			max-height: 300px;
			margin: 0.35rem -1px 0 -1px;
			padding-top: 0.15rem !important;
			border: 1px solid #cccccc;
			border-top: none;
			background-color: #ffffff;
			overflow: auto;

			&.loading:after {
				top: calc(50% - 20px);
			}
			hr {
				border-top: 1px solid #000;
			}

			[type="checkbox"]:checked + .kv-form-label-button {
				background-color: #e6e6e6;
			}

			label.kv-form-label-button {
				margin: 0;
				border: none;
				border-radius: 3px;
				font-size: $fontSize;
				font-weight: 600;
				color: #505050;
				cursor: pointer;
				user-select: none;
				transition: none;
				height:54px;

				.kv-form-label-button-wrapper {
					display:flex;
					flex-wrap:nowrap;
					align-items:center;
				}

				&:hover, 
				&:active,
				&:focus,
				&.selected {
					background-color: #e6e6e6;
				}
				&.kv-form-label-border {
					border-top:1px solid #000;
				}

				&.kv-justify {
					& > span {
						line-height: 20px;
					}

					.kv-form-label-symbol {
						width:30px;
						text-align:center;
						margin-top:-10px;
						color:#666;
					}

					.kv-form-label-desc {
					    flex-basis:auto;
						font-size: 12px;
						text-align:left;
						flex:auto;
						color:rgb(135, 135, 135);
						font-weight:normal;
						line-height:1.2;
					}

					.kv-form-label-desc-text {
						font-size: 15px;
						color:#4199d9;
						font-weight:normal;
					}

					.kv-form-extra-info {
						display:flex;
						flex-wrap:nowrap;
					}

					.kv-form-extra {
						width:50%;
					}
					
					.kv-form-type {
						width:50%;
						text-align:right;
						margin-right:10px;
					}
				}
			}

			label.kv-form-label-button.kv-featured-last {
				position: relative;
			}

			label.kv-form-label-button.kv-featured-last:after {
				content: '';
				position: absolute;
				bottom: 0;
				left: 0;
				width: 100%;
				height: 0;
				border-top: dashed 1px #aaa;
			}

			#{$m}-search-message {
				padding: 8px;
				line-height: 1.5;
			}
		}
	}

	&-search-container {
		display: flex;
		flex-shrink: 0;
		align-items: center;

		white-space: nowrap;
		min-height: 34px;
		line-height: 34px;
		padding-left: 10px;
		background-color: #fbfbfb;
		overflow-x: auto;
		overflow-y: hidden;
		order: -10000;

		#{$m}-token {
			margin-right: 5px;
			padding: 0 5px;
			border: 1px solid #cccccc;
			border-radius: $border-radius;
			background-color: #f1f1f1;
			text-transform: capitalize;

			&:hover {
				border-color: #9c9c9c;
			}

			&-close {
				padding: 0 3px;
				color: #cccccc;
				cursor: pointer;
			}

			&:hover .kv-multiple-select-token-close {
				color: #9c9c9c;
			}
		}

		#{$m}-search {
			flex-grow: 1;
			width: auto;
			min-width: 150px;
			line-height: 1.3;
			margin: 0;
			border: none;
			background-color: #fbfbfb;

			&:focus {
				border: none;
				background-color: #fbfbfb;
			}
		}

		input[type="text"] {
			padding: 0;
		}
	}

	&-layout-button &-container {
		position: absolute;
		border-top: none;
	}

	&-layout-button > label,
	&-layout-button .kv-multiple-select-control,
	&-layout-button &-search-container,
	&-layout-button &-search-container #{$m}-search,
	&-layout-button .kv-multiple-select-search-message,
	&-layout-button .kv-form-label-name {
		text-transform: uppercase;
	}

	&-layout-token &-dataset-container > .view-content {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}

	@media (max-width: $grid-mobile-xs) {
		&-container {
			#{$m}-dataset-container .view-content {
				label.kv-form-label-button {
					position: relative;
					padding-right: 0.25em !important;

					&.kv-justify {
						.kv-form-label-type {
							width: 64px;
							margin-top: 8px;
							margin-right: 6px;
							font-size: 7px;
						}

						.kv-form-label-name {
							max-width: calc(100% - 70px);
						}

						.kv-form-label-extra {
							position: absolute;
							left: 0;
							bottom: 5px;
							max-width: 100%;
							text-align: left;
							padding-left: 78px;
							font-size: 10px;
						}
					}
				}
			}
		}

		&-layout-token &-container {
			#{$m}-dataset-container .view-content {
				label.kv-form-label-button {
					min-height: 50px;
				}
			}
		}
	}
}