/**
 * Comparison page styles.
 *
 * @package CrabTheme
 */

/* Filters bar */
.comparison-filters {
	padding: var(--space-6) 0;
	border-bottom: 1px solid var(--color-border-light);
	margin-bottom: var(--space-6);
	display: flex;
	align-items: center;
	gap: var(--space-4);
	flex-wrap: wrap;
}

.comparison-filters__label {
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--color-text-muted);
	white-space: nowrap;
}

.comparison-filters__options {
	display: flex;
	gap: var(--space-2);
	flex-wrap: wrap;
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 0;
	padding: 0.4em 1em;
	border-radius: var(--radius-full);
	border: 1px solid var(--color-border);
	background: var(--color-white);
	font-size: var(--text-sm);
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	user-select: none;
	position: relative;
}

.filter-chip:hover {
	background: var(--color-bg-alt);
	border-color: var(--color-ocean);
}

.filter-chip input[type="checkbox"] {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.filter-chip.is-active {
	background: var(--color-ocean);
	border-color: var(--color-ocean);
	color: #fff;
}

.filter-chip.is-active:hover {
	background: var(--color-navy);
	border-color: var(--color-navy);
}

/* Table wrapper */
.comparison-page .table-responsive {
	padding-bottom: var(--space-12);
}

/* Enhance data-table for comparison */
#comparison-table {
	min-width: 700px;
}

#comparison-table th {
	white-space: nowrap;
	user-select: none;
}

#comparison-table th[data-sort] {
	cursor: pointer;
	position: relative;
	padding-right: var(--space-6);
}

#comparison-table th[data-sort]::after {
	content: '\2195';
	position: absolute;
	right: var(--space-2);
	opacity: 0.3;
	font-size: var(--text-xs);
}

#comparison-table th[data-sort].sort-asc::after {
	content: '\2191';
	opacity: 0.8;
}

#comparison-table th[data-sort].sort-desc::after {
	content: '\2193';
	opacity: 0.8;
}

/* Method name column */
#comparison-table td:first-child {
	font-weight: var(--weight-medium);
}

#comparison-table td:first-child a {
	color: var(--color-text);
	text-decoration: none;
}

#comparison-table td:first-child a:hover {
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Category badge in table */
.method-category {
	display: inline-block;
	font-size: var(--text-xs);
	font-weight: var(--weight-medium);
	padding: 0.15em 0.6em;
	border-radius: var(--radius-full);
	text-transform: capitalize;
	background: var(--color-bg-alt);
	color: var(--color-text-muted);
}

.method-category--coating { background: #e8f4f8; color: var(--color-ocean); }
.method-category--mechanical { background: #fef3e8; color: #c0792a; }
.method-category--biological { background: #e8f8f0; color: var(--color-kelp); }
.method-category--chemical { background: #fde8e8; color: var(--color-coral); }
.method-category--physical { background: #f0e8f8; color: #7d3c98; }
.method-category--integrated { background: #e8f0f8; color: var(--color-navy); }

/* Rating bars */
.rating-bar {
	display: inline-flex;
	gap: 3px;
	vertical-align: middle;
}

.rating-bar__segment {
	width: 16px;
	height: 10px;
	border-radius: 2px;
	background: var(--color-border-light);
}

.rating-bar__segment--filled {
	background: var(--color-teal);
}

/* Cost rating */
.cost-rating {
	font-weight: var(--weight-semibold);
	letter-spacing: 0.05em;
}

.cost-rating--1 { color: var(--color-kelp); }
.cost-rating--2 { color: #7dae60; }
.cost-rating--3 { color: #c0a030; }
.cost-rating--4 { color: #c07830; }
.cost-rating--5 { color: var(--color-coral); }

/* Environmental impact dots */
.impact-dots {
	display: inline-flex;
	gap: 4px;
	vertical-align: middle;
}

.impact-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--color-border-light);
}

.impact-dot--filled {
	background: var(--color-coral);
}

/* Durability display */
.durability-value {
	font-weight: var(--weight-medium);
}

.durability-value::after {
	content: ' mo';
	font-weight: var(--weight-normal);
	font-size: var(--text-xs);
	color: var(--color-text-light);
}

/* Species pills */
.species-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.species-pill {
	font-size: 0.7rem;
	padding: 0.1em 0.5em;
	border-radius: var(--radius-full);
	background: var(--color-bg-alt);
	color: var(--color-text-muted);
	white-space: nowrap;
}

/* Loading / empty state */
#comparison-body .loading-cell {
	text-align: center;
	padding: var(--space-8);
	color: var(--color-text-light);
}

/* Row hover */
#comparison-table tbody tr {
	transition: background var(--transition-fast);
}

#comparison-table tbody tr:hover {
	background: var(--color-foam);
}
