/* Results Dashboard */
.results-dashboard {
	margin-top: 4rem;
	padding-top: 3rem;
	border-top: 1px solid rgba(0, 255, 0, 0.1);
}

.dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	flex-wrap: wrap;
	gap: 1rem;
}

.results-label {
	color: var(--text-highlight);
	font-size: 0.75rem;
	letter-spacing: 3px;
	text-transform: uppercase;
}

.metric-selector {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.metric-tab {
	padding: 0.6rem 1.2rem;
	font-size: 0.7rem;
	font-family: "Courier New", monospace;
	letter-spacing: 1px;
	text-transform: uppercase;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: var(--text-secondary);
	cursor: pointer;
	transition: all 0.3s ease;
	border-radius: 4px;
}

.metric-tab:hover {
	border-color: var(--text-highlight);
	color: var(--text-highlight);
}

.metric-tab.active {
	background: rgba(2, 13, 77, 0.4);
	border-color: var(--text-highlight);
	color: var(--text-highlight);
}

/* Chart Container */
.chart-container {
	background: rgba(15, 15, 35, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	padding: 2rem;
	min-height: 400px;
	position: relative;
}

.chart-header {
	text-align: center;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	position: relative;
}

.chart-title {
	font-size: 1.2rem;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
}

.chart-subtitle {
	font-size: 0.75rem;
	color: var(--text-secondary);
}
.clear-stats-btn {
	position: absolute;
	top: 0;
	right: 0;
	padding: 0.5rem 1rem;
	font-size: 0.7rem;
	font-family: "Courier New", monospace;
	letter-spacing: 1px;
	text-transform: uppercase;
	background: transparent;
	border: 1px solid rgba(255, 68, 68, 0.3);
	color: #ff4444;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.clear-stats-btn:hover {
	background: rgba(255, 68, 68, 0.1);
	border-color: #ff4444;
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(255, 68, 68, 0.2);
}

.export-stats-btn {
	position: absolute;
	top: 0;
	right: 160px;
	padding: 0.5rem 1rem;
	font-size: 0.7rem;
	font-family: "Courier New", monospace;
	letter-spacing: 1px;
	text-transform: uppercase;
	background: transparent;
	border: 1px solid rgba(74, 222, 128, 0.3);
	color: var(--text-highlight);
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.export-stats-btn:hover {
	background: rgba(74, 222, 128, 0.1);
	border-color: var(--text-highlight);
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(74, 222, 128, 0.2);
}

/* Line Chart Styling */
.chart-canvas-wrapper {
	width: 100%;
	display: flex;
	justify-content: center;
	margin: 2rem 0;
}

.line-chart {
	max-width: 100%;
	height: auto;
	filter: drop-shadow(0 4px 20px rgba(0, 255, 0, 0.05));
}

.line-chart .grid line {
	stroke-dasharray: 2, 4;
}

.line-chart .data-point {
	cursor: pointer;
	transition: all 0.2s ease;
}

.line-chart .hover-circle {
	transition: all 0.2s ease;
}

.line-chart .data-point:hover .hover-circle {
	r: 12;
	fill: rgba(255, 255, 255, 0.1);
}

.line-chart .data-point:hover circle:first-child {
	r: 7;
}

.chart-canvas {
	width: 100%;
	height: 350px;
	display: flex;
	align-items: flex-end;
	justify-content: space-around;
	gap: 0.5rem;
	padding: 1rem 0;
}

.chart-group {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	max-width: 100px;
}

.chart-bars {
	display: flex;
	gap: 0.3rem;
	align-items: flex-end;
	height: 300px;
	width: 100%;
	justify-content: center;
}

.chart-bar {
	width: 40px;
	background: linear-gradient(180deg, var(--accent-js) 0%, rgba(247, 223, 30, 0.3) 100%);
	border-radius: 4px 4px 0 0;
	position: relative;
	transition: all 0.3s ease;
	min-height: 20px;
}

.chart-bar.wasm-bar {
	background: linear-gradient(180deg, var(--accent-wasm) 0%, rgba(101, 79, 240, 0.3) 100%);
}

.chart-bar.unavailable {
	background: repeating-linear-gradient(
		45deg,
		rgba(255, 255, 255, 0.05),
		rgba(255, 255, 255, 0.05) 10px,
		rgba(255, 255, 255, 0.02) 10px,
		rgba(255, 255, 255, 0.02) 20px
	);
	height: 50px !important;
}

.chart-bar:hover {
	opacity: 0.8;
	transform: translateY(-2px);
}

.bar-value {
	position: absolute;
	top: -25px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.65rem;
	color: var(--text-primary);
	white-space: nowrap;
}

.chart-label {
	font-size: 0.65rem;
	color: var(--text-secondary);
	text-align: center;
	margin-top: 0.5rem;
}

.chart-legend {
	display: flex;
	justify-content: center;
	gap: 2rem;
	margin-top: 2rem;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.75rem;
}

.legend-line {
	width: 30px;
	height: 3px;
	border-radius: 2px;
}

.legend-line.js {
	background: var(--accent-js);
	box-shadow: 0 0 8px rgba(247, 223, 30, 0.5);
}

.legend-line.wasm {
	background: var(--accent-wasm);
	box-shadow: 0 0 8px rgba(101, 79, 240, 0.5);
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 350px;
	color: var(--text-secondary);
	font-size: 0.9rem;
}

.error-state {
	color: #ff4444;
}

/* Statistics Panel */
.statistics-panel {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.statistics-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	margin-bottom: 1rem;
}

.stat-card {
	background: rgba(26, 26, 46, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 1.5rem;
}

.stat-card.js-stat {
	border-left: 3px solid var(--accent-js);
}

.stat-card.wasm-stat {
	border-left: 3px solid var(--accent-wasm);
}

.stat-header {
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 1rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.js-stat .stat-header {
	color: var(--accent-js);
}

.wasm-stat .stat-header {
	color: var(--accent-wasm);
}

.stat-row {
	display: flex;
	justify-content: space-between;
	padding: 0.5rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
	font-size: 0.85rem;
}

.stat-row:last-child {
	border-bottom: none;
}

.stat-label {
	color: var(--text-secondary);
}

.stat-value {
	color: var(--text-primary);
	font-weight: 500;
}

.stat-note {
	text-align: center;
	font-size: 0.75rem;
	color: var(--text-secondary);
	margin-top: 1rem;
}

.stat-unavailable {
	text-align: center;
	padding: 2rem;
	color: var(--text-secondary);
	font-size: 0.85rem;
}

.stat-unavailable small {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	opacity: 0.7;
}

/* Metric Explanation */
.metric-explanation {
	margin-top: 2rem;
	padding: 1.5rem;
	border-left: 3px solid var(--text-highlight);
	border-radius: 4px;
	background: rgba(2, 13, 77, 0.4);
}

.explanation-header {
	font-size: 0.85rem;
	color: var(--text-highlight);
	margin-bottom: 0.75rem;
	font-weight: 600;
}

.explanation-content p {
	margin: 0.5rem 0;
	font-size: 0.8rem;
	line-height: 1.6;
}

.explanation-content strong {
	color: var(--text-primary);
}

.explanation-content em {
	color: var(--text-secondary);
	font-size: 0.75rem;
}

/* Hide old bar chart styles */
.chart-canvas {
	display: none;
}

/* Hide all data point labels by default, show on hover */
.data-point-labels {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.run-group:hover .data-point-labels {
	opacity: 1;
	pointer-events: auto;
}

/* Always show labels for the last run */
.run-group:last-of-type .data-point-labels {
	opacity: 1;
	pointer-events: auto;
}

.line-chart .run-group {
	cursor: pointer;
}

.line-chart .run-group:hover circle:first-of-type {
	r: 7;
}

.line-chart .run-group:hover circle:nth-of-type(3) {
	r: 7;
}
@media (max-width: 968px) {
	.chart-container {
		padding: 1rem 0;
		overflow: visible;
	}

	.chart-canvas-wrapper {
		overflow-x: scroll;
		overflow-y: visible;
		-webkit-overflow-scrolling: touch;
		width: 100%;
		padding: 0;
		margin: 0;
		display: block;
	}

	.line-chart {
		display: block;
		min-width: 900px;
		width: 900px;
		max-width: none;
	}

	.chart-legend {
		flex-direction: column;
		gap: 0.75rem;
		align-items: flex-start;
		margin-top: 1.5rem;
		padding: 0 1rem;
	}

	.legend-item {
		font-size: 0.7rem;
	}

	.metric-explanation {
		padding: 1rem;
		margin-top: 1rem;
	}

	.explanation-header {
		font-size: 0.75rem;
	}

	.explanation-content p {
		font-size: 0.75rem;
	}

	.stat-card {
		padding: 1rem;
	}

	.stat-header {
		font-size: 0.8rem;
	}

	.stat-row {
		font-size: 0.75rem;
		flex-wrap: wrap;
	}

	.stat-note {
		font-size: 0.7rem;
	}

	.chart-header {
		padding: 0 1rem 3rem 1rem;
	}
}

@media (max-width: 768px) {
	.line-chart {
		min-width: 800px;
		width: 800px;
	}
}
