/**
 * Race Timeline — #969
 *
 * Styles for the Timeline tab on fecha detail view.
 * Uses NE design system tokens (tokens.css) and pill classes (pills.css).
 */

/* Container */
.ne-timeline {
	padding: var(--ne-space-4) 0;
}

/* Empty state */
.ne-timeline--empty {
	padding: var(--ne-space-6) 0;
}

.ne-timeline__empty {
	text-align: center;
	color: var(--ne-text-muted);
	padding: var(--ne-space-8) var(--ne-space-4);
}

.ne-timeline__empty i {
	font-size: 2rem;
	margin-bottom: var(--ne-space-3);
	opacity: 0.5;
}

.ne-timeline__empty p {
	margin: 0;
	font-size: 0.9rem;
}

/* Summary stats row */
.ne-timeline__summary {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--ne-space-3);
	margin-bottom: var(--ne-space-6);
}

.ne-timeline__stat {
	text-align: center;
	padding: var(--ne-space-4);
}

.ne-timeline__stat-value {
	font-family: var(--ne-font-mono);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--ne-text);
	line-height: 1;
	margin-bottom: var(--ne-space-1);
}

.ne-timeline__stat-label {
	font-size: 0.75rem;
	color: var(--ne-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Highlights — horizontal scroll */
.ne-timeline__highlights {
	display: flex;
	gap: var(--ne-space-4);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: var(--ne-space-3);
	margin-bottom: var(--ne-space-6);
	-webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.ne-timeline__highlights::-webkit-scrollbar {
	height: 4px;
}

.ne-timeline__highlights::-webkit-scrollbar-track {
	background: transparent;
}

.ne-timeline__highlights::-webkit-scrollbar-thumb {
	background: var(--ne-border-s);
	border-radius: 2px;
}

.ne-timeline__highlight-card {
	flex: 0 0 240px;
	scroll-snap-align: start;
	border-radius: var(--ne-radius-md);
	padding: var(--ne-space-4);
	background: var(--ne-elevated);
	position: relative;
}

/* Relevance score badge on highlight card */
.ne-timeline__highlight-score {
	font-family: var(--ne-font-mono);
	font-size: 1.5rem;
	font-weight: 700;
	float: right;
	line-height: 1;
}

/* Type row */
.ne-timeline__highlight-type {
	display: flex;
	align-items: center;
	gap: var(--ne-space-2);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: var(--ne-space-2);
}

.ne-timeline__highlight-type i {
	font-size: 0.8rem;
}

/* Type-specific colors for icon + score on highlight cards */
.ne-timeline__highlight-card--overtake .ne-timeline__highlight-type,
.ne-timeline__highlight-card--overtake .ne-timeline__highlight-score      { color: var(--ne-green); }
.ne-timeline__highlight-card--incident .ne-timeline__highlight-type,
.ne-timeline__highlight-card--incident .ne-timeline__highlight-score      { color: var(--ne-red); }
.ne-timeline__highlight-card--penalty .ne-timeline__highlight-type,
.ne-timeline__highlight-card--penalty .ne-timeline__highlight-score       { color: var(--ne-yellow); }
.ne-timeline__highlight-card--fastest_lap .ne-timeline__highlight-type,
.ne-timeline__highlight-card--fastest_lap .ne-timeline__highlight-score   { color: var(--ne-accent); }
.ne-timeline__highlight-card--dnf .ne-timeline__highlight-type,
.ne-timeline__highlight-card--dnf .ne-timeline__highlight-score           { color: var(--ne-text-muted); }
.ne-timeline__highlight-card--dns .ne-timeline__highlight-type,
.ne-timeline__highlight-card--dns .ne-timeline__highlight-score           { color: var(--ne-text-muted); }
.ne-timeline__highlight-card--position_loss .ne-timeline__highlight-type,
.ne-timeline__highlight-card--position_loss .ne-timeline__highlight-score { color: var(--ne-text-subtle); }

/* Description */
.ne-timeline__highlight-desc {
	font-size: 0.85rem;
	color: var(--ne-text);
	line-height: 1.4;
	margin-bottom: var(--ne-space-2);
}

/* Lap label */
.ne-timeline__highlight-lap {
	font-family: var(--ne-font-mono);
	font-size: 0.7rem;
	color: var(--ne-text-subtle);
}

/* Filter row */
.ne-timeline__filters {
	display: flex;
	align-items: center;
	gap: var(--ne-space-3);
	margin-bottom: var(--ne-space-5);
	flex-wrap: wrap;
}

.ne-timeline__pills {
	display: flex;
	gap: var(--ne-space-2);
	flex-wrap: wrap;
}

.ne-pill--interactive {
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ne-pill--interactive:hover {
	background: var(--ne-border-s);
}

.ne-pill--interactive.active {
	background: var(--ne-accent-glow);
	color: var(--ne-accent);
	border-color: var(--ne-accent-soft);
}

.ne-timeline__pilot-filter {
	margin-left: auto;
}

.ne-timeline__pilot-filter .ne-select,
.ne-timeline__pilot-filter select {
	background: var(--ne-elevated);
	color: var(--ne-text);
	border: 1px solid var(--ne-border-s);
	border-radius: var(--ne-radius-md);
	padding: var(--ne-space-1) var(--ne-space-3);
	font-size: 0.8rem;
	font-family: var(--ne-font-body);
	min-width: 160px;
}

/* Chronological log — vertical timeline */
.ne-timeline__log {
	position: relative;
	padding-left: var(--ne-space-8);
}

.ne-timeline__log::before {
	content: '';
	position: absolute;
	left: 1rem;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--ne-border);
}

/* Lap separator */
.ne-timeline__lap-sep {
	padding: var(--ne-space-3) 0 var(--ne-space-2);
	font-family: var(--ne-font-mono);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ne-text-subtle);
	position: relative;
}

.ne-timeline__lap-sep::before {
	content: '';
	position: absolute;
	left: calc(-1 * var(--ne-space-8) + 1rem - 3px);
	top: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ne-border-s);
	transform: translateY(-50%);
}

/* Event row */
.ne-timeline__event {
	display: flex;
	align-items: flex-start;
	gap: var(--ne-space-3);
	padding: var(--ne-space-3) 0;
	position: relative;
}

.ne-timeline__event + .ne-timeline__event {
	border-top: 1px solid var(--ne-border);
}

/* Lap label */
.ne-timeline__event-lap {
	flex: 0 0 3rem;
	font-family: var(--ne-font-mono);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ne-text-muted);
	text-align: right;
	padding-top: 2px;
}

