/*
File: frontend/styles/mycars-timeline.css
Purpose: Provide the hardened modal or sheet shell and grouped timeline styling for the My Cars VIN timeline.
*/

body.vx-mycars-timeline-open {
	overflow: hidden;
}

.vx-mycars-timeline-modal[hidden] {
	display: none;
}

.vx-mycars-timeline-modal {
	position: fixed;
	inset: 0;
	z-index: 1800;
	display: grid;
	place-items: center;
	padding: 24px;
}

.vx-mycars-timeline-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 9, 20, 0.72);
	backdrop-filter: blur(6px);
}

.vx-mycars-timeline-modal__dialog {
	position: relative;
	width: min(980px, 100%);
	max-height: min(90vh, 920px);
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 24px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 24px;
	background:
		linear-gradient(180deg, rgba(18, 28, 48, 0.96), rgba(10, 16, 30, 0.98));
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
	overflow: hidden;
}

.vx-mycars-timeline-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.vx-mycars-timeline-modal__eyebrow {
	margin: 0 0 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #e8c87a;
}

.vx-mycars-timeline-modal__title {
	margin: 0;
	font-family: "DM Serif Display", serif;
	font-size: clamp(1.6rem, 2.8vw, 2.25rem);
	line-height: 1.1;
	color: #f7fbff;
}

.vx-mycars-timeline-modal__subtitle {
	margin: 8px 0 0;
	color: #c8d0e0;
	line-height: 1.6;
}

.vx-mycars-timeline-modal__close {
	flex-shrink: 0;
}

.vx-mycars-timeline-summary {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.vx-mycars-timeline-summary__card {
	padding: 14px 16px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.04);
}

.vx-mycars-timeline-summary__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a97b0;
}

.vx-mycars-timeline-summary__value {
	color: #f7fbff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-modal__state {
	padding: 18px 20px;
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.04);
	color: #d6deef;
	line-height: 1.6;
}

.vx-mycars-timeline-modal__state--error {
	border-color: rgba(251, 113, 133, 0.4);
	background: rgba(251, 113, 133, 0.08);
	color: #ffe3e8;
}

.vx-mycars-timeline-modal__content {
	min-height: 0;
	overflow: auto;
	padding-right: 6px;
	overscroll-behavior: contain;
	scrollbar-gutter: stable both-edges;
	-webkit-overflow-scrolling: touch;
}

.vx-mycars-timeline-group {
	margin-top: 24px;
}

.vx-mycars-timeline-group:first-child {
	margin-top: 0;
}

.vx-mycars-timeline-group--undated {
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vx-mycars-timeline-group__year {
	margin: 0 0 12px;
	font-size: 1.1rem;
	font-weight: 700;
	color: #f7fbff;
}

.vx-mycars-timeline-group__month {
	margin: 20px 0 10px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #8a97b0;
}

.vx-mycars-timeline-list {
	display: grid;
	gap: 12px;
	position: relative;
}

.vx-mycars-timeline-item {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	gap: 12px;
	align-items: stretch;
}

.vx-mycars-timeline-item__rail {
	position: relative;
	display: flex;
	justify-content: center;
}

.vx-mycars-timeline-item__rail::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	transform: translateX(-50%);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
}

.vx-mycars-timeline-item__dot {
	position: relative;
	z-index: 1;
	width: 14px;
	height: 14px;
	margin-top: 22px;
	border-radius: 999px;
	border: 3px solid rgba(10, 16, 30, 0.98);
	background: #e8c87a;
	box-shadow: 0 0 0 1px rgba(232, 200, 122, 0.22);
}

.vx-mycars-timeline-item__panel {
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.04);
	overflow: hidden;
}

.vx-mycars-timeline-item__toggle {
	width: 100%;
	padding: 16px 18px;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.vx-mycars-timeline-item__toggle:hover {
	background: rgba(255, 255, 255, 0.02);
}

.vx-mycars-timeline-item__toggle:focus-visible {
	outline: 2px solid rgba(232, 200, 122, 0.4);
	outline-offset: -2px;
}

.vx-mycars-timeline-item__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
}

