/* Popularity report — aligned with admin Component Selection dashboard */

.pcp-rp-popularity {
	--pcp-dash-primary: #3b82f6;
	--pcp-dash-primary-hover: #2563eb;
	--pcp-dash-card-bg: #ffffff;
	--pcp-dash-text: #1e293b;
	--pcp-dash-text-muted: #64748b;
	--pcp-dash-border: #e2e8f0;
}

.pcp-rp-popularity .pcp-dash-section {
	background: var(--pcp-dash-card-bg);
	border: 1px solid var(--pcp-dash-border);
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	margin-bottom: 24px;
}

.pcp-rp-popularity .pcp-dash-section-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--pcp-dash-text);
	margin: 0 0 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.pcp-rp-popularity .pcp-dash-section-meta {
	font-size: 12px;
	color: var(--pcp-dash-text-muted);
	font-weight: normal;
}

.pcp-rp-popularity-note {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--pcp-dash-text-muted);
}

.pcp-rp-popularity .pcp-dash-controls {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.pcp-rp-popularity .pcp-dash-select {
	width: 210px;
	min-width: 0;
	flex: 0 0 210px;
	padding: 8px 10px;
	border: 1px solid var(--pcp-dash-border);
	border-radius: 6px;
	font-size: 13px;
	color: var(--pcp-dash-text);
}

.pcp-rp-popularity .pcp-dash-input {
	width: 260px;
	min-width: 0;
	flex: 0 0 260px;
	padding: 8px 10px;
	border: 1px solid var(--pcp-dash-border);
	border-radius: 6px;
	font-size: 13px;
	color: var(--pcp-dash-text);
}

.pcp-rp-popularity .pcp-dash-input:focus,
.pcp-rp-popularity .pcp-dash-select:focus {
	border-color: var(--pcp-dash-primary);
	outline: none;
}

.pcp-rp-popularity-table-scroll {
	overflow-x: auto;
	border: 1px solid var(--pcp-dash-border);
	border-radius: 8px;
}

.pcp-rp-popularity .pcp-dash-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 960px;
}

.pcp-rp-popularity .pcp-dash-table th {
	background: #f8fafc;
	border-bottom: 2px solid var(--pcp-dash-border);
	padding: 10px 8px;
	text-align: left;
	font-weight: 600;
	color: var(--pcp-dash-text-muted);
	font-size: 12px;
	vertical-align: bottom;
}

.pcp-rp-popularity .pcp-th-rank {
	width: 52px;
	text-align: center;
	color: var(--pcp-dash-text);
}

.pcp-rp-popularity .pcp-th-content {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	line-height: 1.3;
}

.pcp-rp-popularity .pcp-th-label {
	white-space: nowrap;
}

.pcp-rp-popularity .pcp-th-help {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	padding: 0;
	border: 1px solid #cbd5e1;
	border-radius: 50%;
	background: #fff;
	color: #64748b;
	font-size: 10px;
	font-weight: 700;
	line-height: 14px;
	text-align: center;
	cursor: help;
}

.pcp-rp-popularity .pcp-th-help:hover,
.pcp-rp-popularity .pcp-th-help:focus {
	border-color: var(--pcp-dash-primary);
	color: var(--pcp-dash-primary);
	outline: none;
}

.pcp-rp-popularity .pcp-sort-icon {
	flex: 0 0 auto;
	margin-left: 2px;
	font-size: 11px;
	color: #94a3b8;
	line-height: 1;
}

.pcp-rp-popularity .pcp-sort-icon::before {
	content: '⇅';
}

.pcp-rp-popularity .pcp-sortable-header {
	cursor: pointer;
	user-select: none;
}

.pcp-rp-popularity .pcp-sortable-header.sort-asc .pcp-sort-icon {
	color: var(--pcp-dash-primary);
}

.pcp-rp-popularity .pcp-sortable-header.sort-asc .pcp-sort-icon::before {
	content: '▲';
}

.pcp-rp-popularity .pcp-sortable-header.sort-desc .pcp-sort-icon {
	color: var(--pcp-dash-primary);
}

.pcp-rp-popularity .pcp-sortable-header.sort-desc .pcp-sort-icon::before {
	content: '▼';
}

