/* =========================================================
   اُ زعفران | Recipe Rating
   Frontend visual styling only
   ========================================================= */

/* Base */
.os-recipe-rating-box,
.os-recipe-rating-box * {
	box-sizing: border-box;
}

.os-recipe-rating-box {
	--os-red: #e90018;
	--os-red-dark: #c40000;
	--os-red-soft: rgba(233, 0, 24, 0.08);
	--os-border: rgba(41, 39, 37, 0.10);
	--os-text: #292725;
	--os-muted: #817d77;

	direction: rtl;
	width: 100%;
	margin: 0;
	padding: 0;
	font-family: "Peyda", Peyda, Tahoma, sans-serif;
	color: var(--os-text);
	-webkit-font-smoothing: antialiased;
}

/* Buttons container */
.os-rating-buttons {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* Main button */
.os-recipe-rating-box .os-rating-btn {
	appearance: none;
	-webkit-appearance: none;
	flex: 1 1 0;
	min-width: 0;
	min-height: 56px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--os-border);
	border-radius: 15px;
	background-color: #ffffff;
	box-shadow: 0 2px 8px rgba(30, 25, 20, 0.04);
	color: var(--os-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	touch-action: manipulation;
	transition: all 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Future SVG icon slot */
.os-recipe-rating-box .os-rating-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	line-height: 0;
}

.os-recipe-rating-box .os-rating-icon svg,
.os-recipe-rating-box .os-rating-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Hover */
@media (hover: hover) and (pointer: fine) {
	.os-recipe-rating-box .os-rating-btn:hover {
		border-color: rgba(233, 0, 24, 0.25);
		background-color: #fff9f9;
		color: var(--os-red-dark);
		box-shadow: 0 6px 18px rgba(30, 25, 20, 0.06);
	}
}

/* Active / pressed */
.os-recipe-rating-box .os-rating-btn:active {
	transform: scale(0.985);
	box-shadow: 0 1px 6px rgba(30, 25, 20, 0.05);
}

/* Message */
.os-rating-message {
	min-height: 24px;
	margin: 12px 0 0;
	padding: 0;
	color: var(--os-muted);
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.65;
	text-align: center;
}

.os-rating-message.is-success,
.os-rating-message.is-success span {
	color: #32784a;
	font-weight: 500;
}

.os-rating-message.is-error,
.os-rating-message.is-error span {
	color: var(--os-red-dark);
	font-weight: 500;
}

/* Loading state */
.os-recipe-rating-box.is-loading .os-rating-btn,
.os-recipe-rating-box .os-rating-btn:disabled {
	opacity: 0.55;
	pointer-events: none;
	cursor: wait;
}

.os-recipe-rating-box.is-loading .os-rating-btn {
	animation: os-rating-loading 1.1s ease-in-out infinite;
}

@keyframes os-rating-loading {
	50% {
		opacity: 0.85;
	}
}

/* Focus */
.os-recipe-rating-box .os-rating-btn:focus-visible {
	outline: 2px solid rgba(233, 0, 24, 0.3);
	outline-offset: 3px;
}

/* Mobile */
@media (max-width: 640px) {
	.os-rating-buttons {
		gap: 8px;
	}

	.os-recipe-rating-box .os-rating-btn {
		min-height: 50px;
		padding: 9px 10px;
		font-size: 12.8px;
		gap: 6px;
	}

	.os-rating-message {
		margin-top: 9px;
		font-size: 12px;
	}

	.os-recipe-rating-box .os-rating-icon {
		flex-basis: 23px;
		width: 23px;
		height: 23px;
	}
}

/* Very small screens */
@media (max-width: 380px) {
	.os-rating-buttons {
		min-height: 6px;
	}

	.os-recipe-rating-box .os-rating-btn {
		min-height: 46px;
		padding: 8px 6px;
		font-size: 11.8px;
		gap: 5px;
	}

	.os-recipe-rating-box .os-rating-icon {
		flex-basis: 20px;
		width: 20px;
		height: 20px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.os-recipe-rating-box .os-rating-btn,
	.os-recipe-rating-box .os-rating-icon svg {
		transition: none;
	}

	.os-recipe-rating-box.is-loading .os-rating-btn {
		animation: none;
	}
}