/**
 * File: workers/src/assets/shared-collections.css
 * External Shared Collection Styles File for shared collection functionality
 * Loaded dynamically by shared collection pages for automatic updates
 *
 * REFACTORED: December 2025
 * - CSS Variables for theming (light/dark mode)
 * - Neumorphic design system integration
 * - Consolidated dark mode (~50% less code)
 * - Removed excessive !important usage
 */

/* ===== CSS CUSTOM PROPERTIES (Design Tokens) ===== */
:root {
	/* Animation and transition timing */
	--transition-fast: 0.15s;
	--transition-normal: 0.2s;
	--transition-slow: 0.3s;
	--debounce-search: 300ms;
	--debounce-sort: 300ms;

	/* Performance settings */
	--lazy-load-delay: 50ms;
	--retry-base-delay: 1000ms;

	/* Layout breakpoints */
	--mobile-breakpoint: 768px;
	--tablet-breakpoint: 1024px;

	/* Image sizes - single source of truth */
	--image-size-thumbnail: 150px;
	--image-size-medium: 275px;
	--image-size-large: 450px;
	--current-image-size: var(--image-size-medium);

	/* Grid ratios for card info width */
	--grid-ratio-thumbnail: 1.63;
	--grid-ratio-medium: 1.17;
	--grid-ratio-large: 1.07;

	/* Mobile image sizes */
	--image-size-mobile: 275px;
	--image-size-mobile-small: 225px;
	--image-size-mobile-tiny: 185px;

	/* Typography Scale */
	--text-scale-1: 1.5rem;
	--text-scale-2: 1.125rem;
	--text-scale-3: 0.875rem;
	--text-scale-4: 0.875rem;
	--text-weight-1: 700;
	--text-weight-2: 600;
	--text-weight-3: 500;
	--text-weight-4: 400;

	/* ===== COLOR SYSTEM (RGB format for opacity support) ===== */
	/* Backgrounds */
	--color-bg-primary: 255 255 255; /* white */
	--color-bg-secondary: 249 250 251; /* gray-50 */
	--color-bg-tertiary: 243 244 246; /* gray-100 */
	--color-bg-quaternary: 248 250 252; /* slate-50 */

	/* Text */
	--color-text-primary: 17 24 39; /* gray-900 */
	--color-text-secondary: 55 65 81; /* gray-700 */
	--color-text-tertiary: 75 85 99; /* gray-600 */
	--color-text-quaternary: 107 114 128; /* gray-500 */
	--color-text-muted: 156 163 175; /* gray-400 */

	/* Borders */
	--color-border-primary: 229 231 235; /* gray-200 */
	--color-border-secondary: 209 213 219; /* gray-300 */
	--color-border-tertiary: 226 232 240; /* slate-200 */

	/* Accent Colors */
	--color-blue-primary: 59 130 246; /* blue-500 */
	--color-blue-secondary: 37 99 235; /* blue-600 */
	--color-blue-light: 219 234 254; /* blue-100 */
	--color-blue-dark: 30 58 138; /* blue-900 */

	--color-green-primary: 5 150 105; /* emerald-600 */
	--color-green-dark: 4 120 87; /* emerald-700 */

	--color-red-primary: 220 38 38; /* red-600 */
	--color-red-light: 254 242 242; /* red-50 */

	/* Social Brand Colors (consistent in both modes) */
	--color-twitter: 0 0 0; /* X (formerly Twitter) uses black */
	--color-facebook: 24 119 242;
	--color-linkedin: 10 102 194;

	/* Neumorphic Shadows */
	--shadow-neumorphic: 2px 2px 4px rgba(0, 0, 0, 0.08), -1px -1px 3px rgba(255, 255, 255, 0.6);
	--shadow-neumorphic-inset: inset 1px 1px 2px rgba(0, 0, 0, 0.06),
		inset -1px -1px 2px rgba(255, 255, 255, 0.8);
	--shadow-card: 0 2px 4px rgba(0, 0, 0, 0.05);
	--shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.1);
	--shadow-dropdown: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ===== DARK MODE COLOR OVERRIDES ===== */
/* System dark mode preference */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		/* Backgrounds */
		--color-bg-primary: 17 24 39; /* gray-900 */
		--color-bg-secondary: 31 41 55; /* gray-800 */
		--color-bg-tertiary: 55 65 81; /* gray-700 */
		--color-bg-quaternary: 31 41 55; /* gray-800 */

		/* Text */
		--color-text-primary: 249 250 251; /* gray-50 */
		--color-text-secondary: 229 231 235; /* gray-200 */
		--color-text-tertiary: 209 213 219; /* gray-300 */
		--color-text-quaternary: 156 163 175; /* gray-400 */
		--color-text-muted: 107 114 128; /* gray-500 */

		/* Borders */
		--color-border-primary: 55 65 81; /* gray-700 */
		--color-border-secondary: 75 85 99; /* gray-600 */
		--color-border-tertiary: 55 65 81; /* gray-700 */

		/* Accent Colors (lighter for dark mode) */
		--color-blue-primary: 96 165 250; /* blue-400 */
		--color-blue-secondary: 59 130 246; /* blue-500 */
		--color-blue-light: 30 58 138; /* blue-900 */
		--color-blue-dark: 147 197 253; /* blue-300 */

		--color-green-primary: 16 185 129; /* emerald-500 */
		--color-green-dark: 5 150 105; /* emerald-600 */

		/* Neumorphic Shadows (dark mode) */
		--shadow-neumorphic: 2px 2px 4px rgba(0, 0, 0, 0.4), -1px -1px 3px rgba(75, 85, 99, 0.2);
		--shadow-neumorphic-inset: inset 1px 1px 2px rgba(0, 0, 0, 0.3), inset -1px -1px 2px rgba(75, 85, 99, 0.1);
		--shadow-card: 0 2px 4px rgba(0, 0, 0, 0.2);
		--shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.3);
		--shadow-dropdown: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
	}
}

/* Force dark mode via toggle */
:root[data-theme='dark'] {
	/* Backgrounds */
	--color-bg-primary: 17 24 39; /* gray-900 */
	--color-bg-secondary: 31 41 55; /* gray-800 */
	--color-bg-tertiary: 55 65 81; /* gray-700 */
	--color-bg-quaternary: 31 41 55; /* gray-800 */

	/* Text */
	--color-text-primary: 249 250 251; /* gray-50 */
	--color-text-secondary: 229 231 235; /* gray-200 */
	--color-text-tertiary: 209 213 219; /* gray-300 */
	--color-text-quaternary: 156 163 175; /* gray-400 */
	--color-text-muted: 107 114 128; /* gray-500 */

	/* Borders */
	--color-border-primary: 55 65 81; /* gray-700 */
	--color-border-secondary: 75 85 99; /* gray-600 */
	--color-border-tertiary: 55 65 81; /* gray-700 */

	/* Accent Colors (lighter for dark mode) */
	--color-blue-primary: 96 165 250; /* blue-400 */
	--color-blue-secondary: 59 130 246; /* blue-500 */
	--color-blue-light: 30 58 138; /* blue-900 */
	--color-blue-dark: 147 197 253; /* blue-300 */

	--color-green-primary: 16 185 129; /* emerald-500 */
	--color-green-dark: 5 150 105; /* emerald-600 */

	/* Neumorphic Shadows (dark mode) */
	--shadow-neumorphic: 2px 2px 4px rgba(0, 0, 0, 0.4), -1px -1px 3px rgba(75, 85, 99, 0.2);
	--shadow-neumorphic-inset: inset 1px 1px 2px rgba(0, 0, 0, 0.3), inset -1px -1px 2px rgba(75, 85, 99, 0.1);
	--shadow-card: 0 2px 4px rgba(0, 0, 0, 0.2);
	--shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.3);
	--shadow-dropdown: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* ===== BASE STYLES ===== */
* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background-color: rgb(var(--color-bg-primary));
}

.collection-container {
	max-width: 1600px;
	margin: 0 auto;
	padding: 20px;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 1.6;
	color: rgb(var(--color-text-secondary));
	background-color: rgb(var(--color-bg-primary));
	min-height: 100vh;
}

/* ===== HEADER STYLES ===== */
.collection-header {
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 2px solid rgb(var(--color-border-primary));
}

.header-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: nowrap;
	gap: 20px;
	margin-bottom: 15px;
}

.collection-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0;
	flex: 1 1 auto;
	word-wrap: break-word;
	overflow-wrap: break-word;
	line-height: 1;
	min-width: 0;
	/* Subtle gradient text for depth */
	background: linear-gradient(
		180deg,
		rgb(var(--color-text-primary)) 0%,
		rgb(var(--color-text-secondary)) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.collection-description {
	font-size: 1rem;
	color: rgb(var(--color-text-quaternary));
	margin: 1px 0 0 0;
	text-align: left;
}

/* Inset "Digital Display" stats */
.collection-stats {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 20px;
	margin-top: 15px;
	padding: 8px 24px;
	font-size: 0.9rem;
	color: rgb(var(--color-text-muted));
	background: rgb(var(--color-bg-tertiary));
	border-radius: 50px;
	box-shadow: var(--shadow-neumorphic-inset);
	border: 1px solid rgba(255, 255, 255, 0.1);
	text-align: center;
}

/* ===== GRID LAYOUT ===== */
.collection-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

/* Grid responsive to image sizes */
[data-image-size='thumbnail'] .collection-grid {
	grid-template-columns: repeat(
		auto-fill,
		minmax(calc(var(--image-size-thumbnail) * var(--grid-ratio-thumbnail)), 1fr)
	);
}

[data-image-size='medium'] .collection-grid {
	grid-template-columns: repeat(
		auto-fill,
		minmax(calc(var(--image-size-medium) * var(--grid-ratio-medium)), 1fr)
	);
}

[data-image-size='large'] .collection-grid {
	grid-template-columns: repeat(
		auto-fill,
		minmax(calc(var(--image-size-large) * var(--grid-ratio-large)), 1fr)
	);
}

/* ===== CARD ITEM (Neumorphic) ===== */
.card-item {
	background: rgb(var(--color-bg-primary));
	border: 1px solid rgb(var(--color-border-primary));
	border-radius: 12px;
	padding: 16px;
	box-shadow: var(--shadow-neumorphic);
	transition: transform var(--transition-normal) ease, box-shadow var(--transition-normal) ease;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
}

.card-item:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-card-hover);
}

/* ===== CARD IMAGE ===== */
.card-image {
	width: 100%;
	max-width: 100%;
	height: auto;
	object-fit: contain;
	transition: opacity var(--transition-slow) ease;
	border-radius: 8px;
	margin: 0 auto 16px auto;
	display: block;
}

.card-image.lazy {
	opacity: 0;
	transition: opacity var(--transition-slow) ease;
}

.card-image.lazy.loaded {
	opacity: 1;
}

