/* ==========================================================
   Star Rating Voting - Modern Responsive Style
   ========================================================== */

.srv-widget {
	--srv-star-color: #e2e2e2;
	--srv-star-active: #ffb400;
	--srv-primary: #6c5ce7;
	--srv-bg: #ffffff;
	--srv-text: #2d3436;
	--srv-radius: 14px;

	direction: rtl;
	font-family: inherit;
	max-width: 420px;
	margin: 0 auto;
	padding: 20px 22px;
	background: var(--srv-bg);
	border-radius: var(--srv-radius);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	text-align: center;
	transition: box-shadow 0.3s ease;
	box-sizing: border-box;
}

.srv-widget:hover {
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.srv-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--srv-text);
	margin-bottom: 12px;
}

/* ---------- Stars ---------- */
.srv-stars {
	display: flex;
	flex-direction: row-reverse; /* برای اینکه هاور از راست به چپ به‌درستی کار کند */
	justify-content: center;
	gap: 6px;
	margin-bottom: 14px;
	direction: ltr; /* حفظ ترتیب صحیح ستاره‌ها هنگام هاور */
}

.srv-star {
	font-size: 34px;
	line-height: 1;
	color: var(--srv-star-color);
	cursor: pointer;
	transition: transform 0.15s ease, color 0.15s ease;
	user-select: none;
}

.srv-star:hover,
.srv-star:focus {
	transform: scale(1.15);
	outline: none;
}

/* هایلایت ستاره‌های قبل از ستاره هاور شده */
.srv-stars:hover .srv-star {
	color: var(--srv-star-color);
}
.srv-star:hover ~ .srv-star,
.srv-star:hover {
	color: var(--srv-star-active);
}

.srv-star.srv-selected {
	color: var(--srv-star-active);
}

.srv-widget.srv-voted .srv-star,
.srv-widget.srv-loading .srv-star {
	pointer-events: none;
	opacity: 0.85;
}

/* ---------- Feedback message ---------- */
.srv-feedback {
	min-height: 20px;
	font-size: 13px;
	margin-bottom: 10px;
	font-weight: 500;
}

.srv-feedback.srv-success {
	color: #00b894;
}

.srv-feedback.srv-error {
	color: #d63031;
}

/* ---------- Stats ---------- */
.srv-stats {
	margin-top: 10px;
}

.srv-percent-bar {
	width: 100%;
	height: 10px;
	background: #eee;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 10px;
}

.srv-percent-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--srv-primary), var(--srv-star-active));
	border-radius: 999px;
	transition: width 0.6s ease;
}

.srv-stats-text {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	font-size: 13px;
	color: #636e72;
}

.srv-percent-label {
	font-weight: 700;
	color: var(--srv-primary);
}

.srv-already-voted-msg {
	margin-top: 10px;
	font-size: 12px;
	color: #00b894;
	font-weight: 600;
}

/* ---------- Loading state ---------- */
.srv-widget.srv-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
	.srv-widget {
		max-width: 100%;
		padding: 16px;
	}
	.srv-star {
		font-size: 28px;
	}
}
