/* NE Design System — modules/profiles.css — Phase 2 (#65), Refactor (#70) */
/* Driver/user profile pages — loaded conditionally */

/* === Profile header === */
.ne-profile {
	display: flex;
	align-items: center;
	gap: var(--ne-space-6);
	padding: var(--ne-space-6) 0;
}

.ne-profile__avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	border: 3px solid var(--ne-accent-soft);
	object-fit: cover;
	flex-shrink: 0;
}

.ne-profile__name {
	font-family: var(--ne-font-display);
	font-size: 2rem;
	letter-spacing: -1px;
	color: var(--ne-text);
	margin: 0;
}

.ne-profile__handle {
	font-family: var(--ne-font-mono);
	font-size: 0.85rem;
	color: var(--ne-text-subtle);
	display: block;
	margin-top: var(--ne-space-1);
}

/* === Stats row (hero + counters) === */
.ne-stats-row {
	display: flex;
	gap: var(--ne-space-8);
	padding: var(--ne-space-5) 0;
	border-top: 1px solid var(--ne-border);
	border-bottom: 1px solid var(--ne-border);
	justify-content: center;
}

.ne-stat {
	text-align: center;
	min-width: 80px;
}

.ne-stat__value {
	font-family: var(--ne-font-mono);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--ne-text);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--ne-space-2);
	line-height: 1.2;
}

.ne-stat__label {
	font-family: var(--ne-font-mono);
	font-size: 0.688rem;
	font-weight: 500;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--ne-text-subtle);
	margin-top: var(--ne-space-2);
}

/* === Stats row compact variant (historial counters as capsules) === */
.ne-stats-row--compact {
	border-top: none;
	border-bottom: none;
	flex-wrap: wrap;
	gap: var(--ne-space-4);
	padding: var(--ne-space-4) 0 var(--ne-space-6);
}

.ne-stats-row--compact .ne-stat {
	background: var(--ne-surface);
	border: 1px solid var(--ne-border);
	border-radius: var(--ne-radius-md);
	padding: var(--ne-space-4) var(--ne-space-5);
	min-width: 100px;
	box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25),
				inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ne-stats-row--compact .ne-stat__value {
	font-size: 1.75rem;
}

/* === Achievement pills === */
.ne-achievements {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ne-space-2);
}

/* === ELO rating === */
.ne-elo {
	display: inline-flex;
	align-items: center;
	gap: var(--ne-space-2);
	font-family: var(--ne-font-mono);
	font-size: 1rem;
	font-weight: 600;
}

.ne-elo__change {
	font-size: 0.75rem;
	font-weight: 500;
}

.ne-elo__change.is-positive {
	color: var(--ne-green);
}

.ne-elo__change.is-negative {
	color: var(--ne-red);
}

/* ne-tabs: moved to components/tabs.css (#75) */

/* === Label line (profile-scoped, mirrors racing.css ne-label-line) === */
.ne-label-line {
	display: flex;
	align-items: center;
	gap: var(--ne-space-4);
	margin-bottom: var(--ne-space-6);
}

.ne-label-line__text {
	font-family: var(--ne-font-mono);
	font-size: 0.688rem;
	font-weight: 500;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--ne-text-subtle);
	white-space: nowrap;
}

.ne-label-line__rule {
	flex: 1;
	height: 1px;
	background: var(--ne-border);
}

/* === Panel visibility (tab system) === */
[id^="panel-"] {
	display: none;
}

[id^="panel-"].is-active {
	display: block;
}

/* === Profile table — compact column widths === */
.ne-table--profile {
	table-layout: fixed;
}

.ne-table--profile th:nth-child(1),
.ne-table--profile td:nth-child(1) { width: 80px; padding-right: var(--ne-space-3); }
.ne-table--profile th:nth-child(5),
.ne-table--profile td:nth-child(5),
.ne-table--profile th:nth-child(6),
.ne-table--profile td:nth-child(6),
.ne-table--profile th:nth-child(7),
.ne-table--profile td:nth-child(7) { width: 55px; }
.ne-table--profile th:nth-child(8),
.ne-table--profile td:nth-child(8) { width: 65px; }

/* Inline cell helper (icon + text) */
.ne-cell-inline {
	display: flex;
	align-items: center;
	gap: var(--ne-space-2);
}

.ne-cell-inline__icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

/* Track cell (name + meta stacked) */
.ne-cell-track__name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ne-cell-track__meta {
	font-size: 0.7rem;
	color: var(--ne-text-muted);
}

/* ============================================================
   WIN CARDS — Trophy style with neumorphic depth
   ============================================================ */
