/**
 * WebXtrm Impact Showcase Widget Styles
 */

.wx-impact-wrap {
	width: 100%;
	display: flex;
	justify-content: center;
	box-sizing: border-box;
}

.wx-impact-wrap * {
	box-sizing: border-box;
}

/* ===== CARD ===== */
.wx-impact-card {
	--wx-accent: #00c9f0;
	--wx-text: #ffffff;
	--wx-muted: #9aacbd;

	max-width: 460px;
	width: 100%;
	padding: 32px 28px;
	background: #0d1117;
	border: 1px solid rgba(0, 201, 240, 0.15);
	border-radius: 18px;
	box-shadow: 0 20px 60px rgba(0, 201, 240, 0.08),
	            inset 0 1px 0 rgba(255, 255, 255, 0.03);
	position: relative;
	overflow: hidden;
}

/* Decorative radial in background */
.wx-impact-card::before {
	content: '';
	position: absolute;
	top: -40%;
	left: -20%;
	width: 320px;
	height: 320px;
	background: radial-gradient(circle, rgba(0, 201, 240, 0.08) 0%, transparent 65%);
	pointer-events: none;
	z-index: 0;
}

.wx-impact-card > * {
	position: relative;
	z-index: 1;
}

/* ===== HEADER ===== */
.wx-impact-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
}

.wx-impact-header-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wx-accent);
}

.wx-impact-header-text {
	font-family: 'Inter', sans-serif;
	font-size: 10px;
	font-weight: 700;
	color: var(--wx-accent);
	letter-spacing: 1.4px;
	text-transform: uppercase;
}

/* ===== SUBTITLE ===== */
.wx-impact-subtitle {
	font-family: 'Inter', sans-serif;
	font-size: 12px;
	font-weight: 400;
	color: var(--wx-muted);
	margin-bottom: 6px;
}

/* ===== MAIN METRIC ===== */
.wx-impact-metric {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 4px;
}

.wx-impact-number {
	font-family: 'Inter', sans-serif;
	font-size: 56px;
	font-weight: 800;
	color: var(--wx-text);
	line-height: 1;
	letter-spacing: -1.5px;
	font-variant-numeric: tabular-nums; /* Stable width during count-up */
}

.wx-impact-unit {
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	font-weight: 500;
	color: var(--wx-muted);
}

/* ===== TREND BADGE ===== */
.wx-impact-trend {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 9px;
	border-radius: 5px;
	font-family: 'Inter', sans-serif;
	font-size: 11px;
	font-weight: 600;
	margin-bottom: 24px;
	margin-top: 4px;
}

.wx-impact-trend svg {
	width: 11px;
	height: 11px;
}

.wx-impact-trend--green {
	background: rgba(34, 211, 111, 0.1);
	border: 1px solid rgba(34, 211, 111, 0.25);
	color: #22d36f;
}

.wx-impact-trend--red {
	background: rgba(255, 80, 80, 0.1);
	border: 1px solid rgba(255, 80, 80, 0.25);
	color: #ff5050;
}

.wx-impact-trend--cyan {
	background: rgba(0, 201, 240, 0.1);
	border: 1px solid rgba(0, 201, 240, 0.25);
	color: var(--wx-accent);
}

/* ===== CHART ===== */
.wx-impact-chart {
	position: relative;
	height: 80px;
	margin: 0 0 24px;
	padding: 4px 0;
}

.wx-impact-chart svg {
	width: 100%;
	height: 100%;
	display: block;
	overflow: visible;
}

/* ===== STAT BADGES ===== */
.wx-impact-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: 10px;
}

.wx-impact-stat {
	padding: 14px 12px;
	background: rgba(0, 201, 240, 0.04);
	border: 1px solid rgba(0, 201, 240, 0.12);
	border-radius: 12px;
	min-width: 0;
	text-align: center;
}

.wx-impact-stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(0, 201, 240, 0.12);
	margin: 0 auto 8px;
}

.wx-impact-stat-icon svg {
	width: 14px;
	height: 14px;
	fill: var(--wx-accent);
	color: var(--wx-accent);
	display: block;
}

.wx-impact-stat-icon i {
	font-size: 14px;
	color: var(--wx-accent);
	line-height: 1;
}

