/* نظرات CRM — گرادیان، پاسخ تو در تو، لایک/دیس‌لایک */

.wpcustomcrm-comments {
	--wpcrm-cm-a1: #6366f1;
	--wpcrm-cm-a2: #a855f7;
	--wpcrm-cm-a3: #ec4899;
	--wpcrm-cm-a4: #22d3ee;
	--wpcrm-cm-surface: #ffffff;
	--wpcrm-cm-text: #1e293b;
	--wpcrm-cm-muted: #64748b;
	margin: 2em 0;
	font-family: inherit;
}

.wpcustomcrm-comments__frame {
	padding: 3px;
	border-radius: 22px;
	background: linear-gradient(125deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a2), var(--wpcrm-cm-a3), var(--wpcrm-cm-a4), var(--wpcrm-cm-a1));
	background-size: 320% 320%;
	animation: wpcrm-cm-border 20s ease-in-out infinite;
	box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.wpcustomcrm-comments__inner {
	padding: 22px 20px;
	border-radius: 19px;
	background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
	position: relative;
	overflow: hidden;
}

.wpcustomcrm-comments__inner::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 70% 50% at 100% 0%, rgba(99, 102, 241, 0.07), transparent 50%),
		radial-gradient(ellipse 50% 40% at 0% 100%, rgba(236, 72, 153, 0.06), transparent 45%);
	pointer-events: none;
}

.wpcustomcrm-comments__header {
	position: relative;
	z-index: 1;
	margin-bottom: 16px;
}

.wpcustomcrm-comments__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	background: linear-gradient(90deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.wpcustomcrm-comments__guest {
	position: relative;
	z-index: 1;
	padding: 16px 18px;
	margin-bottom: 18px;
	border-radius: 14px;
	background: linear-gradient(110deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.1));
	border: 1px solid rgba(99, 102, 241, 0.25);
	text-align: center;
	animation: wpcrm-cm-banner 14s ease-in-out infinite;
	background-size: 200% 200%;
}

.wpcustomcrm-comments__guest-text {
	margin: 0 0 10px;
	font-weight: 600;
	color: var(--wpcrm-cm-text);
}

.wpcustomcrm-comments__guest-link {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a2));
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpcustomcrm-comments__guest-link:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(168, 85, 247, 0.4);
	color: #fff;
}

.wpcustomcrm-comments__welcome {
	position: relative;
	z-index: 1;
	margin-bottom: 14px;
	padding: 14px 16px;
	border-radius: 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.65;
	color: var(--wpcrm-cm-text);
	background: linear-gradient(110deg, rgba(99, 102, 241, 0.1), rgba(34, 211, 238, 0.08));
	border: 1px solid rgba(99, 102, 241, 0.2);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.wpcustomcrm-comments__form {
	position: relative;
	z-index: 1;
	margin-bottom: 20px;
}

.wpcustomcrm-comments__input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid rgba(99, 102, 241, 0.25);
	border-radius: 12px;
	font-family: inherit;
	font-size: 15px;
	resize: vertical;
	min-height: 88px;
	background: rgba(255, 255, 255, 0.9);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wpcustomcrm-comments__input:focus {
	outline: none;
	border-color: var(--wpcrm-cm-a2);
	box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.wpcustomcrm-comments__submit {
	margin-top: 10px;
	padding: 10px 22px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a3));
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.wpcustomcrm-comments__submit:hover {
	transform: translateY(-1px);
	opacity: 0.95;
}

.wpcustomcrm-comments__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.wpcustomcrm-comments__thread-wrap {
	position: relative;
	z-index: 1;
}

.wpcustomcrm-comments__loading {
	text-align: center;
	color: var(--wpcrm-cm-muted);
	padding: 12px;
}

.wpcustomcrm-comments__thread {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpcustomcrm-comments__thread--empty {
	padding: 16px;
	text-align: center;
	color: var(--wpcrm-cm-muted);
	font-size: 14px;
}

.wpcustomcrm-comments__item {
	margin: 0 0 14px;
	padding: 0;
}

.wpcustomcrm-comments__card {
	padding: 14px 16px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(226, 232, 240, 0.95);
	backdrop-filter: blur(4px);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wpcustomcrm-comments__item:hover > .wpcustomcrm-comments__card {
	border-color: rgba(99, 102, 241, 0.35);
	box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.wpcustomcrm-comments__item--highlight > .wpcustomcrm-comments__card {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35), 0 8px 24px rgba(99, 102, 241, 0.15);
	animation: wpcrm-cm-comment-highlight 2.5s ease;
}

@keyframes wpcrm-cm-comment-highlight {
	0%,
	15% {
		background: rgba(238, 242, 255, 0.95);
	}
	100% {
		background: rgba(255, 255, 255, 0.85);
	}
}

.wpcustomcrm-comments__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.wpcustomcrm-comments__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.wpcustomcrm-comments__author {
	font-weight: 700;
	color: var(--wpcrm-cm-text);
	font-size: 14px;
}

.wpcustomcrm-comments__date {
	font-size: 12px;
	color: var(--wpcrm-cm-muted);
	margin-inline-start: auto;
}

.wpcustomcrm-comments__body {
	font-size: 15px;
	line-height: 1.7;
	color: var(--wpcrm-cm-text);
}

.wpcustomcrm-comments__body p {
	margin: 0 0 8px;
}

.wpcustomcrm-comments__body p:last-child {
	margin-bottom: 0;
}

.wpcustomcrm-comments__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.wpcustomcrm-comments__btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 12px;
	border: 1px solid rgba(148, 163, 184, 0.4);
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	color: var(--wpcrm-cm-muted);
	cursor: pointer;
	transition: all 0.25s ease;
}

.wpcustomcrm-comments__btn:hover {
	border-color: var(--wpcrm-cm-a1);
	color: var(--wpcrm-cm-a1);
}

.wpcustomcrm-comments__btn--like.is-active {
	background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(34, 211, 238, 0.12));
	border-color: #22c55e;
	color: #15803d;
}

.wpcustomcrm-comments__btn--dislike.is-active {
	background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), rgba(236, 72, 153, 0.1));
	border-color: #ef4444;
	color: #b91c1c;
}

