/**
 * Smart Review & Analytics — Premium Responsive Popup UI
 * Scoped under #sra-popup-root to prevent theme conflicts.
 */

#sra-popup-root,
#sra-popup-root * {
	box-sizing: border-box;
}

#sra-popup-root .sra-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.35s ease;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

#sra-popup-root .sra-popup-overlay--visible {
	opacity: 1;
}

#sra-popup-root .sra-popup {
	background: #ffffff;
	border-radius: 24px;
	max-width: 440px;
	width: 100%;
	overflow: hidden;
	position: relative;
	box-shadow:
		0 32px 64px -16px rgba(0, 0, 0, 0.28),
		0 0 0 1px rgba(255, 255, 255, 0.06);
	transform: translateY(32px) scale(0.95);
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#sra-popup-root .sra-popup-overlay--visible .sra-popup {
	transform: translateY(0) scale(1);
}

/* Close */
#sra-popup-root .sra-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 10;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: none;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: background 0.2s, color 0.2s, transform 0.2s;
	line-height: 0;
}

#sra-popup-root .sra-popup__close:hover {
	background: #fff;
	color: #0f172a;
	transform: scale(1.08);
}

#sra-popup-root .sra-popup__close svg {
	width: 18px;
	height: 18px;
	display: block;
}

/* Header */
#sra-popup-root .sra-popup__header {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
	padding: 36px 28px 28px;
	text-align: center;
	color: #fff;
	position: relative;
}

#sra-popup-root .sra-popup__header::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	right: 0;
	height: 24px;
	background: #fff;
	border-radius: 24px 24px 0 0;
}

#sra-popup-root .sra-popup__header-inner {
	position: relative;
	z-index: 1;
}

#sra-popup-root .sra-popup__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 100px;
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 14px;
	letter-spacing: 0.02em;
}

#sra-popup-root .sra-popup__title {
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.03em;
	color: #ffffff;
}

#sra-popup-root .sra-popup__desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.88);
	max-width: 320px;
	margin-left: auto;
	margin-right: auto;
}

/* Content */
#sra-popup-root .sra-popup__content {
	padding: 8px 24px 24px;
}

#sra-popup-root .sra-popup__rating-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 20px 16px 16px;
	text-align: center;
	margin-bottom: 0;
}

#sra-popup-root .sra-popup__hint {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
}

#sra-popup-root .sra-popup__stars {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 10px;
}

#sra-popup-root .sra-popup__star {
	width: 48px;
	height: 48px;
	padding: 0;
	margin: 0;
	border: 2px solid #e2e8f0;
	border-radius: 14px;
	background: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
	line-height: 0;
	flex-shrink: 0;
}

#sra-popup-root .sra-popup__star svg {
	width: 26px;
	height: 26px;
	fill: #cbd5e1;
	transition: fill 0.2s, transform 0.2s;
}

#sra-popup-root .sra-popup__star:hover,
#sra-popup-root .sra-popup__star.hover {
	border-color: #fcd34d;
	background: #fffbeb;
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(245, 158, 11, 0.2);
}

#sra-popup-root .sra-popup__star:hover svg,
#sra-popup-root .sra-popup__star.hover svg {
	fill: #fbbf24;
}

#sra-popup-root .sra-popup__star.active {
	border-color: #f59e0b;
	background: linear-gradient(145deg, #fffbeb, #fef3c7);
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

#sra-popup-root .sra-popup__star.active svg {
	fill: #f59e0b;
}

#sra-popup-root .sra-popup__rating-label {
	margin: 0;
	min-height: 20px;
	font-size: 14px;
	font-weight: 600;
	color: #f59e0b;
	transition: opacity 0.2s;
}

/* Progressive form reveal */
#sra-popup-root .sra-popup__extras {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease, margin 0.35s ease;
	margin-top: 0;
}

#sra-popup-root .sra-popup__extras--visible {
	max-height: 600px;
	opacity: 1;
	margin-top: 16px;
}

#sra-popup-root .sra-popup__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#sra-popup-root .sra-popup__field {
	position: relative;
}

#sra-popup-root .sra-popup__field-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #94a3b8;
	pointer-events: none;
	display: flex;
	align-items: center;
}

#sra-popup-root .sra-popup__field-icon--textarea {
	top: 16px;
	transform: none;
}

#sra-popup-root .sra-popup__input {
	width: 100%;
	padding: 14px 14px 14px 44px;
	margin: 0;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	font-size: 15px;
	font-family: inherit;
	line-height: 1.4;
	color: #0f172a;
	background: #ffffff;
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

#sra-popup-root textarea.sra-popup__input {
	padding-top: 14px;
	min-height: 88px;
	resize: vertical;
}

#sra-popup-root .sra-popup__input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

#sra-popup-root .sra-popup__input::placeholder {
	color: #94a3b8;
}

