/* Before & After Comparison Section */
.before-after-section,
.comparison-section {
	position: relative;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(3rem, 6vh, 6rem) 1.5rem;
	box-sizing: border-box;
	background: linear-gradient(
		180deg,
		var(--color-deep-dark-blue) 0%,
		#0d1220 45%,
		var(--color-deep-dark-blue) 100%
	);
}

.before-after__inner,
.comparison__inner {
	max-width: var(--hero-max-width);
	margin: 0 auto;
	width: 100%;
}

.before-after__header {
	direction: rtl;
	text-align: center;
	margin-bottom: 3rem;
}

.before-after__title {
	margin: 0 0 0.75rem;
	font-family: var(--font-arabic);
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 700;
	color: var(--text-primary);
}

.before-after__subtitle {
	margin: 0 auto;
	max-width: 52ch;
	font-family: var(--font-arabic);
	font-size: clamp(1rem, 2vw, 1.15rem);
	color: var(--text-muted);
	line-height: 1.7;
}

.comparison-slider {
	position: relative;
	--comparison-position: 50%;
	width: 100%;
	max-width: 1000px;
	height: 500px;
	margin: 0 auto;
	overflow: hidden;
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: var(--shadow-hero);
	user-select: none;
	-webkit-user-select: none;
	cursor: ew-resize;
	direction: ltr;
}

@media (max-height: 800px) {
	.before-after-section .before-after__title,
	.comparison-section .section-header h2 {
		font-size: clamp(1.8rem, 4vh, 3rem) !important;
		margin-bottom: clamp(0.5rem, 2vh, 1.5rem);
	}

	.before-after-section .before-after__subtitle,
	.comparison-section .section-header p {
		margin-bottom: clamp(1.5rem, 3vh, 3rem);
		font-size: clamp(0.9rem, 2vh, 1.1rem);
	}

	.comparison-slider,
	.comparison-container {
		height: clamp(250px, 55vh, 500px) !important;
		margin: 0 auto;
	}

	.before-after__inner,
	.comparison__inner {
		gap: clamp(1rem, 3vh, 2rem);
		display: flex;
		flex-direction: column;
	}
}

@media (max-width: 768px) {
	.before-after-section,
	.comparison-section {
		min-height: auto;
		padding: 4rem 1.5rem;
	}

	.comparison-slider,
	.comparison-container {
		height: 350px !important;
	}
}

.comparison-before,
.comparison-after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.comparison-after {
	clip-path: inset(0 calc(100% - var(--comparison-position, 50%)) 0 0);
	z-index: 2;
}

.comparison-before {
	z-index: 1;
}

/* Micro-UI Browser Mockups */
.micro-browser {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	font-family: var(--font-english);
	direction: ltr;
}

.micro-browser__top {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 0.85rem;
	flex-shrink: 0;
}

.micro-browser__top .dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.micro-browser__top .address-bar {
	flex: 1;
	min-width: 0;
	padding: 0.4rem 0.75rem;
	font-size: 0.7rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border-radius: 6px;
}

.micro-browser__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

/* —— Bad Browser —— */
.micro-browser--bad {
	background: #16161a;
	border: 2px solid #333;
}

.micro-browser--bad .micro-browser__top {
	background: #1c1c20;
	border-bottom: 1px solid #333;
}

.micro-browser--bad .dot {
	background: #555;
}

.micro-browser--bad .address-bar {
	background: #111;
	color: #888;
	border: 1px solid #444;
}

.micro-browser--bad .micro-browser__body {
	padding: 1rem 1.1rem 1.25rem;
	animation: micro-glitch-shake 3.5s ease-in-out infinite;
}

.bad-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.bad-logo {
	width: 72px;
	height: 22px;
	background: #444;
	border: 1px solid #555;
	border-radius: 3px;
}

.bad-nav {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.bad-nav .line {
	display: block;
	width: 36px;
	height: 6px;
	background: #555;
	border-radius: 2px;
}

.bad-nav .line.misaligned {
	transform: translateY(4px) rotate(-3deg);
	background: #666;
}

.bad-content {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	flex: 1;
}

.error-banner {
	padding: 0.55rem 0.75rem;
	font-size: 0.72rem;
	font-weight: 700;
	color: #fff;
	background: #ff3333;
	border: 2px solid #cc0000;
	border-radius: 4px;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.25),
		0 4px 14px rgba(255, 51, 51, 0.35);
}