/* Event icon dot */
.ne-timeline__event-icon {
	flex: 0 0 2rem;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ne-elevated);
	z-index: 1;
	font-size: 0.75rem;
}

/* Icon colors per type */
.ne-timeline__event-icon--overtake      { color: var(--ne-green); }
.ne-timeline__event-icon--position_loss { color: var(--ne-text-muted); }
.ne-timeline__event-icon--incident      { color: var(--ne-red); }
.ne-timeline__event-icon--penalty       { color: var(--ne-yellow); }
.ne-timeline__event-icon--dnf           { color: var(--ne-text-muted); }
.ne-timeline__event-icon--dns           { color: var(--ne-text-subtle); }
.ne-timeline__event-icon--fastest_lap   { color: var(--ne-accent); }

/* Event body */
.ne-timeline__event-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ne-timeline__event-desc {
	font-size: 0.85rem;
	color: var(--ne-text);
	line-height: 1.4;
}

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

/* Score pill */
.ne-timeline__event-score {
	flex: 0 0 auto;
	padding-top: 2px;
}

.ne-timeline__event-score .ne-pill {
	font-size: 0.65rem;
	padding: 2px var(--ne-space-2);
	min-width: 28px;
	justify-content: center;
}

/* ===== Mobile responsive ===== */
@media (max-width: 640px) {
	.ne-timeline__summary {
		grid-template-columns: repeat(2, 1fr);
	}

	.ne-timeline__highlight-card {
		flex: 0 0 200px;
	}

	.ne-timeline__filters {
		flex-direction: column;
		align-items: stretch;
	}

	.ne-timeline__pilot-filter {
		margin-left: 0;
	}

	.ne-timeline__pilot-filter select {
		width: 100%;
	}

	.ne-timeline__log {
		padding-left: var(--ne-space-5);
	}

	.ne-timeline__log::before {
		left: 0.5rem;
	}

	.ne-timeline__event-lap {
		flex: 0 0 2.5rem;
		font-size: 0.65rem;
	}

	.ne-timeline__event-icon {
		flex: 0 0 1.5rem;
		width: 1.5rem;
		height: 1.5rem;
		font-size: 0.65rem;
	}

	.ne-timeline__event-desc {
		font-size: 0.8rem;
	}

	.ne-timeline__lap-sep::before {
		left: calc(-1 * var(--ne-space-5) + 0.5rem - 3px);
	}
}