/* Image placeholder with skeleton animation */
.card-image-placeholder {
	aspect-ratio: 1;
	border-radius: 8px;
	margin: 0 auto 12px auto;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px dashed rgb(var(--color-border-secondary));
	flex-direction: column;
	gap: 8px;
	position: relative;
	background: linear-gradient(
		90deg,
		rgb(var(--color-bg-tertiary)) 25%,
		rgb(var(--color-bg-secondary)) 50%,
		rgb(var(--color-bg-tertiary)) 75%
	);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Hide icon/text during loading - only show shimmer */
.card-image-placeholder::before,
.card-image-placeholder::after {
	display: none;
}

/* Show icon/text only on load error */
.card-image-placeholder.load-error {
	animation: none;
	background: rgb(var(--color-bg-tertiary));
}

.card-image-placeholder.load-error::before {
	display: block;
	content: '📷';
	font-size: 2rem;
	opacity: 0.6;
}

.card-image-placeholder.load-error::after {
	display: block;
	content: 'No Image';
	font-size: 0.875rem;
	font-weight: 500;
	color: rgb(var(--color-text-quaternary));
	opacity: 0.8;
}

/* Unified Image Size Logic using CSS Variables */
[data-image-size='thumbnail'] {
	--current-image-size: var(--image-size-thumbnail);
}

[data-image-size='medium'] {
	--current-image-size: var(--image-size-medium);
}

[data-image-size='large'] {
	--current-image-size: var(--image-size-large);
}

[data-image-size] .card-image,
[data-image-size] .card-image-placeholder {
	width: var(--current-image-size);
	height: var(--current-image-size);
	max-width: var(--current-image-size);
	max-height: var(--current-image-size);
	object-fit: contain;
	display: block;
}

.card-main {
	display: block;
}

.card-info {
	min-width: 150px;
}

.card-other {
	flex-shrink: 0;
	width: 100%;
}

/* ===== CARD INFO TYPOGRAPHY ===== */
.card-info h3 {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 4px 0;
	color: rgb(var(--color-text-primary));
	line-height: 1.1;
}

.card-info p {
	margin: 6px 0;
	font-size: 0.9rem;
	color: rgb(var(--color-text-primary));
	display: flex;
	align-items: flex-start;
	flex-wrap: wrap;
	line-height: 1.4;
}

.card-info p[data-label]::before {
	content: attr(data-label) ': ';
	font-weight: 600;
	color: rgb(var(--color-text-primary));
	min-width: auto;
	margin-right: 0;
	font-size: 0.9rem;
	flex-shrink: 0;
}

/* Notes stack vertically in grid view */
.card-info p[data-label='Notes'] {
	display: block;
	flex-direction: column;
}

.card-info p[data-label='Notes']::before {
	display: block;
	margin-bottom: 4px;
	margin-right: 0;
}

.card-info .year {
	font-weight: 500;
	color: rgb(var(--color-text-secondary));
}

.card-info .manufacturer {
	color: rgb(var(--color-text-tertiary));
}

.card-info .set {
	color: rgb(var(--color-text-tertiary));
}

.card-info .card-number {
	font-weight: 600;
	color: rgb(var(--color-text-secondary));
}

.card-info .teams {
	color: rgb(var(--color-red-primary));
	font-weight: 500;
}

.card-info .tier {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.card-info .tier.grail {
	background-color: #fef3c7;
	color: #92400e;
}

.card-info .tier.elite {
	background-color: #ddd6fe;
	color: #5b21b6;
}

.card-info .tier.premium {
	background-color: #cffafe;
	color: #0e7490;
}

.card-info .condition,
.card-info .grade {
	font-weight: 500;
	color: rgb(var(--color-green-primary));
}

.card-info .value {
	font-size: 1.1rem;
	font-weight: 700;
	color: rgb(var(--color-green-primary));
	margin-top: 8px;
}

.card-info .notes {
	color: rgb(var(--color-text-quaternary));
	margin-top: 0;
	display: block;
}

/* ===== TABLE LAYOUT & SCROLL INDICATORS ===== */

/* Outer container - non-scrolling, holds the shadow elements */
.table-outer {
	position: relative;
	margin-top: 20px;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	background: rgb(var(--color-bg-primary));
}

/* Scroll shadows on the outer (non-scrolling) container */
.table-outer::before,
.table-outer::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 24px;
	pointer-events: none;
	z-index: 20;
	opacity: 0;
	transition: opacity 0.2s ease;
}

/* Left Shadow */
.table-outer::before {
	left: 0;
	border-radius: 12px 0 0 12px;
	background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
}
.table-outer.can-scroll-left::before {
	opacity: 1;
}

/* Right Shadow */
.table-outer::after {
	right: 0;
	border-radius: 0 12px 12px 0;
	background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
}
.table-outer.can-scroll-right::after {
	opacity: 1;
}

/* Inner scrolling container */
.table-wrapper {
	width: 100%;
	overflow-x: auto;
	border-radius: 12px;
	/* Smooth scrolling */
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	/* Styled scrollbar */
	scrollbar-width: thin;
	scrollbar-color: rgb(var(--color-border-secondary)) transparent;
}

.table-wrapper::-webkit-scrollbar {
	height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
	background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
	background: rgb(var(--color-border-secondary));
	border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
	background: rgb(var(--color-text-muted));
}

.collection-table {
	width: 100%;
	min-width: 900px;
	border-collapse: collapse;
	background: rgb(var(--color-bg-primary));
}

/* Full width for list layout */
.collection-container.list-layout {
	width: 100%;
	max-width: none;
	padding-left: 40px;
	padding-right: 40px;
}

/* ===== STICKY HEADERS ===== */
.collection-table thead {
	position: sticky;
	top: 0;
	z-index: 10;
}

.collection-table th {
	background-color: rgb(var(--color-bg-secondary));
	color: rgb(var(--color-text-tertiary));
	font-weight: 600;
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid rgb(var(--color-border-primary));
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	white-space: nowrap;
}

/* Sortable headers */
.collection-table th.sortable {
	cursor: pointer;
	user-select: none;
	transition: color var(--transition-fast) ease;
}

.collection-table th.sortable:hover {
	color: rgb(var(--color-text-primary));
}

.collection-table th.sortable .sort-arrow {
	display: inline-block;
	margin-left: 4px;
	font-size: 0.65rem;
	opacity: 0.4;
	transition: opacity var(--transition-fast) ease;
}

.collection-table th.sortable:hover .sort-arrow {
	opacity: 0.7;
}

/* ===== COLUMN ALIGNMENT ===== */

/* Right align: Year, Card #, Grade, Price/Value */
.collection-table th[data-sort='yearString'],
.collection-table th[data-sort='number'],
.collection-table th[data-sort='grade'],
.collection-table th[data-sort='currentValue'],
.collection-table th[data-sort='purchasePrice'] {
	text-align: right;
}

.collection-table .card-year,
.collection-table .card-number,
.collection-table .card-grade,
.collection-table .card-value,
.collection-table .card-purchase-price {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Center align: Condition */
.collection-table th[data-sort='condition'] {
	text-align: center;
}

.collection-table .card-condition {
	text-align: center;
}

/* ===== TABLE ROWS - Strict Single-Line ===== */
.collection-table td {
	padding: 0 14px;
	height: 48px;
	max-height: 48px;
	border-bottom: 1px solid rgba(var(--color-border-primary), 0.3);
	color: rgb(var(--color-text-secondary));
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 0.8125rem;
	line-height: 48px;
	vertical-align: middle;
}

/* Very subtle zebra striping */
.collection-table tbody tr:nth-child(even) {
	background-color: rgba(var(--color-bg-secondary), 0.25);
}

/* Strong row hover effect */
.collection-table tbody tr {
	transition: background-color var(--transition-fast) ease;
}

.collection-table tbody tr:hover {
	background-color: rgba(var(--color-bg-tertiary), 0.6);
}

.collection-table tbody tr:last-child td {
	border-bottom: none;
}

/* ===== VISUAL HIERARCHY ===== */

/* Primary: Player Name - Bold focal point */
.collection-table .card-first-name,
.collection-table .card-last-name,
.collection-table .card-player {
	font-weight: 600;
	color: rgb(var(--color-text-primary));
}

/* Primary: Current Value - Bold green */
.collection-table .card-value {
	font-weight: 700;
	color: rgb(var(--color-green-primary));
}

/* Secondary: Purchase Price */
.collection-table .card-purchase-price {
	font-weight: 500;
	color: rgb(var(--color-text-tertiary));
}

/* Tertiary: Manufacturer, Set - Muted */
.collection-table .card-manufacturer,
.collection-table .card-set {
	color: rgb(var(--color-text-quaternary));
}

/* Tertiary: Year, Card # */
.collection-table .card-year,
.collection-table .card-number {
	color: rgb(var(--color-text-tertiary));
}

/* Team */
.collection-table .card-teams {
	color: rgb(var(--color-text-secondary));
}

/* Condition & Grade - Subtle emphasis */
.collection-table .card-condition {
	color: rgb(var(--color-text-secondary));
}

.collection-table .card-grade {
	font-weight: 600;
	color: rgb(var(--color-green-primary));
}

/* Notes - Muted */
.collection-table .card-notes {
	color: rgb(var(--color-text-quaternary));
}

/* ===== NOTES CELL - Expandable ===== */
.notes-cell {
	position: relative;
	max-width: 280px;
	cursor: pointer;
	transition: background-color var(--transition-fast) ease;
}

/* Hover hint for interactivity */
.notes-cell:hover {
	background-color: rgba(var(--color-bg-tertiary), 0.8);
}

/* Default: Single line with native ellipsis (no wrapper div needed) */
.notes-cell .notes-text,
.notes-cell:not(.expanded) {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Expanded state - breaks out of single-line constraint */
.notes-cell.expanded {
	white-space: normal;
	word-break: break-word;
	height: auto;
	max-height: none;
	line-height: 1.5;
	padding-top: 12px;
	padding-bottom: 12px;
	background-color: rgba(var(--color-bg-secondary), 0.8);
}

.notes-cell.expanded .notes-text {
	white-space: normal;
	word-break: break-word;
	overflow: visible;
	display: block;
	line-height: 1.5;
}

/* Hide legacy expand button */
.expand-btn {
	display: none;
}

/* ===== FOOTER ===== */
.collection-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid rgb(var(--color-border-primary));
	color: rgb(var(--color-text-muted));
	font-size: 0.875rem;
	position: relative;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
	position: absolute;
	right: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgb(var(--color-bg-secondary));
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 6px;
	color: rgb(var(--color-text-secondary));
	font-size: 0.75rem;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--transition-normal) ease;
	box-shadow: var(--shadow-neumorphic);
}

.theme-toggle-btn:hover {
	background: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
}

.theme-toggle-btn svg {
	width: 16px;
	height: 16px;
}

.powered-by {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: rgb(var(--color-text-quaternary));
	text-decoration: none;
	font-weight: 500;
}

.powered-by:hover {
	color: rgb(var(--color-text-secondary));
}

.setscribe-logo {
	height: 30px;
	width: auto;
	display: inline-block;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
	will-change: auto;
	backface-visibility: hidden;
	transform: translateZ(0);
	transition: opacity var(--transition-normal) ease;
}

.setscribe-logo:not([src]) {
	opacity: 0;
}

#setscribe-branding a {
	color: inherit;
	text-decoration: none;
	transition: opacity var(--transition-normal) ease;
}