.wpcustomcrm-comments__btn--reply {
	border-color: rgba(99, 102, 241, 0.35);
	color: var(--wpcrm-cm-a1);
}

.wpcustomcrm-comments__children {
	list-style: none;
	margin: 12px 0 0;
	padding: 0 0 0 16px;
	border-right: 3px solid;
	border-image: linear-gradient(180deg, var(--wpcrm-cm-a2), var(--wpcrm-cm-a4)) 1;
}

.wpcustomcrm-comments__children .wpcustomcrm-comments__children {
	border-right-color: rgba(168, 85, 247, 0.5);
}

.wpcustomcrm-comments__reply-form {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed rgba(148, 163, 184, 0.5);
}

.wpcustomcrm-comments__reply-form[hidden] {
	display: none !important;
}

.wpcustomcrm-comments__notice {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 14px;
}

.wpcustomcrm-comments__notice--ok {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.wpcustomcrm-comments__notice--err {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/* مودال مهمان (لایک / دیس‌لایک) */
body.wpcustomcrm-comments-modal-open {
	overflow: hidden;
}

.wpcustomcrm-comments__modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.45s ease, visibility 0.45s ease;
}

.wpcustomcrm-comments__modal.is-visible {
	opacity: 1;
	visibility: visible;
}

.wpcustomcrm-comments__modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
}

.wpcustomcrm-comments__modal-card {
	position: relative;
	z-index: 2;
	max-width: 420px;
	width: 100%;
	padding: 28px 24px 22px;
	border-radius: 20px;
	text-align: center;
	background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
	border: 2px solid transparent;
	background-clip: padding-box;
	box-shadow: 0 20px 50px rgba(99, 102, 241, 0.25);
	transform: translateY(12px) scale(0.96);
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.wpcustomcrm-comments__modal.is-visible .wpcustomcrm-comments__modal-card {
	transform: translateY(0) scale(1);
}

.wpcustomcrm-comments__modal-card::before {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: inherit;
	background: linear-gradient(125deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a2), var(--wpcrm-cm-a3), var(--wpcrm-cm-a4));
	z-index: -1;
}

.wpcustomcrm-comments__modal-glow {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.2), transparent 55%);
	pointer-events: none;
}

.wpcustomcrm-comments__modal-title {
	margin: 0 0 10px;
	font-size: 1.15rem;
	font-weight: 800;
	background: linear-gradient(90deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a3));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.wpcustomcrm-comments__modal-text {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--wpcrm-cm-muted);
}

.wpcustomcrm-comments__modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.wpcustomcrm-comments__modal-register {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a2));
	color: #fff !important;
	text-decoration: none;
	font-weight: 700;
}

.wpcustomcrm-comments__modal-close {
	padding: 10px 18px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	color: var(--wpcrm-cm-muted);
}

.wpcustomcrm-comments__btn--react-guest {
	cursor: pointer;
}

