/* Base Timeline Styles */
.timeline {
	padding: 2rem;
	position: relative;
}

.timeline::before {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 2px;
	height: calc(100% - 50px);
	background: #3b82f6;
	animation: growLine 1s ease-out forwards;
	z-index: 1;
}

.timeline::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 30px;
	height: 30px;
	background: #fff;
	border: 3px solid #3b82f6;
	border-radius: 50%;
	box-shadow: 0 0 0 8px #fff;
	z-index: 1;
}

/* Timeline Dots */
.timeline-dot {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #3b82f6;
	transition: all 0.3s ease;
	z-index: 2;
	border: 3px solid #fff;
	box-shadow: 0 0 0 2px #3b82f6;
}

/* Timeline Items - Desktop */
.timeline-item {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	margin-bottom: 2rem;
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.6s ease-out;
}

.timeline-item.visible {
	opacity: 1;
	transform: translateY(0);
}

.timeline-item:nth-child(odd) .timeline-content {
	grid-column: 2;
}

.timeline-item:nth-child(even) .timeline-content {
	grid-column: 1;
	text-align: right;
}

/* Timeline Cards */
.timeline-card {
	background: white;
	padding: 1.5rem;
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	z-index: 1;
	/* width: 100%; */
}

/* Card Animations */
.timeline-card:hover {
	transform: translateY(-5px) scale(1.02);
	box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.timeline-card:active,
.timeline-card.pressed {
	transform: scale(0.98);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: all 0.1s ease-out;
}

/* Popup Styles */
.popup-card {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80vw;
	height: 70vh;
	max-width: 1000px;
	background: white;
	padding: 3rem;
	border-radius: 12px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	z-index: 1000;
	display: none;
	overflow-y: auto;
}

/* Scrollbar Styles */
.popup-card::-webkit-scrollbar {
	width: 0.5rem;
}

.popup-card::-webkit-scrollbar-track {
	background: rgba(59, 130, 246, 0.2);
}

.popup-card::-webkit-scrollbar-thumb {
	background: rgba(59, 130, 246, 0.8);
	border-radius: 9999px;
}

.popup-card::-webkit-scrollbar-thumb:hover {
	background: rgba(59, 130, 246, 0.95);
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
	z-index: 998;
}

.overlay.active {
	opacity: 1;
	visibility: visible;
	background: rgba(255, 255, 255, 0.8);
}

/* Card Details */
.card-detail {
	display: none;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
	margin-top: 2rem;
	overflow-y: auto;
}

.card-detail::-webkit-scrollbar {
	width: 0.5rem;
}

.card-detail::-webkit-scrollbar-track {
	background: rgba(59, 130, 246, 0.2);
}

.card-detail::-webkit-scrollbar-thumb {
	background: rgba(59, 130, 246, 0.8);
	border-radius: 9999px;
}

.card-detail::-webkit-scrollbar-thumb:hover {
	background: rgba(59, 130, 246, 0.95);
}

.popup-card .card-detail {
	display: block;
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}

.popup-card .card-summary {
	padding-bottom: 2rem;
	border-bottom: 1px solid #e5e7eb;
}

/* Mobile Styles */
@media (max-width: 768px) {
	.timeline {
		padding: 0;
		margin-left: 1rem;
	}

	.timeline::before {
		left: 0;
		transform: none;
		height: 100%;
	}

	.timeline::after {
		left: -0.9rem;
		transform: none;
	}

	.timeline-dot {
		left: -2.6rem;
		transform: none;
	}

	.timeline-item {
		grid-template-columns: 1fr;
		margin-left: 2rem;
		gap: 1rem;
		width: calc(100% - 2rem);
	}

	.timeline-content {
		grid-column: 1 !important;
		text-align: left !important;
		margin-left: 1rem !important;
		width: 100% !important;
	}

	.timeline-card {
		width: 100% !important;
		margin: 0 !important;
		padding: 1rem !important;
		right: 0.7rem;
	}

	.timeline-item:nth-child(odd) .timeline-content,
	.timeline-item:nth-child(even) .timeline-content {
		grid-column: 1;
		text-align: left;
	}

	.popup-card {
		width: 90vw;
		height: 80vh;
		padding: 1.5rem;
	}
}

@keyframes growLine {
	0% {
		transform: translateX(-50%) scaleY(0);
	}
	100% {
		transform: translateX(-50%) scaleY(1);
	}
}