#setscribe-branding a:hover {
	opacity: 0.8;
}

/* ===== SOCIAL SHARING ===== */
.social-sharing-container {
	margin-top: 0;
	padding: 0;
	border-top: none;
}

.social-sharing-buttons {
	display: block;
}

.social-sharing-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-weight: 600;
	color: rgb(var(--color-text-secondary));
}

.share-icon {
	font-size: 1.2rem;
}

.social-buttons-container {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* Inline social sharing for search bar */
.social-sharing-buttons-inline {
	display: flex;
	align-items: center;
	gap: 4px;
}

.social-sharing-buttons-inline .share-text {
	font-size: 0.875rem;
	color: rgb(var(--color-text-quaternary));
	font-weight: 500;
}

.social-sharing-buttons-inline .social-button {
	padding: 6px 10px;
	font-size: 0.75rem;
	height: 28px;
}

/* Monochrome social buttons - gray default, brand on hover */
.social-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	color: rgb(var(--color-text-secondary));
	background-color: rgb(var(--color-bg-secondary));
	border: 1px solid rgb(var(--color-border-secondary));
	transition: all var(--transition-normal) ease;
	cursor: pointer;
	box-shadow: var(--shadow-neumorphic);
}

.social-button svg {
	color: currentColor;
}

/* Brand colors only on hover */
.social-button.twitter:hover {
	background-color: rgb(0 0 0);
	border-color: rgb(0 0 0);
	color: rgb(255 255 255);
}

.social-button.facebook:hover {
	background-color: rgb(var(--color-facebook));
	border-color: rgb(var(--color-facebook));
	color: white;
}

.social-button.linkedin:hover {
	background-color: rgb(var(--color-linkedin));
	border-color: rgb(var(--color-linkedin));
	color: white;
}

.social-button.copy:hover {
	background-color: rgb(var(--color-text-tertiary));
	border-color: rgb(var(--color-text-tertiary));
	color: white;
}

/* Success State Styles */
.social-button.copy-success {
	background-color: rgb(var(--color-green-primary));
	border-color: rgb(var(--color-green-primary));
}

/* ===== CONTACT BUTTON ===== */
.contact-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	color: white;
	background-color: rgb(var(--color-green-primary));
	transition: all var(--transition-normal) ease;
	cursor: pointer;
	box-shadow: var(--shadow-neumorphic);
}

.contact-button:hover {
	background-color: rgb(var(--color-green-dark));
	text-decoration: none;
	color: white;
}

.contact-button-inline {
	display: flex;
	align-items: center;
	gap: 4px;
}

.contact-button-inline .contact-button {
	padding: 6px 10px;
	font-size: 0.75rem;
	height: 28px;
}

.contact-button-container {
	margin-top: 20px;
	padding: 15px;
}

.search-and-social-container .contact-button-container {
	margin-top: 0;
	padding: 0;
}

.contact-button.contact-success {
	background-color: rgb(var(--color-green-primary));
	border-color: rgb(var(--color-green-primary));
}

/* ===== SEARCH AND FILTER CONTAINER ===== */
/* Floating control bar with translucent backdrop */
.search-and-social-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(var(--color-bg-primary), 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	padding: 12px 20px;
	margin-left: -20px;
	margin-right: -20px;
	width: calc(100% + 40px);
	border-bottom: 1px solid rgba(var(--color-border-primary), 0.5);
	pointer-events: none;
}

/* Pill-shaped floating wrapper for controls */
.controls-wrapper {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgb(var(--color-bg-primary));
	padding: 8px 16px;
	border-radius: 50px;
	box-shadow: var(--shadow-neumorphic);
	pointer-events: auto;
}

/* Re-enable pointer events on interactive elements */
.search-and-social-container .filter-panel-dropdown,
.search-and-social-container .search-container,
.search-and-social-container .social-sharing-container {
	pointer-events: auto;
}

/* Group filter panel and search container together */
.search-and-social-container .filter-panel-dropdown {
	order: 1;
}

.search-and-social-container .search-container {
	order: 2;
}

.search-and-social-container .contact-button-container {
	order: 3;
}

.search-and-social-container .social-sharing-container {
	order: 4;
}

.search-container {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
}

/* Combined sort control - merged select + button */
.sort-controls {
	display: flex;
	align-items: center;
	gap: 0;
}

.search-input {
	width: 150px;
	padding: 8px 12px;
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 6px;
	font-size: 0.875rem;
	background-color: rgb(var(--color-bg-primary));
	color: rgb(var(--color-text-secondary));
	transition: border-color var(--transition-normal) ease, box-shadow var(--transition-normal) ease;
	height: 36px;
	box-shadow: var(--shadow-neumorphic-inset);
}

.search-input:focus {
	outline: none;
	border-color: rgb(var(--color-blue-primary));
	box-shadow: 0 0 0 3px rgba(var(--color-blue-primary), 0.1);
}

.filter-controls {
	display: flex;
	gap: 12px;
	align-items: center;
}

.sort-select {
	padding: 8px 32px 8px 12px;
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 6px 0 0 6px;
	border-right: none;
	background-color: rgb(var(--color-bg-primary));
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 8px center;
	background-repeat: no-repeat;
	background-size: 16px;
	color: rgb(var(--color-text-secondary));
	font-size: 0.875rem;
	cursor: pointer;
	transition: all var(--transition-normal) ease;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	height: 36px;
	box-shadow: var(--shadow-neumorphic-inset);
}

.sort-select:focus {
	outline: none;
	border-color: rgb(var(--color-blue-primary));
	box-shadow: 0 0 0 3px rgba(var(--color-blue-primary), 0.1);
}

.sort-select:hover {
	border-color: rgb(var(--color-text-muted));
}

.sort-order-btn {
	padding: 8px 12px;
	background-color: rgb(var(--color-bg-primary));
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 0 6px 6px 0;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	color: rgb(var(--color-text-secondary));
	transition: background-color var(--transition-normal) ease, border-color var(--transition-normal) ease;
	width: 36px;
	height: 36px;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-neumorphic);
}

.sort-order-btn:hover {
	background-color: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
}

