/**
 * Word Count Tool - Stats Section
 *
 * Stats grid layout and individual stat card styling.
 *
 * @package AgenticWP
 */

/* ============================================
   Results Container
   ============================================ */

.word-count-results {
	max-width: 800px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* ============================================
   Stats Section
   ============================================ */

.stats-section {
	background: #fff;
	border-radius: 16px;
	border: 1px solid var(--tool-border);
	padding: 1.5rem;
	box-shadow: var(--tool-shadow-sm);
}

.stats-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 1.25rem;
}

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
}

/* Stat Card Overrides (uses shared .tool-stat from components.css) */
.stats-grid .tool-stat {
	flex-direction: column;
	align-items: flex-start;
	gap: var(--tool-space-sm);
	padding: 1rem;
}

.stats-grid .tool-stat__icon {
	display: none; /* Hide icons for cleaner look in grid */
}

.stats-grid .tool-stat__content {
	width: 100%;
}

.stats-grid .tool-stat__label {
	font-size: 0.8125rem;
	margin-bottom: 0.25rem;
}

.stats-grid .tool-stat__value {
	font-size: 1.75rem;
}

/* Animated value transition */
.stats-grid .tool-stat__value[data-animating] {
	color: var(--word-count-accent);
	transition: color 0.3s ease;
}

/* Time stats with suffix */
.stats-grid .tool-stat__suffix {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--muted);
}

/* ============================================
   Empty State
   ============================================ */

/* Results container empty state - faded until content is analyzed */
.word-count-results--empty {
	opacity: 0.5;
	pointer-events: none;
}

.word-count-results--empty::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.6) 100%);
	pointer-events: none;
	z-index: 1;
}

.stats-section--empty {
	opacity: 0.6;
}

.stats-section--empty .tool-stat__value {
	color: var(--muted);
}

/* Empty state message overlay */
.word-count-results__empty-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding: 1.5rem 2rem;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
	z-index: 2;
	text-align: center;
}

.word-count-results__empty-overlay svg {
	width: 48px;
	height: 48px;
	color: var(--muted);
	opacity: 0.6;
}

.word-count-results__empty-overlay p {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--muted);
}

/* ============================================
   Stat Tooltips
   ============================================ */

.tool-stat[title] {
	position: relative;
	cursor: help;
}

.tool-stat[title]:hover::after {
	content: attr(title);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	padding: 0.5rem 0.75rem;
	background: var(--ink);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 500;
	white-space: nowrap;
	border-radius: 6px;
	box-shadow: var(--tool-shadow-md);
	z-index: var(--tool-z-dropdown, 10);
	animation: fade-in 0.2s ease;
}

.tool-stat[title]:hover::before {
	content: '';
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--ink);
	z-index: var(--tool-z-dropdown, 10);
}

@keyframes fade-in {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}
