/**
 * WebTend Social Proof Engine — frontend styles.
 */

.wspe-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin: 16px 0;
}

.wspe-badges--small .wspe-badge__icon svg,
.wspe-badges--small .wspe-badge__icon img {
	width: 20px;
	height: 20px;
}

.wspe-badges--medium .wspe-badge__icon svg,
.wspe-badges--medium .wspe-badge__icon img {
	width: 28px;
	height: 28px;
}

.wspe-badges--large .wspe-badge__icon svg,
.wspe-badges--large .wspe-badge__icon img {
	width: 36px;
	height: 36px;
}

.wspe-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.03);
	color: inherit;
}

.wspe-badges--rounded .wspe-badge {
	border-radius: 999px;
}

.wspe-badges--square .wspe-badge {
	border-radius: 4px;
}

.wspe-badge a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
}

.wspe-badge__icon {
	display: inline-flex;
	color: var( --wspe-accent, #2563eb );
}

.wspe-badges--grayscale .wspe-badge__icon {
	color: currentColor;
	filter: grayscale(100%);
	opacity: 0.75;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.wspe-badges--grayscale .wspe-badge:hover .wspe-badge__icon {
	filter: none;
	opacity: 1;
}

.wspe-badge__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.wspe-badge__label {
	white-space: nowrap;
	font-size: 13px;
	line-height: 1.3;
}

/* Visitor count */
.wspe-visitor-count {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	font-size: 13px;
	color: inherit;
}

.wspe-visitor-count__number {
	font-weight: 600;
	color: var( --wspe-accent, #2563eb );
}

/* =====================================================================
   ACTIVITY POPUP
   ===================================================================== */

.wspe-activity-popup {
	position: fixed;
	z-index: 99999;
	max-width: 320px;
	width: calc(100vw - 32px);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
	padding: 14px 16px 14px 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	transform: translateY(20px);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
	pointer-events: none;
}

.wspe-activity-popup[hidden] {
	display: none !important;
}

.wspe-activity-popup.is-visible {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* Positions */
.wspe-activity-popup--bottom-left  { bottom: 24px; left: 16px; }
.wspe-activity-popup--bottom-right { bottom: 24px; right: 16px; }

/* Avatar / image area */
.wspe-activity-popup__avatar {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wspe-accent, #2563eb);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wspe-activity-popup__img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

.wspe-activity-popup__icon {
	color: #fff;
}

.wspe-activity-popup__icon svg {
	width: 22px;
	height: 22px;
}

/* Body */
.wspe-activity-popup__body {
	flex: 1;
	min-width: 0;
}

.wspe-activity-popup__text {
	font-size: 13px;
	font-weight: 500;
	color: #111827;
	margin: 0 0 3px;
	line-height: 1.4;
}

.wspe-activity-popup__time {
	font-size: 11px;
	color: #9ca3af;
	display: block;
}

/* Close button */
.wspe-activity-popup__close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	font-size: 16px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 4px;
	transition: color 0.15s;
}

.wspe-activity-popup__close:hover {
	color: #374151;
}

/* =====================================================================
   STATS COUNTER
   ===================================================================== */

.wspe-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 24px 0;
}

.wspe-stats--row  { flex-direction: row; }
.wspe-stats--grid { flex-wrap: wrap; }

.wspe-stats--grid .wspe-stat {
	flex: 1 1 160px;
}

.wspe-stat {
	flex: 1;
	text-align: center;
	padding: 20px 24px;
}

/* Vertical dividers between items */
.wspe-stats--dividers .wspe-stat + .wspe-stat {
	border-left: 1px solid rgba(0,0,0,0.08);
}

.wspe-stat__number {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 2px;
	line-height: 1;
	margin-bottom: 6px;
}

.wspe-stat__prefix,
.wspe-stat__suffix {
	font-size: 1.4em;
	font-weight: 700;
	color: var(--wspe-accent, #2563eb);
}

.wspe-stat__value {
	font-size: 2.6em;
	font-weight: 800;
	color: var(--wspe-accent, #2563eb);
	letter-spacing: -0.02em;
	line-height: 1;
}

.wspe-stat__label {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
	font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
	.wspe-stats--row {
		flex-direction: column;
	}
	.wspe-stats--dividers .wspe-stat + .wspe-stat {
		border-left: none;
		border-top: 1px solid rgba(0,0,0,0.08);
	}
	.wspe-activity-popup {
		max-width: calc(100vw - 32px);
	}
}

/* =====================================================================
   TESTIMONIALS
   ===================================================================== */

.wspe-testimonials {
	margin: 24px 0;
}

/* Grid layout */
.wspe-testimonials--grid {
	display: grid;
	gap: 20px;
}

.wspe-testimonials--grid.wspe-testimonials--cols-2 { grid-template-columns: repeat(2, 1fr); }
.wspe-testimonials--grid.wspe-testimonials--cols-3 { grid-template-columns: repeat(3, 1fr); }
.wspe-testimonials--grid.wspe-testimonials--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* List layout */
.wspe-testimonials--list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.wspe-testimonials--list .wspe-testimonial {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.wspe-testimonials--list .wspe-testimonial__avatar {
	flex-shrink: 0;
}

/* Slider layout — CSS scroll-snap, no JS needed */
.wspe-testimonials--slider {
	position: relative;
	overflow: hidden;
}

.wspe-testimonials__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	gap: 20px;
	padding-bottom: 4px;
	/* Hide scrollbar visually */
	scrollbar-width: none;
}

.wspe-testimonials__track::-webkit-scrollbar {
	display: none;
}

.wspe-testimonials--slider .wspe-testimonial {
	flex: 0 0 calc(33.333% - 14px);
	scroll-snap-align: start;
}

.wspe-testimonials__controls {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

.wspe-testimonials__prev,
.wspe-testimonials__next {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid #e5e7eb;
	background: #fff;
	cursor: pointer;
	font-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, border-color 0.15s;
}

.wspe-testimonials__prev:hover,
.wspe-testimonials__next:hover {
	background: var(--wspe-accent, #2563eb);
	border-color: var(--wspe-accent, #2563eb);
	color: #fff;
}

/* Individual card */
.wspe-testimonial {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Avatar */
.wspe-testimonial__avatar {
	display: flex;
	align-items: center;
}

.wspe-testimonial__avatar-img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.wspe-testimonial__avatar-initials {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wspe-accent, #2563eb);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 18px;
}

/* Stars */
.wspe-testimonial__rating {
	display: flex;
	gap: 2px;
}

.wspe-testimonial__star {
	font-size: 16px;
	color: #d1d5db;
}

.wspe-testimonial__star.is-filled {
	color: #f59e0b;
}

/* Content */
.wspe-testimonial__content {
	margin: 0;
	padding: 0;
	border: none;
	font-size: 14px;
	line-height: 1.6;
	color: #374151;
	flex: 1;
}

.wspe-testimonial__content p {
	margin: 0 0 8px;
}

.wspe-testimonial__content p:last-child {
	margin: 0;
}

/* Footer */
.wspe-testimonial__footer {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: auto;
}

.wspe-testimonial__author {
	font-style: normal;
	font-weight: 700;
	font-size: 13px;
	color: #111827;
}

.wspe-testimonial__role {
	font-size: 12px;
	color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
	.wspe-testimonials--grid.wspe-testimonials--cols-4 { grid-template-columns: repeat(2, 1fr); }
	.wspe-testimonials--grid.wspe-testimonials--cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.wspe-testimonials--grid { grid-template-columns: 1fr; }
	.wspe-testimonials--slider .wspe-testimonial { flex: 0 0 90%; }
	.wspe-testimonials--list .wspe-testimonial { flex-direction: column; }
}