.sort-order-btn:focus {
	outline: none;
	border-color: rgb(var(--color-blue-primary));
	box-shadow: 0 0 0 3px rgba(var(--color-blue-primary), 0.1);
}

/* ===== IMAGE SIZE CONTROLS ===== */
.image-size-controls {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-left: auto;
}

.image-size-btn {
	padding: 6px 12px;
	background-color: rgb(var(--color-bg-primary));
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.75rem;
	color: rgb(var(--color-text-quaternary));
	transition: all var(--transition-normal) ease;
	box-shadow: var(--shadow-neumorphic);
}

.image-size-btn:hover {
	background-color: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
}

.image-size-btn.active {
	background-color: rgb(var(--color-blue-primary));
	border-color: rgb(var(--color-blue-primary));
	color: #ffffff;
}

/* Hide SORT controls on list layout (tables have their own sorting) */
.list-layout .filter-controls {
	display: none;
}

/* ===== LOAD MORE / PAGINATION ===== */
.load-more-trigger {
	text-align: center;
	padding: 20px;
	color: rgb(var(--color-text-quaternary));
	font-size: 0.875rem;
	border-top: 1px solid rgb(var(--color-border-primary));
	margin-top: 20px;
}

.no-results-message {
	text-align: center;
	padding: 40px 20px;
	color: rgb(var(--color-text-quaternary));
	font-size: 1rem;
	margin: 20px 0;
	background-color: rgb(var(--color-bg-secondary));
	border: 2px dashed rgb(var(--color-border-secondary));
	border-radius: 8px;
	display: none;
}

.no-results-message p {
	margin: 0;
}

.no-results-content h3 {
	color: rgb(var(--color-text-secondary));
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 8px 0;
}

.no-results-content p {
	color: rgb(var(--color-text-quaternary));
	font-size: 0.95rem;
	margin: 0;
}

/* Pagination Controls */
.pagination-container {
	margin: 20px 0;
	padding: 16px 0;
	border-top: 1px solid rgb(var(--color-border-primary));
}

.pagination-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.pagination-btn {
	background: rgb(var(--color-bg-secondary));
	border: 1px solid rgb(var(--color-border-secondary));
	color: rgb(var(--color-text-secondary));
	padding: 8px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all var(--transition-normal) ease;
	min-width: 100px;
	box-shadow: var(--shadow-neumorphic);
}

.pagination-btn:hover:not(:disabled) {
	background: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
}

.pagination-btn:disabled {
	background: rgb(var(--color-bg-secondary));
	border-color: rgb(var(--color-border-primary));
	color: rgb(var(--color-text-muted));
	cursor: not-allowed;
	opacity: 0.5;
}

.page-info {
	font-size: 0.875rem;
	color: rgb(var(--color-text-quaternary));
	font-weight: 500;
	min-width: 200px;
	text-align: center;
}

/* ===== LIGHTBOX ===== */
.lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(15, 23, 42, 0.9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	padding: 20px;
	touch-action: pan-y pinch-zoom;
}

.lightbox-content {
	position: relative;
	max-width: 80vw;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 16px;
}

.lightbox-image {
	max-width: 100%;
	max-height: calc(80vh - 120px);
	border-radius: 8px;
	object-fit: contain;
	cursor: zoom-in;
	transition: transform var(--transition-slow) ease;
	transform-origin: center;
}

.lightbox-image.zoomed {
	transform: scale(2);
	cursor: zoom-out;
}

.lightbox-image.zoomable {
	cursor: zoom-in;
}

.lightbox-info {
	text-align: center;
	color: #ffffff;
	background-color: transparent;
	padding: 0;
	margin-top: 16px;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lightbox-info .card-name {
	font-size: 1.25rem;
	font-weight: 700;
	margin-bottom: 4px;
	line-height: 1.3;
	letter-spacing: 0.02em;
	color: #ffffff;
}

.lightbox-info .card-details {
	font-size: 0.9rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.7);
	line-height: 1.4;
}

.lightbox-prev,
.lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	font-size: 1.8rem;
	cursor: pointer;
	color: white;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: all var(--transition-normal) ease;
	z-index: 1001;
}

.lightbox-prev {
	left: -80px;
}

.lightbox-next {
	right: -80px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
	transform: translateY(-50%) scale(1.05);
}

.lightbox-close {
	position: absolute;
	top: -20px;
	right: -20px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 1.4rem;
	cursor: pointer;
	color: white;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: all var(--transition-normal) ease;
	z-index: 1001;
}

.lightbox-close:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
	transform: scale(1.1);
}

/* Multi-image navigation - Segmented Pill Control */
.lightbox-image-nav {
	display: flex;
	gap: 0;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 50px;
	padding: 6px;
	margin-top: 12px;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-image-nav-btn {
	background: transparent;
	border: none;
	border-radius: 40px;
	padding: 12px 24px;
	font-size: 0.95rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	transition: all var(--transition-normal) ease;
	min-width: 70px;
	text-align: center;
}

.lightbox-image-nav-btn:hover {
	color: rgba(255, 255, 255, 0.9);
}

.lightbox-image-nav-btn.active {
	background: rgba(255, 255, 255, 0.2);
	color: white;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.lightbox-image-nav-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.lightbox-image-nav-btn:disabled:hover {
	color: rgba(255, 255, 255, 0.6);
}

/* ===== CHIPS & BADGES ===== */
.chip {
	display: inline-block;
	padding: 4px 10px;
	margin: 2px 4px 2px 0;
	background-color: rgb(var(--color-bg-tertiary));
	color: rgb(var(--color-text-secondary));
	border-radius: 50px;
	font-size: 0.6rem;
	font-weight: 500;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	border: 1px solid rgb(var(--color-border-primary));
	transition: background-color var(--transition-normal) ease;
	box-shadow: var(--shadow-neumorphic);
}

.chip:hover {
	background-color: rgb(var(--color-border-primary));
}

/* Tags - Subtle border-only style */
.chip.tag {
	background-color: transparent;
	color: rgb(var(--color-text-secondary));
	border: 1px solid rgb(var(--color-border-primary));
	font-size: 0.75rem;
	padding: 3px 8px;
	font-weight: 500;
}

.chip.tag:hover {
	background-color: rgb(var(--color-bg-tertiary));
	color: rgb(var(--color-text-primary));
	border-color: rgb(var(--color-text-tertiary));
}

/* WCAG AA Compliant Badge Colors */
.badge,
.badge-yes,
.badge-no,
.badge-special,
.badge-favorite,
.badge-grading {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 50px;
	font-size: 0.6rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	white-space: nowrap;
	margin: 2px 4px 2px 0;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	border: none;
	box-shadow: var(--shadow-neumorphic);
}

.badge-favorite {
	background: #be185d;
	color: #ffffff;
}

.badge-yes {
	background: #047857;
	color: #ffffff;
}

.badge-no {
	background: #dc2626;
	color: #ffffff;
}

.badge-special {
	background: #1d4ed8;
	color: #ffffff;
}

.badge-grading {
	background: #4338ca;
	color: #ffffff;
}

/* ===== SECTION-BASED PROGRESSIVE DISCLOSURE ===== */
.section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	background: rgb(var(--color-bg-secondary));
	cursor: pointer;
	user-select: none;
	transition: background-color var(--transition-normal) ease;
	border-bottom: 1px solid transparent;
	border-radius: 12px;
}

.section-header:hover {
	background: rgb(var(--color-bg-tertiary));
}

.section-header.expanded {
	border-bottom-color: rgb(var(--color-border-primary));
}

.section-title {
	font-size: var(--text-scale-2, 1.125rem);
	font-weight: var(--text-weight-2, 600);
	color: rgb(var(--color-text-primary));
	margin: 0;
}

.section-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: background-color var(--transition-normal) ease, transform var(--transition-normal) ease;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.section-toggle:hover {
	background: rgb(var(--color-border-primary));
}

.toggle-icon {
	font-size: 0.75rem;
	color: rgb(var(--color-text-quaternary));
	transition: transform var(--transition-normal) ease;
	transform: rotate(0deg);
}

.section-header.expanded .toggle-icon {
	transform: rotate(180deg);
}

.section-content {
	padding: 0;
	max-height: 0;
	overflow: hidden;
	background: rgb(var(--color-bg-primary));
	width: 100%;
	box-sizing: border-box;
}

.section-content.expanded {
	max-height: none;
	padding: 8px 16px 8px 16px;
	width: 100%;
}

.section-controls {
	display: flex;
	gap: 4px;
	align-items: center;
}

.section-control-btn {
	padding: 4px 8px;
	background: rgb(var(--color-bg-secondary));
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 4px;
	font-size: 0.7rem;
	font-weight: 500;
	color: rgb(var(--color-text-quaternary));
	cursor: pointer;
	transition: all var(--transition-normal) ease;
}

.section-control-btn:hover {
	background: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
	color: rgb(var(--color-text-secondary));
}

.section-control-btn:active {
	background: rgb(var(--color-border-primary));
}

/* Other Info Section */
.card-section.other-info {
	border-radius: 8px;
	width: 100%;
	overflow: hidden;
	background: rgb(var(--color-bg-primary));
}

.card-section.other-info:hover {
	border-color: rgb(var(--color-border-secondary));
}

.other-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	background: rgb(var(--color-bg-secondary));
	cursor: pointer;
	user-select: none;
	transition: background-color var(--transition-normal) ease;
	border: none;
	border-radius: 8px;
	width: 100%;
	font-size: 1.125rem;
	font-weight: 600;
	color: rgb(var(--color-text-primary));
}