.wx-impact-stat-value {
	font-family: 'Inter', sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--wx-text);
	line-height: 1;
}

.wx-impact-stat-label {
	font-family: 'Inter', sans-serif;
	font-size: 10px;
	font-weight: 400;
	color: var(--wx-muted);
	margin-top: 3px;
}

/* ============================================ */
/* ===== ANIMATIONS ========================== */
/* ============================================ */

/* Card float */
@keyframes wx-impact-float {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-6px); }
}

.wx-impact-anim-float {
	animation: wx-impact-float 5s ease-in-out infinite;
}

/* Header dot pulse */
@keyframes wx-impact-dot-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50%      { transform: scale(1.4); opacity: 0.6; }
}

.wx-impact-header-dot {
	animation: wx-impact-dot-pulse 2.5s ease-in-out infinite;
}

/* Chart line drawing animation */
@keyframes wx-impact-chart-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes wx-impact-chart-area-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.wx-impact-anim-chart .wx-impact-chart-line {
	stroke-dasharray: 1500;
	stroke-dashoffset: 1500;
	animation: wx-impact-chart-draw 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
	animation-delay: 0.3s;
}

.wx-impact-anim-chart .wx-impact-chart-area {
	opacity: 0;
	animation: wx-impact-chart-area-in 0.8s ease-out forwards;
	animation-delay: 1.2s;
}

@keyframes wx-impact-point-in {
	0%   { transform: scale(0); opacity: 0; }
	60%  { transform: scale(1.4); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}

.wx-impact-anim-chart .wx-impact-chart-point-mid,
.wx-impact-anim-chart .wx-impact-chart-endpoint,
.wx-impact-anim-chart .wx-impact-chart-endpoint-ring {
	transform-origin: center;
	transform-box: fill-box;
	animation: wx-impact-point-in 0.4s ease-out backwards;
	animation-delay: 1.7s;
}

/* Endpoint pulse - continuous ripple */
@keyframes wx-impact-endpoint-pulse {
	0%   { transform: scale(1); opacity: 0.5; }
	100% { transform: scale(2.5); opacity: 0; }
}

.wx-impact-chart-endpoint-ring {
	transform-origin: center;
	transform-box: fill-box;
}

.wx-impact-anim-chart .wx-impact-chart-endpoint-ring {
	animation: wx-impact-point-in 0.4s ease-out backwards 1.7s,
	           wx-impact-endpoint-pulse 1.8s ease-out infinite 2.3s;
}

/* Stat cards stagger fade-up */
@keyframes wx-impact-stat-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wx-impact-anim-stagger .wx-impact-stat {
	opacity: 0;
	animation: wx-impact-stat-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
	animation-delay: calc(var(--wx-i, 1) * 0.15s + 0.4s);
}

/* Trend badge fade-in */
@keyframes wx-impact-trend-in {
	from { opacity: 0; transform: translateX(-8px); }
	to   { opacity: 1; transform: translateX(0); }
}

.wx-impact-trend {
	animation: wx-impact-trend-in 0.55s ease-out backwards;
	animation-delay: 0.2s;
}

/* Number bump (JS-triggered on increment) */
@keyframes wx-impact-bump {
	0%   { transform: scale(1);    color: var(--wx-text); }
	35%  { transform: scale(1.05); color: var(--wx-accent); }
	100% { transform: scale(1);    color: var(--wx-text); }
}

.wx-impact-number {
	display: inline-block;
	transform-origin: left center;
	transition: color 0.4s ease;
	will-change: transform, color;
}

.wx-impact-bump {
	animation: wx-impact-bump 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.wx-impact-anim-float,
	.wx-impact-header-dot,
	.wx-impact-anim-chart .wx-impact-chart-line,
	.wx-impact-anim-chart .wx-impact-chart-area,
	.wx-impact-anim-chart .wx-impact-chart-point-mid,
	.wx-impact-anim-chart .wx-impact-chart-endpoint,
	.wx-impact-anim-chart .wx-impact-chart-endpoint-ring,
	.wx-impact-anim-stagger .wx-impact-stat,
	.wx-impact-trend,
	.wx-impact-bump {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
		stroke-dashoffset: 0 !important;
	}
}