.ne-win-card {
	position: relative;
	border-radius: var(--ne-radius-lg);
	background:
		linear-gradient(135deg,
			rgba(255,255,255, 0.03) 0%,
			rgba(255,255,255, 0) 60%),
		var(--ne-surface);
	border: 1px solid var(--ne-border);
	box-shadow:
		4px 4px 12px rgba(0, 0, 0, 0.4),
		-2px -2px 8px rgba(255, 255, 255, 0.03),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	overflow: hidden;
	transition: transform var(--ne-duration) var(--ne-ease),
				box-shadow var(--ne-duration) var(--ne-ease),
				border-color var(--ne-duration) var(--ne-ease);
}

.ne-win-card:hover {
	transform: translateY(-3px);
	border-color: var(--ne-accent-soft);
	box-shadow:
		6px 8px 20px rgba(0, 0, 0, 0.5),
		-2px -2px 10px rgba(255, 255, 255, 0.04),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Track outline area — centered, with subtle radial glow */
.ne-win-card__outline {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--ne-space-5) var(--ne-space-4) var(--ne-space-3);
	background: radial-gradient(ellipse at center, rgba(100, 140, 200, 0.06) 0%, transparent 70%);
	min-height: 100px;
}

.ne-win-card__outline img {
	max-width: 100%;
	max-height: 80px;
	object-fit: contain;
	filter: brightness(0) invert(0.55);
	transition: filter var(--ne-duration);
}

.ne-win-card:hover .ne-win-card__outline img {
	filter: brightness(0) invert(0.8);
}

/* Card body */
.ne-win-card__body {
	padding: 0 var(--ne-space-4) var(--ne-space-4);
}

.ne-win-card__track {
	font-family: var(--ne-font-display);
	font-size: 1rem;
	color: var(--ne-text);
	margin: 0 0 var(--ne-space-2) 0;
	line-height: 1.3;
}

.ne-win-card__location {
	display: flex;
	align-items: center;
	gap: var(--ne-space-2);
	font-family: var(--ne-font-mono);
	font-size: 0.75rem;
	color: var(--ne-text-subtle);
	margin-bottom: var(--ne-space-3);
}

/* Flag override inside win cards */
.ne-win-card__location .box-flag.flag {
	position: relative !important;
	left: unset !important;
	top: unset !important;
	display: inline-block;
	vertical-align: middle;
}

/* Footer: date + event separated by a subtle line */
.ne-win-card__footer {
	border-top: 1px solid var(--ne-border);
	padding-top: var(--ne-space-2);
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ne-win-card__date {
	font-family: var(--ne-font-mono);
	font-size: 0.688rem;
	color: var(--ne-text-muted);
	letter-spacing: 0.5px;
}

.ne-win-card__event {
	font-family: var(--ne-font-mono);
	font-size: 0.75rem;
	color: var(--ne-text-subtle);
}

/* === Light theme overrides (#216) === */
body:not(.dark-theme) .ne-stats-row--compact .ne-stat {
	box-shadow:
		2px 2px 6px rgba(0, 0, 0, 0.08),
		-1px -1px 4px rgba(255, 255, 255, 0.7),
		inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body:not(.dark-theme) .ne-win-card {
	background: var(--ne-surface);
	box-shadow:
		2px 2px 8px rgba(0, 0, 0, 0.08),
		-1px -1px 4px rgba(255, 255, 255, 0.7),
		inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body:not(.dark-theme) .ne-win-card:hover {
	box-shadow:
		4px 6px 14px rgba(0, 0, 0, 0.12),
		-1px -1px 6px rgba(255, 255, 255, 0.6),
		inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body:not(.dark-theme) .ne-win-card__outline img {
	filter: brightness(0) invert(0.35);
}

body:not(.dark-theme) .ne-win-card:hover .ne-win-card__outline img {
	filter: brightness(0) invert(0.15);
}

body:not(.dark-theme) .ne-win-card__outline {
	background: radial-gradient(ellipse at center, rgba(0, 50, 100, 0.04) 0%, transparent 70%);
}

/* === Responsive === */
@media (max-width: 768px) {
	.ne-profile {
		flex-direction: column;
		text-align: center;
		gap: var(--ne-space-3);
	}

	.ne-profile__name-row {
		justify-content: center;
	}

	.ne-stats-row {
		flex-wrap: wrap;
		gap: var(--ne-space-4);
	}

	.ne-stat {
		min-width: 70px;
	}

	.ne-stats-row--compact {
		gap: var(--ne-space-3);
	}

	.ne-stats-row--compact .ne-stat {
		min-width: 80px;
		padding: var(--ne-space-3) var(--ne-space-4);
	}

	.ne-stats-row--compact .ne-stat__value {
		font-size: 1.25rem;
	}

	.ne-profile__name {
		font-size: 1.5rem;
	}

	.ne-profile__avatar {
		width: 72px;
		height: 72px;
	}

	/* ne-tabs responsive: moved to responsive.css (#75) */

	.ne-table--profile {
		table-layout: auto;
	}

	.ne-win-card__outline {
		min-height: 80px;
	}
}