.other-header:hover {
	background: rgb(var(--color-bg-tertiary));
}

.other-content {
	display: none;
	padding: 16px;
	background: rgb(var(--color-bg-primary));
	border-top: 1px solid rgb(var(--color-border-primary));
}

.card-other.open .other-content {
	display: block;
}

/* ===== CARD FIELD STYLING ===== */
.card-player {
	font-size: var(--text-scale-1);
	font-weight: var(--text-weight-1);
	color: rgb(var(--color-text-primary));
	margin-bottom: 16px;
	line-height: 1.2;
}

.card-info-line {
	margin: 0 0 0.5rem 0;
	font-size: 0.7rem;
	color: rgb(var(--color-text-tertiary));
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.card-info-line::before {
	content: none;
	display: none;
}

/* Granular spans within info line - consistent styling */
.card-info-line span {
	display: inline;
	color: inherit;
	font-weight: inherit;
}

.card-info-line span:not(:last-child)::after {
	content: ' ';
}

.card-field {
	margin: 0;
	padding: 4px 0;
	font-size: 0.9rem;
	color: rgb(var(--color-text-primary));
	display: block;
	line-height: 1.4;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	word-break: break-word;
	border-bottom: 1px solid rgba(var(--color-border-primary), 0.3);
}

/* Remove border from last field */
.card-field:last-child {
	border-bottom: none;
}

.card-field[data-label] {
	font-weight: 600;
	color: rgb(var(--color-text-primary));
}

.card-field[data-label]::before {
	white-space: pre;
	content: attr(data-label) ': ';
	font-weight: 500;
	color: rgb(var(--color-text-tertiary));
	font-size: 0.9rem;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Boolean group */
.card-field.boolean-group {
	flex-wrap: wrap;
	gap: 4px;
}

.card-field.boolean-group::before,
.card-field.boolean-field::before,
.card-field.tags-field::before {
	content: none;
}

/* Array Field */
.card-field.array-field {
	flex-wrap: wrap;
}

.card-field.tags-field {
	margin: 0;
}

/* Currency Field */
.card-field.currency-field {
	font-weight: 600;
	font-size: 0.9rem;
	color: rgb(var(--color-green-primary));
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Numeric Field */
.card-field.numeric-field {
	font-weight: 500;
	font-size: 0.9rem;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Boolean badges grouping */
.boolean-group {
	margin-bottom: 0;
}

.boolean-group .badge {
	margin: 1px 3px 1px 0;
	display: inline-block;
}

/* Specific Field Styling */
.card-insert {
	color: #7c2d12;
}

.card-serial-number,
.card-production-run {
	font-weight: 600;
	color: #7c3aed;
}

.card-grading-company {
	font-weight: 600;
	color: #0369a1;
}

.card-cert-number {
	font-size: 0.8rem;
	color: rgb(var(--color-text-quaternary));
}

.card-storage {
	color: rgb(var(--color-green-primary));
	font-weight: 500;
}

.card-for-sale {
	color: rgb(var(--color-red-primary));
	font-weight: 600;
}

.card-variations,
.card-tags {
	line-height: 1.8;
}

/* Enhanced Value Styling */
.card-value,
.card-purchase-price {
	font-weight: 700;
	color: rgb(var(--color-green-primary));
	font-size: 1.05rem;
}

.card-purchase-price {
	color: #0369a1;
}

.card-notes {
	color: rgb(var(--color-text-quaternary));
	margin-top: 0;
	line-height: 1.5;
}

/* Table badge adjustments */
.collection-table .badge-yes,
.collection-table .badge-no,
.collection-table .badge-special,
.collection-table .badge-favorite,
.collection-table .chip {
	font-size: 0.6rem;
	padding: 1px 4px;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.collection-table .chip {
	margin: 1px 2px 1px 0;
}

/* Card type identification */
.card-rookie {
	background-color: #fef3c7;
	color: #92400e;
}

.card-autograph {
	background-color: #ddd6fe;
	color: #5b21b6;
}

.card-jersey {
	background-color: #dcfce7;
	color: #166534;
}

.card-graded {
	background-color: #eff6ff;
	color: #1e40af;
}

.card-team {
	font-weight: 600;
	color: rgb(var(--color-red-primary));
}

.card-manufacturer {
	font-weight: 500;
	color: #0369a1;
}

.card-set {
	color: rgb(var(--color-text-tertiary));
	font-weight: 500;
}

.card-number {
	font-weight: 700;
	color: rgb(var(--color-text-secondary));
}

.card-condition {
	font-weight: 600;
	color: rgb(var(--color-green-primary));
}

.card-grade {
	font-weight: 700;
	color: #0369a1;
}

.card-year {
	font-weight: 600;
	color: rgb(var(--color-text-quaternary));
}

/* ===== FILTER PANEL DROPDOWN ===== */
.filter-panel-dropdown {
	position: relative;
	flex-shrink: 0;
}

.filter-toggle-btn {
	padding: 8px;
	background-color: rgb(var(--color-bg-primary));
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 6px;
	cursor: pointer;
	color: rgb(var(--color-text-secondary));
	transition: all var(--transition-normal) ease;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	box-shadow: var(--shadow-neumorphic);
}

.filter-toggle-btn:hover {
	background-color: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
}

.filter-toggle-btn:focus {
	outline: none;
	border-color: rgb(var(--color-blue-primary));
	box-shadow: 0 0 0 3px rgba(var(--color-blue-primary), 0.1);
}

.filter-toggle-btn.active {
	background-color: rgb(var(--color-blue-primary));
	border-color: rgb(var(--color-blue-primary));
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(var(--color-blue-primary), 0.2);
}

.filter-icon {
	width: 16px;
	height: 16px;
}

.filter-dropdown-content {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	background: rgb(var(--color-bg-primary));
	border: 1px solid rgb(var(--color-border-primary));
	border-radius: 8px;
	box-shadow: var(--shadow-dropdown);
	padding: 12px;
	min-width: 240px;
	margin-top: 4px;
}

.filter-group {
	margin-bottom: 12px;
}

.filter-group:last-of-type {
	margin-bottom: 12px;
}

.filter-label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 0.75rem;
	color: rgb(var(--color-text-secondary));
}

.filter-select,
.filter-input {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 4px;
	background-color: rgb(var(--color-bg-primary));
	color: rgb(var(--color-text-secondary));
	font-size: 0.75rem;
	transition: all var(--transition-normal) ease;
}

.filter-select {
	padding-right: 24px;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 8px center;
	background-repeat: no-repeat;
	background-size: 16px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
	outline: none;
	border-color: rgb(var(--color-blue-primary));
	box-shadow: 0 0 0 3px rgba(var(--color-blue-primary), 0.1);
}

.filter-select:hover,
.filter-input:hover {
	border-color: rgb(var(--color-text-muted));
}

.filter-toggles-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-bottom: 12px;
}

.filter-toggle {
	padding: 8px 6px;
	border: 2px solid rgb(var(--color-border-secondary));
	border-radius: 6px;
	background-color: rgb(var(--color-bg-primary));
	color: rgb(var(--color-text-secondary));
	font-size: 0.7rem;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--transition-normal) ease;
	text-align: center;
	min-height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.filter-toggle:hover {
	border-color: rgb(var(--color-text-muted));
	transform: translateY(-1px);
}

.filter-toggle.active {
	background-color: rgb(var(--color-blue-primary));
	border-color: rgb(var(--color-blue-primary));
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(var(--color-blue-primary), 0.2);
}

.filter-actions {
	border-top: 1px solid rgb(var(--color-border-primary));
	padding-top: 8px;
	margin-top: 0px;
}

.filter-reset-btn {
	padding: 6px 12px;
	background-color: rgb(var(--color-bg-primary));
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 4px;
	color: rgb(var(--color-text-secondary));
	font-size: 0.75rem;
	cursor: pointer;
	transition: all var(--transition-normal) ease;
	width: 100%;
}

.filter-reset-btn:hover {
	background-color: rgb(var(--color-bg-tertiary));
	border-color: rgb(var(--color-text-muted));
}

.filter-reset-btn:active {
	background-color: rgb(var(--color-border-primary));
}

.filter-reset-btn.filters-active {
	background-color: rgb(var(--color-red-light));
	border-color: #fca5a5;
	color: rgb(var(--color-red-primary));
}

.filter-reset-btn.filters-active:hover {
	background-color: #fee2e2;
	border-color: #f87171;
}

/* Filter segmented control */
.filter-segmented-control {
	display: flex;
	border: 1px solid rgb(var(--color-border-secondary));
	border-radius: 6px;
	overflow: hidden;
	background-color: rgb(var(--color-bg-secondary));
}

.filter-segment {
	flex: 1;
	padding: 8px 12px;
	background-color: transparent;
	border: none;
	border-right: 1px solid rgb(var(--color-border-secondary));
	color: rgb(var(--color-text-quaternary));
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--transition-normal) ease;
	text-align: center;
	min-width: 0;
}

.filter-segment:last-child {
	border-right: none;
}

.filter-segment:hover {
	background-color: rgb(var(--color-bg-tertiary));
	color: rgb(var(--color-text-secondary));
}

.filter-segment.active {
	background-color: rgb(var(--color-blue-primary));
	color: #ffffff;
	font-weight: 600;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filter-segment:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(var(--color-blue-primary), 0.2);
	z-index: 1;
	position: relative;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 800px) {
	.search-and-social-container .social-sharing-container {
		flex-basis: 100%;
		margin-top: 10px;
	}
}

@media (max-width: 600px) {
	.collection-container {
		padding: 16px;
	}

	.header-row {
		flex-wrap: wrap;
		gap: 15px;
	}

	.collection-title {
		font-size: 1.8rem;
	}

	.search-controls {
		flex: 1;
		justify-content: flex-end;
	}

	.search-input {
		width: 150px;
	}

	/* Mobile: Two-row layout - controls on top, social below */
	.search-and-social-container {
		flex-wrap: wrap;
		gap: 10px;
		padding: 10px 16px;
		margin-left: -16px;
		margin-right: -16px;
		width: calc(100% + 32px);
	}

	/* Mobile: Filter + Search row takes full width */
	.search-and-social-container .filter-panel-dropdown {
		order: 1;
		flex-shrink: 0;
	}

	.search-and-social-container .search-container {
		order: 2;
		flex: 1;
		min-width: 0;
	}

	/* Mobile: Controls wrapper fills available space */
	.controls-wrapper {
		width: 100%;
		justify-content: flex-start;
		gap: 8px;
		border-radius: 8px;
		padding: 6px 10px;
	}

	/* Mobile: Search input expands */
	.controls-wrapper .search-input {
		flex: 1;
		min-width: 80px;
		width: auto;
	}

	/* Mobile: Smaller sort controls */
	.sort-controls {
		flex-shrink: 0;
	}

	.sort-select {
		padding: 6px 28px 6px 10px;
		font-size: 0.8rem;
		height: 32px;
	}

	.sort-order-btn {
		width: 32px;
		height: 32px;
		padding: 6px;
	}

	/* Mobile: Social row full width below */
	.search-and-social-container .social-sharing-container {
		order: 3;
		flex-basis: 100%;
		justify-content: center;
	}

	.social-buttons-container {
		justify-content: center;
		flex-wrap: wrap;
		gap: 6px;
	}

	.social-sharing-buttons-inline .social-button {
		padding: 5px 8px;
		height: 26px;
	}

	.filter-toggle-btn {
		padding: 6px 10px;
		height: 32px;
	}

	.collection-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	/* Mobile: Override grid for all image sizes */
	[data-image-size='thumbnail'] .collection-grid,
	[data-image-size='medium'] .collection-grid,
	[data-image-size='large'] .collection-grid {
		grid-template-columns: 1fr;
	}

	.collection-stats {
		flex-direction: column;
		gap: 8px;
	}

	.collection-table {
		font-size: 0.875rem;
	}

	.collection-table th,
	.collection-table td {
		padding: 8px 12px;
	}

	.card-item {
		padding: 12px;
	}

	/* Mobile image sizes */
	[data-image-size] .card-image,
	[data-image-size] .card-image-placeholder {
		width: var(--image-size-mobile);
		height: var(--image-size-mobile);
		max-width: var(--image-size-mobile);
		max-height: var(--image-size-mobile);
	}

	/* Mobile lightbox adjustments */
	.lightbox-content {
		max-width: 95vw;
		max-height: 85vh;
	}

	.lightbox-image-nav {
		gap: 6px;
		padding: 6px;
		margin-top: 8px;
	}

	.lightbox-image-nav-btn {
		padding: 5px 10px;
		font-size: 0.7rem;
		min-width: 45px;
	}

	.lightbox-prev,
	.lightbox-next {
		width: 45px;
		height: 45px;
		font-size: 1.6rem;
	}

	.lightbox-prev {
		left: -65px;
	}

	.lightbox-next {
		right: -65px;
	}

	.lightbox-close {
		width: 32px;
		height: 32px;
		font-size: 1.2rem;
		top: -16px;
		right: -16px;
	}

	.card-section {
		margin-bottom: 8px;
	}

	.section-header {
		padding: 10px 12px;
	}

	.section-title {
		font-size: 1rem;
	}

	.section-content.expanded {
		padding: 12px;
	}

	.section-content:not(.expanded) {
		max-height: 0;
		padding: 0;
		overflow: hidden;
	}

	.field-item[data-label]::before {
		min-width: 80px;
		font-size: 0.8rem;
	}

	.card-player {
		font-size: 1.25rem;
	}

	:root {
		--text-scale-1: 1.25rem;
		--text-scale-2: 1rem;
		--text-scale-3: 0.8rem;
		--text-scale-4: 0.8rem;
	}
}

@media (max-width: 480px) {
	.search-and-social-container .social-sharing-container {
		flex-basis: 100%;
		margin-top: 5px;
	}

	.collection-container {
		padding: 12px;
	}

	.collection-title {
		font-size: 1.75rem;
	}

	.collection-table {
		font-size: 0.8rem;
	}

	.collection-table th,
	.collection-table td {
		padding: 6px 8px;
	}

	/* Small mobile image sizes */
	[data-image-size] .card-image,
	[data-image-size] .card-image-placeholder {
		width: var(--image-size-mobile-small);
		height: var(--image-size-mobile-small);
		max-width: var(--image-size-mobile-small);
		max-height: var(--image-size-mobile-small);
	}

	.lightbox-prev {
		left: -55px;
	}

	.lightbox-next {
		right: -55px;
	}

	.section-header {
		padding: 8px 10px;
	}

	.section-content.expanded {
		padding: 10px;
	}

	.section-content:not(.expanded) {
		max-height: 0;
		padding: 0;
		overflow: hidden;
	}

	.field-item[data-label]::before {
		min-width: 70px;
		font-size: 0.75rem;
	}

	.chip {
		font-size: 0.65rem;
		padding: 1px 6px;
	}

	.badge,
	.badge-yes,
	.badge-no,
	.badge-special,
	.badge-favorite {
		font-size: 0.65rem;
		padding: 2px 6px;
	}

	:root {
		--text-scale-1: 1.1rem;
		--text-scale-2: 0.9rem;
		--text-scale-3: 0.75rem;
		--text-scale-4: 0.75rem;
	}
}

@media (max-width: 400px) {
	.collection-container {
		padding: 8px;
	}

	.collection-title {
		font-size: 1.5rem;
		max-width: 100%;
	}

	.header-row {
		flex-direction: column;
		gap: 10px;
	}

	#search-container {
		flex-wrap: wrap;
	}

	.sort-controls {
		flex-basis: 100%;
		margin-top: 10px;
	}

	.search-input {
		width: 100%;
		max-width: 200px;
	}

	.collection-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.card-item {
		padding: 8px;
	}

	/* Extra small mobile image sizes */
	[data-image-size] .card-image,
	[data-image-size] .card-image-placeholder {
		width: var(--image-size-mobile-tiny);
		height: var(--image-size-mobile-tiny);
		max-width: var(--image-size-mobile-tiny);
		max-height: var(--image-size-mobile-tiny);
	}

	.collection-table {
		font-size: 0.7rem;
	}

	.collection-table th,
	.collection-table td {
		padding: 4px 6px;
	}

	/* Touch targets min 44px */
	.sort-order-btn,
	.image-size-btn {
		min-height: 44px;
		min-width: 44px;
	}

	.search-input,
	.sort-select {
		min-height: 44px;
	}

	.lightbox-prev {
		left: -45px;
		width: 40px;
		height: 40px;
		font-size: 1.4rem;
	}

	.lightbox-next {
		right: -45px;
		width: 40px;
		height: 40px;
		font-size: 1.4rem;
	}

	.lightbox-close {
		width: 36px;
		height: 36px;
		font-size: 1.1rem;
		top: -18px;
		right: -18px;
	}
}

/* Mobile responsiveness for fields */
@media (max-width: 640px) {
	.chip {
		font-size: 0.65rem;
		padding: 1px 6px;
		margin: 1px 2px 1px 0;
	}

	.badge,
	.badge-yes,
	.badge-no,
	.badge-special,
	.badge-favorite {
		font-size: 0.65rem;
		padding: 2px 6px;
	}

	.card-player {
		font-size: 1.1rem;
	}

	.card-value,
	.card-purchase-price {
		font-size: 1rem;
	}

	.card-serial-number,
	.card-production-run,
	.card-cert-number {
		font-size: 0.75rem;
	}

	.section-content {
		padding: 8px;
	}

	.card-field {
		font-size: 0.85rem;
		font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	}

	.section-title {
		font-size: 0.8rem;
	}

	.no-results-message {
		padding: 30px 15px;
		margin: 15px 0;
	}

	.no-results-content h3 {
		font-size: 1.1rem;
	}

	.no-results-content p {
		font-size: 0.9rem;
	}
}

/* ===== PRINT STYLES ===== */
@media print {
	.collection-container {
		max-width: none;
		padding: 0;
	}

	.card-item {
		break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ccc;
	}

	.collection-table {
		box-shadow: none;
	}

	.collection-footer {
		display: none;
	}

	.search-and-social-container {
		display: none;
	}
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
	.card-item,
	.section-toggle,
	.toggle-icon,
	.card-section {
		transition: none;
	}

	.card-item:hover {
		transform: none;
	}

	.card-image-placeholder {
		animation: none;
	}
}

/* High contrast mode */
@media (prefers-contrast: high) {
	.card-item {
		border-width: 2px;
	}

	.collection-table th,
	.collection-table td {
		border-width: 2px;
	}

	.card-section {
		border-width: 2px;
	}

	.badge,
	.badge-yes,
	.badge-no,
	.badge-special,
	.badge-favorite {
		border: 1px solid currentColor;
	}

	.chip {
		border-width: 2px;
	}
}