.wpcustomcrm-comments__btn--react-guest:hover {
	border-color: var(--wpcrm-cm-a2);
	color: var(--wpcrm-cm-a2);
}

/* پاپ‌آپ دعوت به نظر — ثابت روی viewport (منتقل‌شده به body) */
body.wpcustomcrm-comments-prompt-open {
	overflow: hidden;
}

.wpcustomcrm-comments__prompt {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.65s ease, visibility 0.65s ease;
}

.wpcustomcrm-comments__prompt.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.wpcustomcrm-comments__prompt-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.42);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.65s ease;
}

.wpcustomcrm-comments__prompt.is-visible .wpcustomcrm-comments__prompt-backdrop {
	opacity: 1;
}

.wpcustomcrm-comments__prompt-card {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 440px;
	padding: 24px 22px 20px;
	border-radius: 20px;
	background: linear-gradient(155deg, #fff 0%, #f0f9ff 100%);
	box-shadow: 0 24px 60px rgba(99, 102, 241, 0.28);
	overflow: hidden;
	transform: translateY(20px) scale(0.94);
	opacity: 0;
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease;
}

.wpcustomcrm-comments__prompt.is-visible .wpcustomcrm-comments__prompt-card {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.wpcustomcrm-comments__prompt-card::before {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: inherit;
	background: linear-gradient(120deg, var(--wpcrm-cm-a1), var(--wpcrm-cm-a2), var(--wpcrm-cm-a4));
	z-index: -1;
}

.wpcustomcrm-comments__prompt-glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(168, 85, 247, 0.12), transparent);
	pointer-events: none;
	animation: wpcrm-cm-prompt-glow 6s ease-in-out infinite;
}

.wpcustomcrm-comments__prompt-text {
	position: relative;
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.65;
	color: var(--wpcrm-cm-text);
	text-align: center;
}

.wpcustomcrm-comments__prompt-actions {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.wpcustomcrm-comments__prompt-yes,
.wpcustomcrm-comments__prompt-no {
	padding: 9px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wpcustomcrm-comments__prompt-yes {
	background: linear-gradient(90deg, #4f46e5, #7c3aed);
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.wpcustomcrm-comments__prompt-no {
	background: #fff;
	color: #334155 !important;
	border: 1px solid #cbd5e1;
}

.wpcustomcrm-comments__prompt-yes:hover,
.wpcustomcrm-comments__prompt-no:hover {
	transform: translateY(-1px);
}

.wpcustomcrm-comments__prompt-yes:hover {
	color: #ffffff !important;
}

.wpcustomcrm-comments__form--prompt {
	position: relative;
	z-index: 2;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.wpcustomcrm-comments__form--prompt[hidden] {
	display: none !important;
}

.wpcustomcrm-comments__prompt .wpcustomcrm-comments__input--prompt {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 12px;
	background: #fff;
	border: 1px solid #cbd5e1;
	color: #1e293b;
}

.wpcustomcrm-comments__prompt-form-actions {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 4px;
}

/* دکمه ثبت در پاپ‌آپ — اولویت بالا در برابر استایل قالب */
.wpcustomcrm-comments__prompt .wpcustomcrm-comments__submit,
.wpcustomcrm-comments__prompt .wpcustomcrm-comments__submit--prompt,
.wpcustomcrm-comments__prompt button[type="submit"] {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
	margin-top: 0 !important;
	padding: 12px 28px !important;
	border: none !important;
	border-radius: 999px !important;
	background: linear-gradient(90deg, #4f46e5, #7c3aed) !important;
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
	cursor: pointer !important;
	box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) !important;
}

.wpcustomcrm-comments__prompt .wpcustomcrm-comments__submit:hover,
.wpcustomcrm-comments__prompt button[type="submit"]:hover {
	transform: translateY(-1px) !important;
	filter: brightness(1.05) !important;
	color: #ffffff !important;
}

@keyframes wpcrm-cm-prompt-glow {
	0%,
	100% {
		opacity: 0.5;
	}
	50% {
		opacity: 1;
	}
}

@keyframes wpcrm-cm-border {
	0%,
	100% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
}

@keyframes wpcrm-cm-banner {
	0%,
	100% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpcustomcrm-comments__frame,
	.wpcustomcrm-comments__guest,
	.wpcustomcrm-comments__prompt-glow {
		animation: none;
	}

	.wpcustomcrm-comments__modal,
	.wpcustomcrm-comments__modal-card,
	.wpcustomcrm-comments__prompt {
		transition: none;
	}
}
