@import "../bootstrap/scss/functions";
@import "../base/functions";
@import "../base/variables";
@import "../bootstrap/scss/variables";
@import "../base/mixins";
@import "../bootstrap/scss/mixins";

// Base
.rd-range {
	height: 18px;
	margin-top: 4px;
	display: flex;
	align-items: center;

	&__wrap {
		position: relative;
		width: 100%;
		background-color: $gray-300;
		transition: background 100ms cubic-bezier(0.23, 1, 0.32, 1);
		height: 2px;
	}

	&:hover {

		.rd-range__pointer {
			&:before {
				transform: scale(1);
				animation-name: pulse;
			}
		}
	}

	// Range Pointer
	&__pointer {
		position: absolute;
		cursor: pointer;
		top: 1px;
		left: 6%;
		z-index: 1;
		width: 19px;
		height: 19px;
		border-radius: 50%;
		transform: translate(-50%, -50%);
		transform-origin: 0% 15%;
		transition: transform .2s cubic-bezier(.35, 0, .25, 1);
		overflow: visible;
		background-color: $gray-900;
		background-clip: padding-box;

		@include media-breakpoint-up(md) {
			width: 12px;
			height: 12px;

			&:before {
				content: '';
				height: 26px;
				width: 26px;
				pointer-events: none;
				background: rgba($primary, 0.16);
				position: absolute;
				top: -7px;
				left: -7px;
				border-radius: 50%;
				transform: scale(0);
				transition: transform 100ms cubic-bezier(0.445, 0.05, 0.55, 0.95) 0ms, opacity 60ms cubic-bezier(0.445, 0.05, 0.55, 0.95) 0ms;
				animation-duration: 1s;
				animation-fill-mode: both;
				animation-iteration-count: infinite;
			}

			&.active {
				transform: scale3d(1.5, 1.5, 1.5) translate(-50%, -50%);

				&:before {
					animation: none;
					transform: scale(0);
					opacity: 0;
				}
			}
		}
	}

	// Range line
	&__line {
		background-color: $gray-900;
		position: absolute;
		top: 0;
		left: 0;
		height: 2px;
		//transition: 0.02s cubic-bezier(.35, 0, .25, 1);
	}

	// Range with tooltip
	&.hasTooltip {
		.rd-range__pointer-tooltip {
			font-size: 12px;
			color: #ffffff;
			opacity: 0;
			transition: color .3s cubic-bezier(.35, 0, .25, 1);
		}

		.rd-range__pointer {
			display: flex;
			align-items: center;
			justify-content: center;
			position: absolute;
			top: -38px;
			width: 28px;
			height: 28px;
			border-radius: 28px;
			transform: scale(.45) translate3d(0, 67.5px, 0);
			transition: transform .3s cubic-bezier(.35, 0, .25, 1);

			&:before {
				content: none;
			}

			&:after {
				position: absolute;
				content: '';
				left: 0;
				border-radius: 16px;
				top: 19px;
				border-left: 14px solid transparent;
				border-right: 14px solid transparent;
				border-top: 16px solid $gray-900;
				opacity: 0;
				transform: translate3d(0, -8px, 0);
				transition: all .2s cubic-bezier(.35, 0, .25, 1);
			}

			&.active {
				opacity: 1;
				transform: translate3d(0, 0, 0) scale(1) translateX(-14px);

				&:after {
					opacity: 1;
					transform: translate3d(0, 0, 0) scale(1);
				}

				.rd-range__pointer-tooltip {
					opacity: 1;
				}
			}
		}
	}
}

.rd-range-value {
	display: flex;
	font-size: $font-size-sm;
}

.rd-range-form-wrap {
	display: flex;
	flex: 1;

	&:last-child {
		justify-content: flex-end;
	}
}

.rd-range-input {
	font-weight: inherit;
	border: none;
	padding: 0;
	color: inherit;
	background-color: transparent;
}
