/**
 * Comment Like Styles - TailwindCSS 4
 *
 * @package CommentLike
 */

/* Make both reply and like buttons inline so they sit side-by-side */
.comment-reply {
	display: inline-flex;
	align-items: center;
	margin-right: 12px;
}

.comment-like-wrapper {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-left: 16px;
	margin-top: -4px;
}

.comment-like-button {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	background-color: transparent;
	border: none;
	cursor: pointer;
	transition: color 0.2s ease-in-out;
	font-size: 0.75rem;
	line-height: 1rem;
	font-weight: 600;
}

.comment-like-button:focus-visible {
	outline: 2px solid rgb(242, 121, 108);
	outline-offset: 2px;
}

/* Icon container */
.comment-like-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	transition: transform 0.2s ease-in-out;
}

/* Hover state */
.comment-like-button:hover:not(:disabled) .comment-like-count,
.comment-like-button:hover:not(:disabled) .comment-like-label {
	color: rgb(242, 121, 108);
	background-color: transparent;
}

/* Disabled state */
.comment-like-button:disabled {
	cursor: not-allowed;
}

/* Liked state styling */
.comment-like-button.is-liked {
	color: rgb(242, 121, 108);
	background-color: transparent;
}

/* Liked state icon - coral outline */
.comment-like-button:hover:not(.is-liked) .comment-like-icon svg,
.comment-like-button.is-liked .comment-like-icon svg {
	stroke: rgb(242, 121, 108);
}

/* Count styling */
.comment-like-count {
	font-weight: 600;
	min-width: 1.5rem;
	text-align: left;
	display: inline;
	font-variant-numeric: tabular-nums;
}

.comment-like-count--hidden {
	display: none;
}

/* SVG styling */
.comment-like-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Liked button animation */
@keyframes pillPop {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.15);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes iconSpin {
	0% {
		transform: rotate(0deg) scale(1);
	}
	25% {
		transform: rotate(-10deg) scale(1.2);
	}
	50% {
		transform: rotate(10deg) scale(1.3);
	}
	75% {
		transform: rotate(-5deg) scale(1.2);
	}
	100% {
		transform: rotate(0deg) scale(1);
	}
}

.comment-like-button.just-liked {
	animation: pillPop 0.4s ease-in-out;
}

.comment-like-button.just-liked .comment-like-icon {
	animation: iconSpin 0.5s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 640px) {
	.comment-like-button {
		font-size: 0.75rem;
	}

	.comment-like-icon {
		width: 1rem;
		height: 1rem;
	}
}

/* High contrast mode */
@media (prefers-contrast: high) {
	.comment-like-button {
		border: none;
		background-color: transparent;
	}

	.comment-like-button:focus-visible {
		outline-width: 3px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.comment-like-button,
	.comment-like-icon {
		transition: none;
	}

	.comment-like-button:hover:not(:disabled) {
		transform: none;
	}

	.comment-like-button.just-liked,
	.comment-like-button.just-liked .comment-like-icon {
		animation: none;
	}
}

/* Print styles - hide interactive elements */
@media print {
	.comment-like-wrapper {
		display: none;
	}
}
