/**
 * WebXtrm Activity Dashboard Widget Styles
 * All animations are pure CSS — no JS required.
 */

.wx-dash-wrap {
	width: 100%;
	display: flex;
	justify-content: center;
	box-sizing: border-box;
	perspective: 1200px;
}

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

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

	max-width: 460px;
	width: 100%;
	padding: 24px;
	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;
}

/* Subtle gradient accent inside the card */
.wx-dash-card::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -30%;
	width: 280px;
	height: 280px;
	background: radial-gradient(circle, rgba(0, 201, 240, 0.06) 0%, transparent 65%);
	pointer-events: none;
	z-index: 0;
}

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

/* ===== HEADER ===== */
.wx-dash-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.wx-dash-header-left {
	flex: 1;
	min-width: 0;
}

.wx-dash-title {
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: var(--wx-text);
	line-height: 1.2;
	margin: 0 0 2px;
}

.wx-dash-subtitle {
	font-family: 'Inter', sans-serif;
	font-size: 11.5px;
	color: var(--wx-muted);
	line-height: 1.4;
}

/* Live Indicator */
.wx-dash-live {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(0, 201, 240, 0.08);
	border: 1px solid rgba(0, 201, 240, 0.2);
	flex-shrink: 0;
}

.wx-dash-live-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #22d36f;
	position: relative;
	flex-shrink: 0;
}

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

/* ===== SECTION DIVIDER ===== */
.wx-dash-section {
	padding-top: 16px;
	margin-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wx-dash-section-label {
	font-family: 'Inter', sans-serif;
	font-size: 10px;
	font-weight: 700;
	color: var(--wx-muted);
	letter-spacing: 1.2px;
	text-transform: uppercase;
	margin-bottom: 12px;
}

/* ===== TASKS ===== */
.wx-dash-task-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wx-dash-task {
	display: flex;
	align-items: center;
	gap: 11px;
}

/* Status icon — 18x18 circle */
.wx-dash-task-check {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #000;
	border: 1.5px solid transparent;
	background: transparent;
	transition: background 0.4s ease, border-color 0.4s ease;
}

.wx-dash-task-check svg {
	width: 11px;
	height: 11px;
	display: block;
}

/* Completed state */
.wx-dash-task--completed .wx-dash-task-check {
	background: var(--wx-accent);
	border-color: var(--wx-accent);
}

/* In-progress state */
.wx-dash-task--in_progress .wx-dash-task-check {
	background: rgba(0, 201, 240, 0.08);
	border-color: rgba(0, 201, 240, 0.4);
}

/* Pending state — empty circle */
.wx-dash-task--pending .wx-dash-task-check {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.15);
}

/* Task text */
.wx-dash-task-text {
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	font-weight: 500;
	color: var(--wx-text);
	line-height: 1.4;
	flex: 1;
	min-width: 0;
}

.wx-dash-task--pending .wx-dash-task-text {
	color: var(--wx-muted);
}

/* Spinner inside in-progress check */
.wx-dash-spinner {
	width: 10px;
	height: 10px;
	border: 1.5px solid rgba(0, 201, 240, 0.25);
	border-top-color: var(--wx-accent);
	border-radius: 50%;
	display: block;
}

/* ===== CHART ===== */
.wx-dash-chart-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.wx-dash-chart-header .wx-dash-section-label {
	margin-bottom: 0;
}

.wx-dash-chart-value {
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-weight: 800;
	color: var(--wx-accent);
}

.wx-dash-chart-bars {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 6px;
	height: 60px;
	margin-bottom: 8px;
}

.wx-dash-bar {
	flex: 1;
	min-width: 0;
	height: var(--wx-h, 50%);
	background: linear-gradient(180deg, var(--wx-accent) 0%, rgba(0, 201, 240, 0.4) 100%);
	border-radius: 3px 3px 1px 1px;
	transform-origin: bottom;
	opacity: 0.85;
}

.wx-dash-chart-caption {
	font-family: 'Inter', sans-serif;
	font-size: 11px;
	color: var(--wx-muted);
	line-height: 1.4;
}

/* ===== COUNTERS ===== */
.wx-dash-counters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: 8px;
}

.wx-dash-counter {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: rgba(0, 201, 240, 0.04);
	border: 1px solid rgba(0, 201, 240, 0.1);
	border-radius: 10px;
	min-width: 0;
}

.wx-dash-counter-icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(0, 201, 240, 0.1);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wx-accent);
}