.vx-mycars-timeline-item__identity {
	min-width: 0;
}

.vx-mycars-timeline-item__chrome {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	min-width: 0;
}

.vx-mycars-timeline-item__date {
	margin-bottom: 6px;
	font-size: 0.82rem;
	color: #8a97b0;
}

.vx-mycars-timeline-item__kicker {
	margin-bottom: 6px;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #e8c87a;
}

.vx-mycars-timeline-item__title {
	margin: 0;
	font-size: 1.02rem;
	font-weight: 700;
	color: #f7fbff;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-item__summary {
	margin: 10px 0 0;
	color: #d6deef;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-item__badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	max-width: 100%;
}

.vx-mycars-timeline-item__toggle-indicator {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a97b0;
}

.vx-mycars-timeline-item__toggle-indicator::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.18s ease;
}

.vx-mycars-timeline-item.is-expanded .vx-mycars-timeline-item__toggle-indicator::after {
	transform: rotate(-135deg) translateY(-1px);
}

.vx-mycars-timeline-badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.06);
	font-size: 0.72rem;
	font-weight: 700;
	color: #d6deef;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-badge--verified {
	background: rgba(74, 222, 128, 0.14);
	border-color: rgba(74, 222, 128, 0.28);
	color: #d8ffe6;
}

.vx-mycars-timeline-badge--review {
	background: rgba(251, 191, 36, 0.14);
	border-color: rgba(251, 191, 36, 0.28);
	color: #fff1c4;
}

.vx-mycars-timeline-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.vx-mycars-timeline-item__meta-chip {
	padding: 8px 10px;
	border-radius: 12px;
	background: rgba(10, 16, 30, 0.52);
	font-size: 0.82rem;
	color: #d6deef;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-item__supporting-note {
	margin: 10px 0 0;
	font-size: 0.82rem;
	color: #9bbbe0;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-item__detail {
	padding: 0 18px 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vx-mycars-timeline-item__detail-row {
	margin-top: 14px;
}

.vx-mycars-timeline-item__detail-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a97b0;
}

.vx-mycars-timeline-item__detail-copy {
	margin: 0;
	color: #d6deef;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-item__detail-list {
	margin: 0;
	padding-left: 18px;
	color: #d6deef;
	line-height: 1.6;
}

.vx-mycars-timeline-item__detail-list li {
	overflow-wrap: anywhere;
}

.vx-mycars-timeline-item--milestone .vx-mycars-timeline-item__panel {
	background: linear-gradient(180deg, rgba(16, 28, 44, 0.92), rgba(10, 16, 30, 0.9));
	border-color: rgba(232, 200, 122, 0.18);
}

.vx-mycars-timeline-item--milestone .vx-mycars-timeline-item__dot {
	background: #4ade80;
	box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
}

.vx-mycars-timeline-item--milestone .vx-mycars-timeline-item__kicker {
	color: #b6e7c6;
}

.vx-mycars-timeline-item--same-day-support .vx-mycars-timeline-item__panel {
	border-color: rgba(74, 222, 128, 0.2);
}

.vx-mycars-timeline-item--undated .vx-mycars-timeline-item__date {
	color: #b3bccf;
}

@media (max-width: 840px) {
	.vx-mycars-timeline-summary {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.vx-mycars-timeline-modal {
		padding: 0;
	}

	.vx-mycars-timeline-modal__dialog {
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
		padding: 18px 18px max(24px, env(safe-area-inset-bottom));
	}

	.vx-mycars-timeline-modal__header,
	.vx-mycars-timeline-item__head {
		flex-direction: column;
	}

	.vx-mycars-timeline-item {
		grid-template-columns: 16px minmax(0, 1fr);
		gap: 10px;
	}

	.vx-mycars-timeline-item__chrome {
		align-items: flex-start;
	}

	.vx-mycars-timeline-item__badges {
		justify-content: flex-start;
	}
}
