@import "../bs/variables";
@import "../bs/mixins";

.tokenfield {
	height: auto;
	padding-bottom: 3px;

	&.focus {
		outline: 0;
		border-color: #66afe9;
		.box-shadow(~'inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6)');
	}

	> .token, > .twitter-typeahead {
		vertical-align: top;
		margin-top: 1px;
	}

	> .token {
		display: inline-block;
		height: 24px;
		margin-right: 5px;
		line-height: 22px;
		cursor: default;
		white-space: nowrap;
		border: 1px solid #d9d9d9;
		background-color: #ededed;

		&:hover {
			border-color: #b9b9b9;
		}
		&.active {
			border-color: rgb(82, 168, 236);
			border-color: rgba(82, 168, 236, 0.8);
		}

		/* Invalid token */
		&.invalid {
			background: none;
			border-color: transparent;
			border-bottom-style: dotted;
			border-bottom-color: #b94a48;

			&.active {
				background: #ededed;
				border: 1px solid #ededed;
			}
		}

		> .token-label {
			display: inline-block;
			overflow: hidden;
			text-overflow: ellipsis;
			padding-left: 4px;
			vertical-align: top;
		}

		> .close {
			margin-left: 3px;
			padding: 0 4px 0 3px;
			float: none;
			font-size: 1em;
			vertical-align: middle;
		}
	}

	> .twitter-typeahead {
		> input.tt-hint, > input.token-input {
			background: none;
			border: 0;
			padding: 0;
			height: 24px;
			line-height: 24px;
			.box-shadow(none);
		}

		> input.token-input {
			width: 60px;
			min-width: 60px;

			&:focus {
				outline: 0;
				border-color: transparent;
				.box-shadow(none);
			}
		}

		> .tt-dropdown-menu {
			min-width: 160px;
			margin-top: 2px;
			padding: 5px 0;
			background-color: #fff;
			border: 1px solid rgba(0, 0, 0, .2);
			background-clip: padding-box;
			.box-shadow(0 5px 10px rgba(0, 0, 0, .2));
		}

		.tt-suggestion {
			display: block;
			padding: 3px 20px;

			&.tt-is-under-cursor {
				color: #fff;
				background-color: @MainBlueColor;

				a {
					color: #fff;
				}
			}
			p {
				margin: 0;
			}
		}
	}


	/* Disabled tokenfield */
	&.disabled {
		cursor: not-allowed;
		background-color: #eee;

		.token-input {
			cursor: not-allowed;
		}

		.close:hover {
			cursor: not-allowed;
			opacity: 0.2;
		}
	}
}


/* Different sizes */
.tokenfield.input-sm,
.input-group-sm .tokenfield {
	min-height: 30px;
	padding-bottom: 0px;
}

.input-group-sm .token,
.tokenfield.input-sm .token {
	height: 20px;
	margin-bottom: 4px;
}

.input-group-sm .token-input,
.tokenfield.input-sm .token-input {
	height: 18px;
	margin-bottom: 5px;
}

.tokenfield.input-lg,
.input-group-lg .tokenfield {
	min-height: 45px;
	padding-bottom: 4px;
}

.input-group-lg .token,
.tokenfield.input-lg .token {
	height: 25px;
}

.input-group-lg .token-label,
.tokenfield.input-lg .token-label {
	line-height: 23px;
}

.input-group-lg .token .close,
.tokenfield.input-lg .token .close {
	line-height: 1.3em;
}

.input-group-lg .token-input,
.tokenfield.input-lg .token-input {
	height: 23px;
	line-height: 23px;
	margin-bottom: 6px;
	vertical-align: top;
}