.pcp-rp-popularity .pcp-dash-table td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--pcp-dash-border);
	font-size: 13px;
	color: var(--pcp-dash-text);
	vertical-align: middle;
}

.pcp-rp-popularity .pcp-dash-table tr:hover td {
	background: #f8fafc;
}

.pcp-rp-popularity .pcp-badge {
	display: inline-block;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 12px;
	text-transform: capitalize;
}

.pcp-rp-popularity .pcp-badge-processor { background: #eff6ff; color: #1e40af; }
.pcp-rp-popularity .pcp-badge-graphics_card { background: #fdf2f8; color: #9d174d; }
.pcp-rp-popularity .pcp-badge-motherboard { background: #f5f3ff; color: #5b21b6; }
.pcp-rp-popularity .pcp-badge-ram { background: #ecfdf5; color: #065f46; }
.pcp-rp-popularity .pcp-badge-storage { background: #fff7ed; color: #9a3412; }
.pcp-rp-popularity .pcp-badge-default { background: #f1f5f9; color: #334155; }

.pcp-rp-popularity .pcp-dash-thumb {
	width: 32px;
	height: 32px;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--pcp-dash-border);
	border-radius: 4px;
	padding: 2px;
	display: inline-block;
	margin-right: 8px;
}

.pcp-rp-popularity .pcp-dash-empty {
	padding: 30px;
	text-align: center;
	color: var(--pcp-dash-text-muted);
}

.pcp-rp-popularity .pcp-flex-align {
	display: flex;
	align-items: center;
}

.pcp-rp-popularity .pcp-product-link {
	text-decoration: none;
	font-weight: 600;
	color: var(--pcp-dash-text);
}

.pcp-rp-popularity .pcp-product-link:hover {
	color: var(--pcp-dash-primary);
}

.pcp-rp-popularity .pcp-num-strong {
	font-weight: 700;
}

.pcp-rp-popularity .pcp-num-muted {
	font-weight: 700;
	color: #475569;
}

.pcp-rp-popularity .pcp-num-score {
	font-weight: 600;
	color: var(--pcp-dash-primary);
}

.pcp-rp-popularity .row-rank {
	text-align: center;
}

.pcp-rp-popularity-subnav {
	display: flex;
	gap: 8px;
	margin: 0 0 16px;
	flex-wrap: wrap;
}

.pcp-rp-popularity-subnav a {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--pcp-dash-border);
	border-radius: 8px;
	background: #fff;
	color: var(--pcp-dash-text);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

.pcp-rp-popularity-subnav a.is-active,
.pcp-rp-popularity-subnav a:hover {
	border-color: var(--pcp-dash-primary);
	color: var(--pcp-dash-primary);
}

.pcp-rp-popularity-subnav a.is-active {
	background: #eff6ff;
}

.pcp-rp-popularity-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.pcp-rp-stat-card {
	background: #f8fafc;
	border: 1px solid var(--pcp-dash-border);
	border-radius: 10px;
	padding: 14px 16px;
}

.pcp-rp-stat-label {
	display: block;
	font-size: 12px;
	color: var(--pcp-dash-text-muted);
	margin-bottom: 4px;
}

.pcp-rp-stat-value {
	font-size: 24px;
	color: var(--pcp-dash-text);
}

@media (max-width: 720px) {
	.pcp-rp-popularity .pcp-dash-controls {
		flex-wrap: wrap;
	}

	.pcp-rp-popularity .pcp-dash-select,
	.pcp-rp-popularity .pcp-dash-input {
		flex: 1 1 100%;
		width: 100%;
	}
}

.pcp-rp-login-welcome {
	max-width: 480px;
	margin: 0 auto 24px;
	padding: 24px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	text-align: left;
}

.pcp-rp-login-welcome h2 {
	margin: 0 0 12px;
	font-size: 1.35rem;
	color: #1e293b;
}

.pcp-rp-login-welcome p {
	margin: 0 0 10px;
	color: #475569;
	line-height: 1.55;
}

.pcp-rp-login-welcome p:last-child {
	margin-bottom: 0;
}

.pcp-rp-pricing-loading td {
	text-align: center;
	color: #64748b;
	padding: 24px;
}
