/**
 * Property Search - Stats section widget styles.
 *
 * Port of the static homepage stats section: four centered cards with
 * tinted icon tiles, big numbers and a gradient hover underline.
 *
 * @package PropertySearch
 */

.ps-stats {
	--ps-stats-card-bg: #ffffff;
	--ps-stats-card-border: rgba(0, 61, 43, 0.06);
	--ps-stats-number: #003d2b;
	--ps-stats-label: #6c757d;
	--ps-stats-bar-start: #003d2b;
	--ps-stats-bar-end: #ffcc00;
	--ps-stats-shadow: rgba(0, 61, 43, 0.12);

	padding: 80px 0 40px;
	font-family: inherit;
	line-height: 1.5;
}

.ps-stats,
.ps-stats * {
	box-sizing: border-box;
}

.ps-stats-container {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 15px;
}

.ps-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

.ps-stat-col {
	min-width: 0;
}

.ps-stat-card {
	background: var(--ps-stats-card-bg);
	border-radius: 16px;
	padding: 30px;
	text-align: center;
	border: 1px solid var(--ps-stats-card-border);
	position: relative;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	height: 100%;
}

.ps-stat-card::before {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--ps-stats-bar-start), var(--ps-stats-bar-end));
	transform: scaleX(0);
	transition: transform 0.4s ease;
	transform-origin: left;
}

.ps-stat-card:hover::before {
	transform: scaleX(1);
}

.ps-stat-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 12px 30px var(--ps-stats-shadow);
}

.ps-stat-icon {
	width: 60px;
	height: 60px;
	border-radius: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	margin-bottom: 15px;
	background: rgba(25, 135, 84, 0.1);
	color: #198754;
}

.ps-stat-number {
	font-size: 2.2rem;
	font-weight: 700;
	color: var(--ps-stats-number);
	line-height: 1;
	overflow-wrap: anywhere;
}

.ps-stat-label {
	color: var(--ps-stats-label);
	font-size: 0.85rem;
	margin: 8px 0 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Scroll reveal (mirrors .fade-up). */
.ps-stats .ps-reveal {
	opacity: 0;
	transform: translateY(40px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.ps-stats .ps-reveal.ps-show {
	opacity: 1;
	transform: translateY(0);
}

/* Keep the four-card desktop design, but give tablets enough room per card. */
@media (max-width: 991.98px) {
	.ps-stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767.98px) {
	.ps-stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}

	.ps-stat-card {
		padding: 24px 16px;
	}

	.ps-stat-icon {
		width: 52px;
		height: 52px;
	}

	.ps-stat-number {
		font-size: 1.7rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ps-stats .ps-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.ps-stat-card,
	.ps-stat-card::before {
		transition: none;
	}
}
