@import '../style/index';

@raido-prefix-cls: ~'@{prefix}-radio';

@normal-color: @color-gray5;
@normal-text-color: #666;
@checked-color: #00AAF1;
@disabled-color: #DDD;
@radio-bg-color: #FFF;
@radio-disabled-bg-color: #EEE;

@radio-size: 14px;

.@{raido-prefix-cls}-position {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
}
.abs(){
    position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
}

.@{raido-prefix-cls} {

	display: inline-flex;
	align-items: center;
	margin-right: 8px;

	cursor: pointer;
	color: @normal-color;

	&-group {
		display: inline-flex;
		&.vertical {
			flex-direction: column;
		}
		&.horizontal {
			flex-direction: row;
		}
	}

	&-wrapper {
		position: relative;
		width: @radio-size;
		height: @radio-size;

		margin-right: 5px;

		&:hover {
			color: @checked-color;
		}
	}

	&-input {
		opacity: 0;
		cursor: pointer;

		&:checked + .@{raido-prefix-cls}-inner {
			color: @checked-color;

			&::after{
                .abs();
				content: '';
				background-color: currentColor;
				width: 10px;
				height: 10px;
				margin-left: 1px;
				margin-top: 1px;
				border: none;
				box-shadow: 0 0 5px currentColor;
				animation: fadeIn 300ms ease-out both;
				border-radius: 50%;
			}
		}

		&:disabled, &:disabled + .@{raido-prefix-cls}-inner {
			.disabled;
		}

		&[disabled]:not(:checked) + .@{raido-prefix-cls}-inner {
			background-color: @radio-disabled-bg-color;
		}
	}

	&-inner {
        .abs();
		z-index: -1;
		border-radius: 50%;
		border: 1px solid currentColor;
		background-color: @radio-bg-color;
	}

	&-text {
		color: @normal-text-color;
	}

	.disabled {
		cursor: not-allowed;
		color: @disabled-color;
	}

	@keyframes fadeIn {
		from {
			box-shadow: 0 0 5px currentColor;
			transform: scale(0.5);
		}

		to {
			box-shadow: none;
			transform: scale(1);
		}
	}
}



