@import '../../styles/variables';
@import '../../styles/mixins';

.form-list {
	.item-media {
		padding: .35rem 0;
		align-items: flex-start;
	}

	.item-content {
		display: flex;
		min-height: 2.2rem;
	}

	li+li {
		.item-content {
			@include hairline(top, #{'var(--list-dark-border-color, ' + $color-border + ')'});

			.app.dark & {
				@include hairline(top, #{'var(--list-dark-border-color, rgba(255, 255, 255, .2))'});
			}
		}
	}

	input[type="text"],
	input[type="password"],
	input[type="search"],
	input[type="email"],
	input[type="tel"],
	input[type="url"],
	input[type="date"],
	input[type="datetime-local"],
	input[type="time"],
	input[type="number"],
	select,
	textarea {
		appearance: none;
		box-sizing: border-box;
		border: none;
		background: none;
		border-radius: 0 0 0 0;
		box-shadow: none;
		display: block;
		padding: 0px;
		margin: 0;
		width: 100%;
		height: 43px;
		color: var(--color-text);
		font-size: 17px;
		font-family: inherit;
		outline: none;

		.app.dark & {
			color: #FFF;
		}
	}

	.item-title.label {
		padding: 0.5rem 0;
		vertical-align: top;
		line-height: 1em;

		+.item-input {
			margin-left: 5px;
		}
	}

	input[type="date"],
	input[type="datetime-local"] {
		line-height: 44px;
	}

	select {
		-webkit-appearance: none;
		-moz-appearance: none;
		-ms-appearance: none;
		appearance: none;
	}

	textarea {
		height: 80px;
		resize: none;
		line-height: 1.4;
		padding-top: 8px;
		padding-bottom: 7px;

		&.resizable {
			height: 43px;
		}
	}

	.item-input {
		width: 100%;
		margin-top: -.2rem;
		margin-bottom: -.2rem;
		-webkit-box-flex: 1;
		flex-shrink: 1;
	}

	.item-title.label {
		width: 35%;
		flex-shrink: 0;
	}

	.item-after {
		min-width: 2.5rem;

		.button {
			display: inline-block;
		}
	}

	.button {
		height: 1.4rem;
		line-height: 1.4rem;
	}

	.label-switch {
		margin-top: .3rem;
	}

	.list-append {
		margin-top: .3rem;
	}
}


// Slider
.range-slider {
	width: 100%;
	position: relative;
	overflow: hidden;
	padding-left: 3px;
	padding-right: 3px;
	margin-left: -1px;
	align-self: center;
	height: 43px;

	input[type="range"] {
		display: block;
		-webkit-appearance: none;
		background-color: #bdc3c7;
		width: 100%;
		height: 5px;
		border-radius: 5px;
		margin: 18px auto;
		outline: 0;
	}

	input[type="range"]::-webkit-slider-thumb {
		-webkit-appearance: none;
		background-color: var(--color-primary, #e74c3c);
		width: 22px;
		height: 22px;
		border-radius: 50%;
		border: 2px solid white;
		cursor: pointer;
		transition: .3s ease-in-out;
	}

	​ input[type="range"]::-webkit-slider-thumb:hover {
		background-color: white;
		border: 2px solid var(--color-primary, #e74c3c);
	}

	input[type="range"]::-webkit-slider-thumb:active {
		transform: scale(1.6);
	}

}

.smart-select {
	select {
		display: none;
	}
}

.label-switch {
	$switcher-factor: 4;
	$switcher-width: $switcher-height + $switcher-deploy;

	display: inline-block;
	vertical-align: middle;
	width: $switcher-width;
	border-radius: $switcher-height / 2;
	box-sizing: border-box;
	height: $switcher-height;
	position: relative;
	cursor: pointer;
	align-self: center;
	@include hairline-border(#e5e5e5, 16px);
	background-color: rgba(0,0,0, 0.15);
	overflow: hidden;
	
	.app.dark & {
		background-color: rgba(255,255,255, 0.6);
	}

	.checkbox {
		width: $switcher-width;
		border-radius: $switcher-height / 2;
		box-sizing: border-box;
		position: absolute;
		top: 0;
		left: 0;
		height: $switcher-height;
		z-index: 1;
		margin: 0;
		padding: 0;
		-webkit-appearance: none;
		-moz-appearance: none;
		-ms-appearance: none;
		appearance: none;
		border: none;
		cursor: pointer;
		position: relative;
		transition: 300ms;
		backface-visibility: hidden;
		-webkit-backface-visibility: hidden;

		&:before {
			content: ' ';
			position: absolute;
			left: 2px;
			top: 2px;
			width: $switcher-width - $switcher-factor;
			border-radius: $switcher-height / 2;
			box-sizing: border-box;
			height: $switcher-height - $switcher-factor;
			background: transparent;
			z-index: 1;
			transition: 300ms;
			transform: scale(1);
		}

		&:after {
			content: ' ';
			height: $switcher-height - $switcher-factor;
			width: $switcher-height - $switcher-factor;
			border-radius: $switcher-height - $switcher-factor;
			background: #fff;
			position: absolute;
			z-index: 2;
			top: 2px;
			left: 2px;
			box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
			transform: translate3d(0, 0, 0);
			transition: 300ms;
		}
	}

	input[type="checkbox"] {
		display: none;

		&:checked {
			&+.checkbox {
				background: var(--color-primary, #4cd964);

				&:before {
					transform: scale(0);
				}

				&:after {
					transform: translate3d($switcher-deploy, 0, 0);
				}
			}
		}
	}
}