/**
 * Readability Analyzer - Benchmarks Section
 *
 * Publication comparison chart with user score marker.
 *
 * @package AgenticWP
 */

/* ============================================
   Benchmarks Section Container
   ============================================ */

.readability-benchmarks-section {
	padding: 0 0 72px;
}

.readability-benchmarks-section[hidden] {
	display: none;
}

/* ============================================
   Benchmarks Card
   ============================================ */

.benchmarks-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.benchmarks-intro {
	font-size: 0.9375rem;
	color: var(--muted);
	margin: 0 0 1.5rem;
	line-height: 1.5;
}

/* ============================================
   Benchmark Chart
   ============================================ */

.benchmark-chart {
	position: relative;
	padding: 1.5rem 0;
}

/* User Score Marker */
.user-score-marker {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--user-position, 50%);
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
	transform: translateX(-50%);
	transition: left 0.6s ease;
}

.user-score-marker[hidden] {
	display: none;
}

.marker-line {
	width: 2px;
	flex: 1;
	background: var(--readability-accent);
	opacity: 0.8;
}

.marker-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.5rem 0.75rem;
	background: var(--readability-accent);
	border-radius: 8px;
	color: #fff;
	margin-top: 8px;
}

.marker-text {
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.9;
}

.marker-value {
	font-size: 1.125rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ============================================
   Benchmark Bars
   ============================================ */

.benchmark-bars {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	position: relative;
}

.benchmark-bar {
	display: grid;
	grid-template-columns: 140px 1fr 40px;
	align-items: center;
	gap: 1rem;
}

.bar-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.bar-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: var(--muted);
	background: var(--tool-bg-subtle);
	border-radius: 6px;
	flex-shrink: 0;
}

.bar-name {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--ink);
}

.bar-track {
	height: 12px;
	background: var(--tool-bg-subtle);
	border-radius: 6px;
	overflow: hidden;
}

.bar-fill {
	height: 100%;
	width: var(--bar-width, 0%);
	background: linear-gradient(90deg, #d1d5db 0%, #9ca3af 100%);
	border-radius: 6px;
	transition: width 0.6s ease;
}

.bar-score {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Highlight user-matching benchmark */
.benchmark-bar.active {
	background: rgba(22, 163, 74, 0.05);
	margin: 0 -1rem;
	padding: 0.5rem 1rem;
	border-radius: 8px;
}

.benchmark-bar.active .bar-fill {
	background: var(--gradient-green);
}

.benchmark-bar.active .bar-score {
	color: var(--readability-accent);
	font-weight: 700;
}

/* ============================================
   Benchmark Scale
   ============================================ */

.benchmark-scale {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.scale-label {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.scale-ticks {
	display: flex;
	justify-content: space-between;
	flex: 1;
	margin: 0 1rem;
}

.scale-ticks span {
	font-size: 0.6875rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

/* ============================================
   Benchmark Result
   ============================================ */

.benchmark-result {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding: 1rem;
	background: var(--tool-success-bg);
	border-radius: 10px;
}

.benchmark-result[hidden] {
	display: none;
}

.result-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: var(--tool-success);
	background: #fff;
	border-radius: 50%;
	flex-shrink: 0;
}

.result-text {
	font-size: 1rem;
	font-weight: 500;
	color: var(--ink);
	margin: 0;
	line-height: 1.4;
}

/* ============================================
   Benchmark Info
   ============================================ */

.benchmark-info {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.info-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--muted);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.info-toggle:hover {
	color: var(--ink);
}

.info-toggle svg {
	flex-shrink: 0;
}

.info-details {
	margin-top: 1rem;
	padding: 1rem;
	font-size: 0.875rem;
	color: var(--ink);
	background: var(--tool-bg-subtle);
	border-radius: 8px;
	animation: fade-in 0.2s ease;
}

.info-details[hidden] {
	display: none;
}

.info-details p {
	margin: 0 0 0.75rem;
	line-height: 1.5;
}

.info-details ul {
	margin: 0;
	padding-left: 1.25rem;
}

.info-details li {
	margin-bottom: 0.375rem;
	line-height: 1.4;
}

.info-details li:last-child {
	margin-bottom: 0;
}