.broken-image-placeholder {
	position: relative;
	flex: 1;
	min-height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: repeating-linear-gradient(
		-45deg,
		#2a2a2a,
		#2a2a2a 8px,
		#333 8px,
		#333 16px
	);
	border: 2px dashed #555;
	border-radius: 4px;
}

.ugly-spinner {
	width: 36px;
	height: 36px;
	border: 4px solid #444;
	border-top-color: #888;
	border-radius: 50%;
	animation: micro-ugly-spin 0.85s linear infinite;
}

.bad-content .text-lines {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.bad-content .text-lines .line {
	height: 8px;
	background: #444;
	border-radius: 2px;
}

.bad-content .text-lines .line.short {
	width: 55%;
}

.analytics-report {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
	flex: 1;
	align-items: stretch;
	min-height: 0;
	padding: 0.85rem;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.12),
		0 18px 36px rgba(0, 0, 0, 0.28);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.analytics-report--lagging {
	background:
		linear-gradient(135deg, rgba(127, 29, 29, 0.32), rgba(41, 37, 36, 0.68)),
		rgba(255, 255, 255, 0.04);
	border-color: rgba(248, 113, 113, 0.2);
}

.analytics-report--optimized {
	background:
		linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(34, 197, 94, 0.12)),
		rgba(255, 255, 255, 0.06);
	border-color: rgba(103, 232, 249, 0.28);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.16),
		0 0 34px rgba(6, 182, 212, 0.16),
		0 18px 36px rgba(0, 0, 0, 0.28);
}

.analytics-gauge {
	--score: 50;
	--gauge-color: #f87171;
	--gauge-track: rgba(255, 255, 255, 0.12);
	position: relative;
	min-height: 132px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.75rem 0.45rem;
	border-radius: 12px;
	background: rgba(10, 12, 20, 0.42);
	border: 1px solid rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

.analytics-gauge__ring {
	position: absolute;
	inset-block-start: 0.85rem;
	inset-inline-start: 50%;
	inline-size: 72px;
	block-size: 72px;
	border-radius: 50%;
	transform: translateX(-50%);
	background:
		radial-gradient(circle at center, rgba(10, 12, 20, 0.94) 0 56%, transparent 57%),
		conic-gradient(var(--gauge-color) calc(var(--score) * 1%), var(--gauge-track) 0);
	box-shadow: 0 0 18px color-mix(in srgb, var(--gauge-color) 38%, transparent);
}

.analytics-gauge__value,
.analytics-gauge__label {
	position: relative;
	z-index: 1;
	font-family: var(--font-english);
	text-align: center;
}

.analytics-gauge__value {
	margin-block-start: 0.85rem;
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--text-primary);
}

.analytics-gauge--text .analytics-gauge__value {
	font-size: 0.82rem;
	line-height: 1.1;
}

.analytics-gauge__label {
	margin-block-start: 2.1rem;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.66);
}

.analytics-gauge--danger {
	--gauge-color: #ef4444;
}

.analytics-gauge--warning {
	--gauge-color: #f59e0b;
}

.analytics-gauge--success {
	--gauge-color: #22c55e;
	border-color: rgba(103, 232, 249, 0.18);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.14),
		0 0 22px rgba(6, 182, 212, 0.12);
	animation: optimized-gauge-pulse 2.4s ease-in-out infinite;
}

.analytics-gauge--success .analytics-gauge__value {
	color: #a7f3d0;
	text-shadow:
		0 0 10px rgba(34, 197, 94, 0.82),
		0 0 22px rgba(6, 182, 212, 0.48);
	font-variant-numeric: tabular-nums;
}

