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

.orion-datepicker {
	.orion-input__input {
		min-height: 2.5rem;
		height: auto;
	}

	&__timepicker-wrapper {
		display: flex;
	}

	&-multiple {
		display: flex;
		align-items: center;
		gap: var(--space-xs);

		.orion-input__pictos {
			top: calc(50% - 1.20rem);
		}

		.orion-input__input {
			padding: var(--space-xs);
			align-items: center;

			display: flex;
		}

		.orion-label {
			height: 1.25rem;
			display: flex;
			align-items: center;
		}

		&__content {
			height: 100%;
			display: flex;
			flex-wrap: wrap;
			gap: var(--space-xs);
			align-items: center;
		}

		&__clearable {
			.flex-align();
			-webkit-tap-highlight-color: transparent;
			transition: all 0.3s;
			font-size: 1rem;
			opacity: 0.7;
			cursor: pointer;
			margin: 0.125rem;
			pointer-events: all;
		
			&::before {
				content: '\00D7';
				font-weight: 600;
				transform: translateY(-0.0625rem);
			}
		
			&:hover {
				opacity: 1;
				color: var(--grey-darker);
				border-color: var(--grey-dark);
				transform: rotate(90deg);
			}
		}
	}
}


.orion-datepicker-timepicker {
	--picker-height: 8rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.125rem;
	width: 9rem;

	&__hours,
	&__minutes {
		display: flex;
		flex-direction: column;
		width: 2.5rem;
		height: var(--picker-height);
		border-radius: 0.25rem;
		overflow: auto;
		scroll-snap-type: y mandatory;

		&::-webkit-scrollbar {
			display: none;
		}
	}

	&__scroll-item {
		--factor: 1;
		transition: font-size 16ms, opacity 16ms;
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		scroll-snap-align: center;
		flex: 0 0 calc(var(--picker-height) / 5);
		min-width: 1px;
		font-size: calc(1.75rem * var(--factor));
		opacity: calc(1 * var(--factor));
		line-height: 1;
	}

	&__separator {
		font-weight: bold;
		font-size: 1rem;
	}

	&__scroll-filler {
		flex: 0 0 calc(var(--picker-height) / 5 * 2);
	}

	&__meridian {
		padding-left: 0.5rem;
		font-weight: 600;

		> .active {
			color: var(--brand);
		}
	}
}

.orion-datepicker-timepicker-actions {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--space-xs);
	flex: 1;
	padding: 1rem;

	.orion-input__input {
		text-align: center;
		font-weight: 600;
	}
}