/* Button */
#sra-popup-root .sra-popup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 15px 24px;
	margin: 0;
	border: none;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	line-height: 1.2;
}

#sra-popup-root .sra-popup__btn--primary {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	color: #ffffff !important;
	box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
	margin-top: 4px;
}

#sra-popup-root .sra-popup__btn--primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
	color: #ffffff !important;
}

#sra-popup-root .sra-popup__btn--primary:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

#sra-popup-root .sra-popup__btn--block {
	width: 100%;
}

#sra-popup-root .sra-popup__btn--outline {
	background: #fff;
	border: 2px dashed #c7d2fe;
	color: #4f46e5 !important;
}

/* Coupon */
#sra-popup-root .sra-popup__coupon {
	background: linear-gradient(135deg, #eef2ff, #faf5ff);
	border-radius: 16px;
	padding: 24px;
	text-align: center;
	border: 1px solid #e0e7ff;
}

#sra-popup-root .sra-popup__coupon-code {
	display: block;
	font-size: 30px;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: #4f46e5;
	margin-bottom: 14px;
	font-family: ui-monospace, 'SF Mono', monospace;
}

/* Thank you */
#sra-popup-root .sra-popup__thanks {
	display: none;
	text-align: center;
	padding: 32px 16px;
}

#sra-popup-root .sra-popup__thanks--show {
	display: block;
}

#sra-popup-root .sra-popup__check {
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, #10b981, #059669);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	margin: 0 auto 16px;
	animation: sraCheckPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sraCheckPop {
	from { transform: scale(0) rotate(-20deg); opacity: 0; }
	to { transform: scale(1) rotate(0); opacity: 1; }
}

#sra-popup-root .sra-popup__thanks p {
	font-size: 17px;
	font-weight: 600;
	color: #059669;
	margin: 0;
}

/* Hero image variant */
#sra-popup-root .sra-popup__hero {
	height: 160px;
	background-size: cover;
	background-position: center;
	background-color: #f1f5f9;
}

#sra-popup-root .sra-popup--has-hero .sra-popup__header {
	padding-top: 28px;
}

/* GDPR */
#sra-popup-root .sra-popup--gdpr .sra-popup__content {
	padding: 32px 24px;
	text-align: center;
}

/* Hide content when thanks shown */
#sra-popup-root .sra-popup--submitted .sra-popup__rating-card,
#sra-popup-root .sra-popup--submitted .sra-popup__extras {
	display: none;
}

/* ── Mobile: bottom sheet ── */
@media (max-width: 640px) {
	#sra-popup-root .sra-popup-overlay {
		align-items: flex-end;
		padding: 0;
	}

	#sra-popup-root .sra-popup {
		max-width: 100%;
		border-radius: 24px 24px 0 0;
		transform: translateY(100%);
	}

	#sra-popup-root .sra-popup-overlay--visible .sra-popup {
		transform: translateY(0);
	}

	#sra-popup-root .sra-popup__header {
		padding: 28px 20px 24px;
	}

	#sra-popup-root .sra-popup__title {
		font-size: 21px;
	}

	#sra-popup-root .sra-popup__content {
		padding: 8px 16px 28px;
		padding-bottom: max(28px, env(safe-area-inset-bottom));
	}

	#sra-popup-root .sra-popup__star {
		width: 44px;
		height: 44px;
		border-radius: 12px;
	}

	#sra-popup-root .sra-popup__star svg {
		width: 22px;
		height: 22px;
	}

	#sra-popup-root .sra-popup__stars {
		gap: 6px;
	}
}

/* ── Inline subscribe form shortcode ── */
.sra-inline-form {
	max-width: 480px;
	margin: 24px auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sra-inline-form__card {
	background: #fff;
	border-radius: 16px;
	padding: 28px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
	border: 1px solid #e2e8f0;
}

.sra-inline-form__title {
	margin: 0 0 8px;
	font-size: 22px;
	color: #1e293b;
	font-weight: 700;
}

.sra-inline-form__desc {
	margin: 0 0 20px;
	color: #64748b;
	font-size: 15px;
	line-height: 1.5;
}

.sra-inline-form__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sra-inline-form__input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.sra-inline-form__input:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.sra-inline-form__btn {
	width: 100%;
	padding: 13px;
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
}

.sra-inline-form__btn:hover {
	opacity: 0.92;
}

.sra-inline-form__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.sra-inline-form__success {
	text-align: center;
	padding: 20px 0;
}

.sra-inline-form__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: #d1fae5;
	color: #059669;
	border-radius: 50%;
	font-size: 24px;
	margin-bottom: 12px;
}

.sra-inline-form__success p {
	margin: 0;
	color: #059669;
	font-weight: 600;
	font-size: 16px;
}

@media (max-width: 360px) {
	#sra-popup-root .sra-popup__star {
		width: 38px;
		height: 38px;
	}

	#sra-popup-root .sra-popup__star svg {
		width: 20px;
		height: 20px;
	}
}