.analytics-gauge--success .analytics-gauge__ring {
	--gauge-color: #22c55e;
	background:
		radial-gradient(circle at center, rgba(10, 18, 24, 0.94) 0 56%, transparent 57%),
		conic-gradient(#22c55e 0 calc(var(--score) * 1%), #06b6d4 calc(var(--score) * 1%), var(--gauge-track) 0);
	box-shadow:
		0 0 20px rgba(34, 197, 94, 0.45),
		0 0 32px rgba(6, 182, 212, 0.24);
	animation: optimized-ring-sweep 1.4s ease-out both;
}

@keyframes optimized-gauge-pulse {
	0%,
	100% {
		transform: translateY(0);
		box-shadow:
			inset 0 1px 0 rgba(255, 255, 255, 0.14),
			0 0 22px rgba(6, 182, 212, 0.12);
	}

	50% {
		transform: translateY(-2px);
		box-shadow:
			inset 0 1px 0 rgba(255, 255, 255, 0.18),
			0 0 30px rgba(34, 197, 94, 0.2),
			0 0 42px rgba(6, 182, 212, 0.18);
	}
}

@keyframes optimized-ring-sweep {
	from {
		opacity: 0.35;
		transform: translateX(-50%) rotate(-70deg) scale(0.92);
	}

	to {
		opacity: 1;
		transform: translateX(-50%) rotate(0deg) scale(1);
	}
}

@keyframes micro-glitch-shake {
	0%,
	88%,
	100% {
		transform: translate(0, 0);
	}
	90% {
		transform: translate(-2px, 1px);
	}
	92% {
		transform: translate(2px, -1px);
	}
	94% {
		transform: translate(-1px, -2px);
	}
	96% {
		transform: translate(1px, 2px);
	}
}

@keyframes micro-ugly-spin {
	to {
		transform: rotate(360deg);
	}
}

/* —— Good Browser —— */
.micro-browser--good {
	position: relative;
	overflow: hidden;
	background: linear-gradient(
		165deg,
		var(--color-deep-dark-blue) 0%,
		#12182b 50%,
		#0f1424 100%
	);
	border: 1px solid rgba(167, 139, 250, 0.25);
	box-shadow: inset 0 0 60px rgba(124, 58, 237, 0.08);
}

.micro-browser--good::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(circle at 22% 18%, rgba(124, 58, 237, 0.42) 0%, transparent 48%),
		radial-gradient(circle at 78% 82%, rgba(6, 182, 212, 0.38) 0%, transparent 46%),
		radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.12) 0%, transparent 62%);
	animation: micro-good-radial 7s ease-in-out infinite alternate;
}

.micro-browser--good > * {
	position: relative;
	z-index: 1;
}

@keyframes micro-good-radial {
	0% {
		transform: scale(1) translate(0, 0);
		opacity: 0.85;
	}
	100% {
		transform: scale(1.08) translate(2%, -2%);
		opacity: 1;
	}
}

