/**
 * Dashboard Stat Cards
 *
 * Statistics cards including the special streak card with animations.
 *
 * @package AgenticWP
 */

/* ==========================================================================
   Components: Stat Cards
   ========================================================================== */

/* Stat cards are direct children, default to span 2 (6 per row) */
.agenticwp-stat-card {
	grid-column: span 2;
}

.agenticwp-stat-card {
	background: var(--agenticwp-bg-white);
	border-radius: var(--agenticwp-radius-lg);
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 140px;
	border: 1px solid var(--agenticwp-border-light);
	box-shadow: var(--agenticwp-shadow-xs);
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
	            box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	will-change: transform;
}

.agenticwp-stat-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--agenticwp-shadow-lg);
}

/* Icon */
.agenticwp-stat-card-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--agenticwp-bg-light);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--agenticwp-space-lg);
	color: var(--agenticwp-text-secondary);
	transition: background-color 0.25s ease, color 0.25s ease;
}

.agenticwp-stat-card:hover .agenticwp-stat-card-icon {
	background: var(--agenticwp-primary);
	color: white;
}

.agenticwp-stat-card-icon .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Content */
.agenticwp-stat-card-content {
	display: flex;
	flex-direction: column;
}

.agenticwp-stat-card-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--agenticwp-text-primary);
	letter-spacing: -0.02em;
	line-height: 1;
	margin-bottom: 4px;
}

.agenticwp-stat-card-suffix {
	font-size: 14px;
	color: var(--agenticwp-text-secondary);
	font-weight: 400;
	margin-left: 2px;
}

.agenticwp-stat-card-label {
	font-size: 13px;
	color: var(--agenticwp-text-secondary);
	font-weight: 500;
}

/* ==========================================================================
   Streak Card Special Styling
   ========================================================================== */

.agenticwp-stat-card--streak {
	background: linear-gradient(145deg, #fff, #fffbeb);
	border-color: #fef3c7;
	position: relative;
	overflow: hidden;
}

.agenticwp-stat-card--streak::before {
	content: '';
	position: absolute;
	bottom: -20px;
	left: 50%;
	transform: translateX(-50%);
	width: 150%;
	height: 60px;
	background: radial-gradient(ellipse at center bottom, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
	animation: streakGlow 2s ease-in-out infinite;
	pointer-events: none;
}

@keyframes streakGlow {
	0%, 100% {
		opacity: 0.5;
		transform: translateX(-50%) scale(1);
	}
	50% {
		opacity: 1;
		transform: translateX(-50%) scale(1.1);
	}
}

.agenticwp-stat-card--streak .agenticwp-stat-card-icon {
	background: #fff7ed;
	color: #f59e0b;
	position: relative;
}

/* Fire animation container */
.agenticwp-stat-card--streak .agenticwp-stat-card-icon::after {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 14px;
	background: linear-gradient(45deg, #f59e0b, #ef4444, #f59e0b);
	background-size: 200% 200%;
	animation: fireGradient 1.5s ease infinite;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: -1;
}

.agenticwp-stat-card--streak:hover .agenticwp-stat-card-icon::after {
	opacity: 0.6;
}

@keyframes fireGradient {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

.agenticwp-stat-card--streak:hover .agenticwp-stat-card-icon {
	background: #f59e0b;
	color: white;
}

/* Flame particles */
.agenticwp-stat-card--streak .agenticwp-flame-particle {
	position: absolute;
	width: 4px;
	height: 4px;
	background: #f59e0b;
	border-radius: 50%;
	animation: flameRise 1s ease-out infinite;
	pointer-events: none;
	opacity: 0;
}

.agenticwp-stat-card--streak:hover .agenticwp-flame-particle {
	opacity: 1;
}

.agenticwp-flame-particle:nth-child(1) {
	left: 20%;
	animation-delay: 0s;
}

.agenticwp-flame-particle:nth-child(2) {
	left: 50%;
	animation-delay: 0.2s;
}

.agenticwp-flame-particle:nth-child(3) {
	left: 80%;
	animation-delay: 0.4s;
}

@keyframes flameRise {
	0% {
		bottom: 10%;
		opacity: 0.8;
		transform: scale(1) translateX(0);
	}
	50% {
		opacity: 0.6;
		transform: scale(0.8) translateX(-3px);
	}
	100% {
		bottom: 70%;
		opacity: 0;
		transform: scale(0.3) translateX(3px);
	}
}

.agenticwp-stat-card-best {
	margin-top: auto;
	padding-top: 8px;
	font-size: 11px;
	color: #d97706;
	font-weight: 600;
	text-transform: uppercase;
}

/* ==========================================================================
   Level Card (Compact)
   ========================================================================== */

.agenticwp-level-card {
	grid-column: span 4;
	position: relative;
	background: linear-gradient(135deg, #2563eb, #1e3a8a);
	border-radius: var(--agenticwp-radius-lg);
	padding: 24px;
	color: white;
	overflow: hidden;
	box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
	display: flex;
	flex-direction: column;
	min-height: 140px;
}

.agenticwp-level-card::before,
.agenticwp-level-card::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	z-index: 0;
}

.agenticwp-level-card::before {
	top: -60px;
	left: -60px;
	width: 200px;
	height: 200px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 35%, transparent 70%);
}

.agenticwp-level-card::after {
	bottom: -80px;
	right: -60px;
	width: 250px;
	height: 250px;
	background: radial-gradient(circle, rgba(30, 58, 138, 0.5) 0%, rgba(30, 58, 138, 0.2) 40%, transparent 70%);
}

.agenticwp-level-card-badge {
	position: relative;
	z-index: 1;
	background: rgba(0, 0, 0, 0.25);
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: rgba(255, 255, 255, 0.95);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
	align-self: flex-start;
	margin-bottom: var(--agenticwp-space-xs);
}

.agenticwp-level-card-name {
	position: relative;
	z-index: 1;
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.1;
	margin-bottom: auto;
}

.agenticwp-level-card-progress {
	position: relative;
	z-index: 1;
	height: 8px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	margin-bottom: 8px;
	overflow: hidden;
}

.agenticwp-level-card-progress-bar {
	height: 100%;
	background: white;
	border-radius: 8px;
	box-shadow: 0 0 12px white;
	transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.agenticwp-level-card-calls {
	position: relative;
	z-index: 1;
	font-size: 12px;
	opacity: 0.8;
	font-weight: 500;
	text-align: right;
}
