/* ==========================================================================
   LL Testimonials — chat layout (1.1.0)
   Three phones; the centre one is in focus, the sides are smaller and faded.
   Brand header (maroon), WhatsApp bubbles and wallpaper.
   ========================================================================== */

.ll-chat {
	--ll-m: #890c25;
	--ll-deep: #5c0716;
	--ll-gold: #d9b779;
	--ll-out: #d9fdd3;
	--ll-wall: #efeae2;
	--ph-w: 300px;
	--ph-h: 600px;
	position: relative;
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(28px, 5vw, 56px) 0 clamp(24px, 4vw, 44px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
	overflow: hidden;
}

.ll-chat .ll-testi-pill {
	display: flex;
	width: fit-content;
	margin: 0 auto clamp(18px, 3vw, 34px);
	background: none;
	border: 0;
	padding: 0;
	color: #111;
}

/* ── stage ──────────────────────────────────────────────────────────────── */

.ll-chat__stage {
	position: relative;
	height: calc(var(--ph-h) + 20px);
	perspective: 1600px;
}

.ll-ph {
	--dir: 1;
	position: absolute;
	top: 10px;
	left: 50%;
	width: var(--ph-w);
	height: var(--ph-h);
	margin-left: calc(var(--ph-w) / -2);
	transition: transform 600ms cubic-bezier(.22, .8, .25, 1), opacity 600ms ease, filter 600ms ease;
	will-change: transform, opacity;
}

.ll-ph[data-pos="0"] {
	z-index: 3;
	transform: none;
	opacity: 1;
}

.ll-ph[data-pos="-1"],
.ll-ph[data-pos="1"] {
	z-index: 2;
	opacity: .42;
	filter: blur(.6px) saturate(.85);
	cursor: pointer;
}

.ll-ph[data-pos="-1"] { transform: translateX(calc(-112% * var(--dir))) scale(.84); }
.ll-ph[data-pos="1"]  { transform: translateX(calc(112% * var(--dir)))  scale(.84); }

.ll-ph[data-pos="-1"]:hover,
.ll-ph[data-pos="1"]:hover {
	opacity: .62;
}

.ll-ph[data-pos="-2"],
.ll-ph[data-pos="2"] {
	z-index: 1;
	opacity: 0;
	pointer-events: none;
}

.ll-ph[data-pos="-2"] { transform: translateX(calc(-190% * var(--dir))) scale(.7); }
.ll-ph[data-pos="2"]  { transform: translateX(calc(190% * var(--dir)))  scale(.7); }

/* side phones: nothing inside is interactive */
.ll-ph:not([data-pos="0"]) .ll-ph__frame {
	pointer-events: none;
}

/* ── phone ──────────────────────────────────────────────────────────────── */

.ll-ph__frame {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: 42px;
	padding: 10px;
	background: #111;
	box-shadow:
		inset 0 0 0 2px #2b2b2b,
		0 30px 60px -28px rgba(92, 7, 22, .55),
		0 12px 24px -16px rgba(0, 0, 0, .4);
	overflow: hidden;
}

.ll-ph[data-pos="0"] .ll-ph__frame {
	box-shadow:
		inset 0 0 0 2px #2b2b2b,
		0 0 0 1px rgba(217, 183, 121, .5),
		0 40px 80px -30px rgba(92, 7, 22, .6),
		0 14px 28px -16px rgba(0, 0, 0, .45);
}

.ll-ph__notch {
	position: absolute;
	z-index: 3;
	top: 16px;
	left: 50%;
	width: 86px;
	height: 22px;
	margin-left: -43px;
	border-radius: 20px;
	background: #111;
}

.ll-ph__head {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 46px 12px 12px;
	border-radius: 32px 32px 0 0;
	background: linear-gradient(135deg, var(--ll-deep), var(--ll-m));
	color: #fff;
}

.ll-ph__back,
.ll-ph__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.ll-ph__icon {
	fill: currentColor;
	stroke: none;
	opacity: .9;
}

[dir="rtl"] .ll-ph__back { transform: scaleX(-1); }

.ll-ph__ava,
.ll-vn__ava {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 0 0 2px rgba(217, 183, 121, .8);
}

.ll-ph__ava img,
.ll-vn__ava img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ll-ph__who {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}

.ll-chat .ll-ph__who strong {
	color: #fff;
	overflow: hidden;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ll-ph__status {
	overflow: hidden;
	font-size: 11.5px;
	opacity: .8;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ll-ph__status.is-live {
	color: #f4e3bf;
	opacity: 1;
	font-style: italic;
}

/* chat body with a light doodle wallpaper */
.ll-ph__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 6px;
	padding: 12px 10px 10px;
	overflow-y: auto;
	scrollbar-width: none;
	background-color: var(--ll-wall);
	background-image:
		radial-gradient(circle at 20% 20%, rgba(137, 12, 37, .05) 0 2px, transparent 3px),
		radial-gradient(circle at 70% 60%, rgba(137, 12, 37, .045) 0 3px, transparent 4px),
		radial-gradient(circle at 40% 85%, rgba(0, 0, 0, .035) 0 2px, transparent 3px);
	background-size: 46px 46px, 62px 62px, 38px 38px;
}

.ll-ph__body::-webkit-scrollbar { display: none; }

.ll-ph__day {
	align-self: center;
	margin: 2px 0 6px;
	padding: 4px 10px;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
	font-size: 11px;
	color: #54656f;
}

/* bubbles */
.ll-msg {
	position: relative;
	max-width: 86%;
	padding: 6px 9px 18px;
	border-radius: 9px;
	box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
	font-size: 13.5px;
	line-height: 1.45;
	color: #111b21;
	white-space: normal;
	overflow-wrap: anywhere;
	opacity: 0;
	transform: translateY(8px) scale(.98);
	transition: opacity 260ms ease, transform 260ms ease;
	display: none;
}

.ll-msg.is-in {
	display: block;
	opacity: 1;
	transform: none;
	animation: ll-pop 260ms ease;
}

@keyframes ll-pop {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

.ll-msg span {
	display: block;
	text-align: start;
}

.ll-msg em {
	position: absolute;
	inset-inline-end: 8px;
	bottom: 3px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 10.5px;
	font-style: normal;
	color: #667781;
}

.ll-ph__ticks {
	width: 16px;
	height: 10px;
	color: #53bdeb;
}

.ll-msg--out {
	align-self: flex-end;
	background: var(--ll-out);
	border-start-end-radius: 2px;
}

.ll-msg--in {
	align-self: flex-start;
	background: #fff;
	border-start-start-radius: 2px;
}

/* typing dots */
.ll-msg--typing {
	padding: 10px 14px;
}

.ll-msg--typing.is-in {
	display: inline-flex;
	gap: 4px;
}

.ll-msg--typing b {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #8696a0;
	animation: ll-dot 1.1s infinite ease-in-out;
}

.ll-msg--typing b:nth-child(2) { animation-delay: .15s; }
.ll-msg--typing b:nth-child(3) { animation-delay: .3s; }

@keyframes ll-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30%           { transform: translateY(-4px); opacity: 1; }
}

/* voice note */
.ll-msg--voice.is-in {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 86%;
	padding: 8px 10px 8px 8px;
}

.ll-chat button.ll-vn__play {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ll-m);
	color: #fff;
	cursor: pointer;
}

.ll-vn__play svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.ll-vn__play .ll-i-pause,
.ll-msg--voice.is-playing .ll-vn__play .ll-i-play {
	display: none;
}

.ll-msg--voice.is-playing .ll-vn__play .ll-i-pause {
	display: block;
}

.ll-vn__track {
	flex: 1 1 auto;
	min-width: 0;
}

.ll-vn__wave {
	display: flex;
	align-items: center;
	gap: 2px;
	height: 26px;
}

.ll-vn__wave i {
	flex: 1 1 0;
	min-width: 2px;
	border-radius: 2px;
	background: #b6bec3;
	transition: background-color 120ms linear;
}

.ll-vn__wave i.on {
	background: var(--ll-m);
}

.ll-vn__meta {
	display: flex;
	justify-content: space-between;
	margin-top: 2px;
	font-size: 10.5px;
	color: #667781;
}

.ll-vn__meta em {
	position: static;
	font-style: normal;
}

.ll-msg--voice .ll-vn__ava {
	width: 40px;
	height: 40px;
}

.ll-vn__mic {
	position: absolute;
	inset-inline-end: 6px;
	bottom: 8px;
	display: grid;
	place-items: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	color: #53bdeb;
}

.ll-vn__mic svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

/* input bar */
.ll-ph__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 8px 10px;
	border-radius: 0 0 32px 32px;
	background: var(--ll-wall);
}