.micro-browser--good .micro-browser__top.glass {
	background: rgba(255, 255, 255, 0.06);
	border-bottom: 1px solid var(--glass-border);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.micro-browser--good .dot.red {
	background: #ff5f57;
}

.micro-browser--good .dot.yellow {
	background: #febc2e;
}

.micro-browser--good .dot.green {
	background: #28c840;
}

.micro-browser--good .address-bar.glass {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
	background: rgba(255, 255, 255, 0.08);
	color: #a5f3fc;
	border: 1px solid rgba(6, 182, 212, 0.35);
	text-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.micro-browser--good .lock {
	font-size: 0.65rem;
	flex-shrink: 0;
}

.micro-browser--good .micro-browser__body {
	padding: 1.1rem 1.25rem 1.35rem;
}

.good-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.good-logo {
	width: 80px;
	height: 24px;
	border-radius: 6px;
	background: linear-gradient(135deg, var(--color-electric-purple), #06b6d4);
}

.good-logo.glow {
	box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.good-nav {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.good-nav .line {
	display: block;
	width: 32px;
	height: 5px;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 3px;
}

.good-nav .btn-mini {
	width: 48px;
	height: 22px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--color-electric-purple), var(--color-accent-purple-glow));
	box-shadow: 0 0 14px rgba(124, 58, 237, 0.45);
}

.good-content {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	flex: 1;
}

.success-banner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.85rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #86efac;
	background: rgba(34, 197, 94, 0.12);
	border: 1px solid rgba(74, 222, 128, 0.35);
	border-radius: 8px;
	text-shadow:
		0 0 8px rgba(74, 222, 128, 0.8),
		0 0 16px rgba(34, 197, 94, 0.4);
}

.success-banner.glow {
	box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 10px #4ade80;
	animation: micro-status-pulse 1.5s ease-in-out infinite;
}

.bento-micro {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 0.75rem;
	flex: 1;
	min-height: 0;
}

.bento-micro .bento-box {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0.85rem;
	min-height: 100px;
	border-radius: 12px;
}

.bento-micro .glass-card {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(167, 139, 250, 0.3);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.12),
		inset 0 -8px 24px rgba(124, 58, 237, 0.12),
		0 8px 24px rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.bento-micro .glow-border {
	border-color: rgba(6, 182, 212, 0.45);
	box-shadow:
		inset 0 0 20px rgba(6, 182, 212, 0.15),
		0 0 24px rgba(6, 182, 212, 0.2);
}

.chart-bars {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	height: 72px;
}

.chart-bars .bar {
	display: block;
	width: 14px;
	border-radius: 4px 4px 0 0;
	background: linear-gradient(180deg, var(--color-accent-purple-glow), var(--color-electric-purple));
	box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
	transform-origin: bottom;
	animation: micro-bar-rise 1.2s ease-out forwards;
}

.chart-bars .bar.h-60 {
	height: 36px;
	animation-delay: 0.1s;
}

.chart-bars .bar.h-80 {
	height: 52px;
	animation-delay: 0.25s;
}

.chart-bars .bar.h-100 {
	height: 64px;
	animation-delay: 0.4s;
}

.live-visitors {
	font-family: var(--font-english);
	font-size: 0.95rem;
	font-weight: 700;
	color: #67e8f9;
	text-align: center;
	text-shadow:
		0 0 10px rgba(6, 182, 212, 0.9),
		0 0 22px rgba(124, 58, 237, 0.5);
}

@keyframes micro-status-pulse {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.7;
		transform: scale(1.15);
	}
}

@keyframes micro-bar-rise {
	from {
		transform: scaleY(0);
		opacity: 0.4;
	}
	to {
		transform: scaleY(1);
		opacity: 1;
	}
}

/* Comparison Handle (visual only — pointer events pass through to slider) */
.comparison-handle {
	position: absolute;
	inset-inline-start: var(--comparison-position, 50%);
	top: 0;
	bottom: 0;
	width: 0;
	background: none;
	transform: none;
	z-index: 999;
	pointer-events: none;
}

.handle-line {
	position: absolute;
	top: 0;
	bottom: 0;
	inset-inline-start: 0;
	width: 2px;
	background: rgba(255, 255, 255, 0.3);
	transform: translateX(-50%);
	pointer-events: none;
}

.handle-button {
	position: absolute;
	top: 50%;
	inset-inline-start: 0;
	width: 50px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	font-weight: 700;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 18px;
	box-shadow:
		0 0 24px rgba(124, 58, 237, 0.45),
		0 8px 24px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transform: translate(-50%, -50%);
	transition: transform 0.25s ease;
	animation: handle-pulse 2s infinite;
	pointer-events: none;
}

.handle-button::before {
	content: 'اسحب';
	position: absolute;
	top: -35px;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	padding: 2px 8px;
	font-family: var(--font-arabic);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #fff;
	white-space: nowrap;
	background: rgba(18, 18, 22, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 4px;
	pointer-events: none;
}

.handle-button::after {
	content: '';
	position: absolute;
	top: -11px;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	border-inline-start: 5px solid transparent;
	border-inline-end: 5px solid transparent;
	border-top: 5px solid rgba(18, 18, 22, 0.95);
	pointer-events: none;
}

.handle-button svg {
	display: block;
	flex-shrink: 0;
}

@keyframes handle-pulse {
	0% {
		box-shadow:
			0 0 0 0 rgba(255, 255, 255, 0.4),
			0 0 24px rgba(124, 58, 237, 0.45),
			0 8px 24px rgba(0, 0, 0, 0.35),
			inset 0 1px 0 rgba(255, 255, 255, 0.2);
	}
	70% {
		box-shadow:
			0 0 0 15px rgba(255, 255, 255, 0),
			0 0 24px rgba(124, 58, 237, 0.45),
			0 8px 24px rgba(0, 0, 0, 0.35),
			inset 0 1px 0 rgba(255, 255, 255, 0.2);
	}
	100% {
		box-shadow:
			0 0 0 0 rgba(255, 255, 255, 0),
			0 0 24px rgba(124, 58, 237, 0.45),
			0 8px 24px rgba(0, 0, 0, 0.35),
			inset 0 1px 0 rgba(255, 255, 255, 0.2);
	}
}

.comparison-handle:hover .handle-button {
	box-shadow:
		0 0 32px rgba(167, 139, 250, 0.65),
		0 10px 28px rgba(0, 0, 0, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.28);
	transform: translate(-50%, -50%) scale(1.06);
}

/* Interactive Site Builder Section */