.wx-dash-counter-icon svg {
	width: 13px;
	height: 13px;
	fill: currentColor;
	color: var(--wx-accent);
	display: block;
}

.wx-dash-counter-icon i {
	font-size: 13px;
	color: var(--wx-accent);
	line-height: 1;
}

.wx-dash-counter-meta {
	flex: 1;
	min-width: 0;
	line-height: 1.15;
}

.wx-dash-counter-num {
	font-family: 'Inter', sans-serif;
	font-size: 18px;
	font-weight: 800;
	color: var(--wx-text);
}

.wx-dash-counter-label {
	font-family: 'Inter', sans-serif;
	font-size: 10.5px;
	color: var(--wx-muted);
	margin-top: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ============================================ */
/* ===== ANIMATIONS (pure CSS, no JS) ======== */
/* ============================================ */

/* Floating motion on the whole card */
@keyframes wx-dash-float {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-6px); }
}

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

/* Live dot pulse — green ping ripple */
@keyframes wx-dash-live-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(34, 211, 111, 0.6); }
	70%  { box-shadow: 0 0 0 8px rgba(34, 211, 111, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 211, 111, 0); }
}

.wx-anim-pulse .wx-dash-live-dot {
	animation: wx-dash-live-pulse 1.8s ease-out infinite;
}

/* In-progress spinner */
@keyframes wx-dash-spin {
	to { transform: rotate(360deg); }
}

.wx-anim-pulse .wx-dash-spinner {
	animation: wx-dash-spin 0.85s linear infinite;
}

/* Sequential task tick — completed tasks fade-in checkmark with stagger */
@keyframes wx-dash-tick-in {
	0%   { transform: scale(0.4); opacity: 0; }
	60%  { transform: scale(1.15); opacity: 1; }
	100% { transform: scale(1); opacity: 1; }
}

@keyframes wx-dash-task-fade {
	0%, 30% { opacity: 0; transform: translateX(-8px); }
	100%    { opacity: 1; transform: translateX(0); }
}

.wx-anim-tick .wx-dash-task {
	opacity: 0;
	animation: wx-dash-task-fade 0.55s ease-out forwards;
	animation-delay: calc(var(--wx-i, 1) * 0.18s);
}

.wx-anim-tick .wx-dash-task--completed .wx-dash-task-check svg {
	animation: wx-dash-tick-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
	animation-delay: calc(var(--wx-i, 1) * 0.18s + 0.3s);
}

/* Chart bars grow from bottom with stagger */
@keyframes wx-dash-bar-grow {
	from { transform: scaleY(0); opacity: 0; }
	to   { transform: scaleY(1); opacity: 0.85; }
}

.wx-anim-bars .wx-dash-bar {
	animation: wx-dash-bar-grow 0.65s cubic-bezier(0.22, 1, 0.36, 1) backwards;
	animation-delay: calc(var(--wx-i, 1) * 0.08s + 0.4s);
	transform-origin: bottom;
}

/* Counter Bump — triggered by JS on each increment */
@keyframes wx-dash-bump {
	0%   { transform: scale(1);    color: var(--wx-text); }
	35%  { transform: scale(1.22); color: var(--wx-accent); }
	100% { transform: scale(1);    color: var(--wx-text); }
}

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

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

/* Counter card subtle glow when sibling number bumps */
@keyframes wx-dash-counter-flash {
	0%   { background: rgba(0, 201, 240, 0.04); border-color: rgba(0, 201, 240, 0.1); }
	35%  { background: rgba(0, 201, 240, 0.12); border-color: rgba(0, 201, 240, 0.4); }
	100% { background: rgba(0, 201, 240, 0.04); border-color: rgba(0, 201, 240, 0.1); }
}

.wx-dash-counter:has(.wx-dash-bump) {
	animation: wx-dash-counter-flash 0.7s ease-out;
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
	.wx-anim-float,
	.wx-anim-pulse .wx-dash-live-dot,
	.wx-anim-pulse .wx-dash-spinner,
	.wx-anim-tick .wx-dash-task,
	.wx-anim-tick .wx-dash-task-check svg,
	.wx-anim-bars .wx-dash-bar,
	.wx-dash-bump,
	.wx-dash-counter:has(.wx-dash-bump) {
		animation: none !important;
		opacity: 1;
		transform: none;
	}
	.wx-dash-bar {
		transition: none !important;
	}
}