.ll-ph__bar span {
	flex: 1 1 auto;
	height: 36px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 1px .5px rgba(0, 0, 0, .1);
}

.ll-ph__bar i {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--ll-m);
	color: #fff;
}

.ll-ph__bar svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* ── controls ───────────────────────────────────────────────────────────── */

.ll-chat__controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 22px;
	margin-top: clamp(18px, 3vw, 30px);
}

.ll-chat__ctrl,
.ll-chat__play {
	display: grid;
	place-items: center;
	padding: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.ll-chat button.ll-chat__ctrl {
	width: 40px;
	height: 40px;
	border: 1.5px solid rgba(137, 12, 37, .25);
	background: #fff;
	color: var(--ll-m);
}

.ll-chat button.ll-chat__ctrl:hover,
.ll-chat button.ll-chat__ctrl:focus-visible {
	background: var(--ll-m);
	color: #fff;
}

.ll-chat__ctrl svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

[dir="rtl"] .ll-chat__ctrl svg { transform: scaleX(-1); }

.ll-chat button.ll-chat__play {
	width: 48px;
	height: 48px;
	border: 0;
	background: var(--ll-m);
	color: #fff;
	box-shadow: 0 10px 22px -10px rgba(92, 7, 22, .7);
}

.ll-chat__play:hover { transform: scale(1.05); }

.ll-chat__play svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.ll-chat__play .ll-i-pause,
.ll-chat.is-playing .ll-chat__play .ll-i-play {
	display: none;
}

.ll-chat.is-playing .ll-chat__play .ll-i-pause {
	display: block;
}

/* no voice note on this testimonial */
.ll-chat:not(.has-audio) .ll-chat__play {
	opacity: .35;
	pointer-events: none;
}

/* ── smaller screens ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.ll-chat {
		--ph-w: 280px;
		--ph-h: 570px;
	}

	.ll-ph[data-pos="-1"] { transform: translateX(calc(-96% * var(--dir))) scale(.82); }
	.ll-ph[data-pos="1"]  { transform: translateX(calc(96% * var(--dir)))  scale(.82); }
}

/* phone: one in focus, the neighbours peek at the edges */
@media (max-width: 640px) {
	.ll-chat {
		--ph-w: min(78vw, 290px);
		--ph-h: 560px;
	}

	.ll-ph[data-pos="-1"],
	.ll-ph[data-pos="1"] {
		opacity: .3;
	}

	.ll-ph[data-pos="-1"] { transform: translateX(calc(-92% * var(--dir))) scale(.8); }
	.ll-ph[data-pos="1"]  { transform: translateX(calc(92% * var(--dir)))  scale(.8); }
}

@media (prefers-reduced-motion: reduce) {
	.ll-ph,
	.ll-msg {
		transition: none;
		animation: none;
	}

	.ll-msg--typing b {
		animation: none;
	}
}
