/* BoostPrep — Performance by Category (Phase 2b, Component #5) */

.bpcc-qs-card {
	background: #fff;
	border: 2px solid #e2e7ed;
	border-radius: 5px;
	padding: 20px 24px;
}

.bpcc-qs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.bpcc-qs-title-row {
	display: flex;
	align-items: center;
	min-width: 0;
}

.bpcc-qs-title {
	font-size: 1rem; /* Matches .bp-stat-label. */
	font-weight: 700;
	color: #1a2332;
}

/*
 * Title tooltip: trigger sits left-ish, so anchor the panel to the left edge
 * of the trigger (instead of centering) so it cannot run off the card/screen.
 * The arrow moves with it. Width capped for small viewports.
 */
.bpcc-qs-title-row .bp-feat-tooltip-panel {
	left: -8px;
	right: auto;
	transform: none;
	width: min(400px, 82vw);
}

.bpcc-qs-title-row .bp-feat-tooltip-panel__card::before,
.bpcc-qs-title-row .bp-feat-tooltip-panel__card::after {
	left: 12px;
	right: auto;
	transform: none;
}

.bpcc-qs-see-more,
.bpcc-qs-see-more:visited {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	color: #f65637;
	text-decoration: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
	line-height: 1;
	transition: color 0.15s ease;
}

.bpcc-qs-see-more:hover,
.bpcc-qs-see-more:focus {
	color: #000000;
	text-decoration: none;
}

.bpcc-qs-see-more__arrow {
	font-size: 12px;
	display: inline-block;
	transition: transform 0.2s ease;
}

.bpcc-qs-see-more.bpcc-qs-see-more--expanded .bpcc-qs-see-more__arrow {
	transform: rotate(90deg);
}

/* ── Rows ── */
.bpcc-qs-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
}

.bpcc-qs-row--parent {
	cursor: pointer;
	user-select: none;
}

.bpcc-qs-caret {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #6b7a8d;
	font-size: 12px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.bpcc-qs-caret--leaf {
	color: transparent;
}

.bpcc-qs-row[aria-expanded="true"] .bpcc-qs-caret {
	transform: rotate(90deg);
}

.bpcc-qs-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	max-width: 220px;
	flex-shrink: 1;
}

.bpcc-qs-row--level-0 .bpcc-qs-label {
	font-size: 13px;
	font-weight: 600;
	color: #1a2332;
}

.bpcc-qs-row--level-1 .bpcc-qs-label {
	font-size: 12px;
	font-weight: 500;
	color: #1a2332;
}

.bpcc-qs-row--level-2 .bpcc-qs-label {
	font-size: 11px;
	font-weight: 400;
	color: #6b7a8d;
}

/* ── Gradient bar + marker (matches BP Confidence Score scale) ── */
.bpcc-qs-bar {
	position: relative;
	flex: 1;
	display: block;
	border-radius: 10px;
	background: linear-gradient(90deg, #c0392b 0%, #d65014 20%, #f09600 40%, #b4c81e 65%, #50b43c 85%, #1a7a45 100%);
	min-width: 60px;
}

/* No data yet: muted gray bar, no marker */
.bpcc-qs-bar--nodata {
	background: #e2e7ed;
}

.bpcc-qs-row--nodata .bpcc-qs-score {
	color: #9aa7b5;
	font-weight: 600;
}

.bpcc-qs-row--level-0 .bpcc-qs-bar {
	height: 12px;
}

.bpcc-qs-row--level-1 .bpcc-qs-bar {
	height: 9px;
}

.bpcc-qs-row--level-2 .bpcc-qs-bar {
	height: 7px;
}

.bpcc-qs-bar__marker {
	position: absolute;
	top: -4px;
	bottom: -4px;
	width: 3px;
	border-radius: 2px;
	background: #1a2332;
	transform: translateX(-50%);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.bpcc-qs-row--level-2 .bpcc-qs-bar__marker {
	top: -3px;
	bottom: -3px;
	width: 2px;
}

.bpcc-qs-score {
	font-weight: 700;
	min-width: 38px;
	text-align: right;
	flex-shrink: 0;
}

.bpcc-qs-row--level-0 .bpcc-qs-score {
	font-size: 13px;
	color: #1a2332;
}

.bpcc-qs-row--level-1 .bpcc-qs-score {
	font-size: 12px;
	color: #6b7a8d;
}

.bpcc-qs-row--level-2 .bpcc-qs-score {
	font-size: 11px;
	color: #6b7a8d;
}

/* ── Nesting ── */
.bpcc-qs-row--level-1 {
	padding-left: 22px;
}

.bpcc-qs-row--level-2 {
	padding-left: 44px;
}

.bpcc-qs-children {
	display: none;
	overflow: hidden;
}

.bpcc-qs-children.bpcc-qs-children--open {
	display: block;
	animation: bpcc-qs-fade 0.18s ease;
}

@keyframes bpcc-qs-fade {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Divider between top-level groups */
.bpcc-qs-group + .bpcc-qs-group > .bpcc-qs-row--level-0 {
	border-top: 1px solid #e2e7ed;
	margin-top: 2px;
	padding-top: 9px;
}

/* Hidden groups (revealed by See More) */
.bpcc-qs-group--hidden {
	display: none;
}

.bpcc-qs-group--hidden.bpcc-qs-group--revealed {
	display: block;
}

/* ── Empty state ── */
.bpcc-qs-empty {
	margin: 0;
	font-size: 13px;
	color: #6b7a8d;
	line-height: 1.5;
}

/* ── Loading skeleton (shimmer) ── */
@keyframes bpcc-qs-shimmer {
	0% {
		background-position: -600px 0;
	}
	100% {
		background-position: 600px 0;
	}
}

.bpcc-qs-skel {
	display: inline-block;
	background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
	background-size: 600px 100%;
	animation: bpcc-qs-shimmer 1.4s infinite linear;
	border-radius: 4px;
}

.bpcc-qs-card--skeleton {
	pointer-events: none;
}

.bpcc-qs-skel--title {
	height: 15px;
	width: 180px;
}

.bpcc-qs-skel--more {
	height: 12px;
	width: 60px;
}

.bpcc-qs-skel-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
}

.bpcc-qs-skel--label {
	height: 13px;
	width: 130px;
	flex-shrink: 0;
}

.bpcc-qs-skel--bar {
	height: 12px;
	flex: 1;
	border-radius: 10px;
}

.bpcc-qs-skel--score {
	height: 13px;
	width: 34px;
	flex-shrink: 0;
}

/* ── Error state ── */
.bpcc-quiz-stats-async__error {
	margin: 0;
	padding: 12px 16px;
	font-size: 14px;
	color: #7b8794;
}

/* ── Responsive ── */
@media (max-width: 640px) {
	.bpcc-qs-card {
		padding: 16px;
	}

	.bpcc-qs-label {
		max-width: 130px;
	}

	.bpcc-qs-row--level-1 {
		padding-left: 14px;
	}

	.bpcc-qs-row--level-2 {
		padding-left: 28px;
	}
}
