/* Body and Global Styles */
* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	width: 100%;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	line-height: 1.6;
	color: #333;
}

.spandiva-timeline {
	position: relative;
	padding: 40px 40px;
	margin: 0 auto;
	overflow: visible;
	--active-line-color: #007cba;
	--inactive-line-color: #ddd;
}

/* Timeline Track (vertical line) */
.timeline-track {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 4px;
	background-color: var(--inactive-line-color, #ddd);
	transform: translateX(-50%);
	z-index: 5;
	opacity: 0.3;
	transition: opacity 0.6s ease-out;
}

/* Line fills based on scroll progress */
.timeline-track::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: var(--timeline-line-progress, 0%);
	background: var(--active-line-color, #007cba);
	transition: height 0.3s ease-out;
}

/* Layout positioning */
.spandiva-timeline.layout-style-1 .timeline-track {
	left: 50%;
}

.spandiva-timeline.layout-style-2 .timeline-track,
.spandiva-timeline.layout-style-3 .timeline-track {
	left: 0;
}

/* Timeline Items */
.timeline-item {
	display: flex;
	margin-bottom: 60px;
	position: relative;
	z-index: 2;
	align-items: flex-start;
	transition: all 0.3s ease-in-out;
	overflow: visible;
}

/* Title Styling */
.timeline-title-vertical {
	position: absolute;
	top: 50%;
	right: 100%;
	text-align: center;
	transform: translateY(-50%) rotateZ(-90deg);
	transform-origin: center center;
	font-size: 12px;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
	overflow: visible;
	text-overflow: clip;
	z-index: 10;
	padding: 5px 0;
	transition: color 0.3s ease-in-out;
}

.timeline-item.is-active .timeline-title-vertical {
	color: var(--active-line-color, #007cba);
	font-weight: 700;
}

.timeline-title-before-image {
	font-size: 12px;
	font-weight: 600;
	color: #333;
	margin-bottom: 10px;
	transition: color 0.3s ease-in-out;
	text-align: center;
	width: 100%;
}

.timeline-item.is-active .timeline-title-before-image {
	color: var(--active-line-color, #007cba);
	font-weight: 700;
}

.timeline-title-before-description {
	font-size: 12px;
	font-weight: 600;
	color: #333;
	margin-bottom: 10px;
	transition: color 0.3s ease-in-out;
}


/* Bullet - Single unified position for all layouts */
.timeline-bullet {
	width: 20px;
	height: 20px;
	background-color: var(--inactive-line-color, #ddd);
	border-radius: 50%;
	position: absolute;
	left: -40px;
	top: 50%;
	z-index: 3;
	border: none;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	transform: translate(-50%, -50%);
	margin: 0;
}

/* Bullet active state */
.timeline-item.is-active .timeline-bullet {
	background-color: var(--active-line-color, #007cba);
	box-shadow: 0 0 12px var(--active-line-color, #007cba);
	animation: bullet-pulse 0.6s ease-out;
}

@keyframes bullet-pulse {
	0% {
		box-shadow: 0 0 0 0 var(--active-line-color, #007cba);
	}
	50% {
		box-shadow: 0 0 12px 6px var(--active-line-color, #007cba);
	}
	100% {
		box-shadow: 0 0 12px 0 var(--active-line-color, #007cba);
	}
}

/* Square bullet variant */
.spandiva-timeline.bullet-square .timeline-bullet {
	border-radius: 2px;
}

/* Content Container */
.timeline-content {
	flex: 1;
	padding: 20px;
	margin-left: 50px;
	position: relative;
	display: grid;
	grid-template-columns: var(--grid-template-columns, 35% 1fr);
	gap: 15px;
	align-items: start;
}

/* Layout Style 1 - Vertical */
.spandiva-timeline.layout-style-1 .timeline-content {
	margin-left: 0;
	display: flex;
	flex-direction: column;
	max-width: 400px;
}


.spandiva-timeline.layout-style-1 .item-left {
	display: flex;
	flex-direction: column;
}

.spandiva-timeline.layout-style-1 .item-right {
	margin-top: 15px;
}

/* Layout Style 2 - Split Left/Right */
.spandiva-timeline.layout-style-2 .timeline-content {
	display: grid;
	grid-template-columns: var(--grid-template-columns, 35% 1fr);
	gap: 15px;
	align-items: center;
}

.spandiva-timeline.layout-style-2 .item-left {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

/* Layout Style 3 - Split Right/Left */
.spandiva-timeline.layout-style-3 .timeline-content {
	display: grid;
	grid-template-columns: var(--grid-template-columns, 35% 1fr);
	gap: 15px;
	align-items: center;
}

.spandiva-timeline.layout-style-3 .item-left {
	display: flex;
	align-items: center;
}

.spandiva-timeline.layout-style-3 .item-right {
	text-align: center;
}

/* Image */
.timeline-image {
	margin: 15px;
	display: flex;
	justify-content: center;
}

.timeline-image img {
	height: auto;
	border-radius: 5px;
	display: block;
	transition: transform 0.3s ease-in-out;
}

.timeline-item.is-active .timeline-image img {
	transform: scale(1.05);
}

/* Description */
.timeline-description {
	margin: 0;
	font-size: 14px;
	color: #666;
	line-height: 1.6;
	transition: color 0.3s ease-in-out;
}


/* Animations */
@keyframes fadeInUp {
	0% {
		opacity: 0;
		transform: translateY(30px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

.timeline-item {
	opacity: 0;
	animation: fadeInUp 0.8s ease-out forwards;
}

.timeline-item.is-active {
	opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.spandiva-timeline.layout-style-2 .timeline-content,
	.spandiva-timeline.layout-style-3 .timeline-content {
		flex-direction: column;
		align-items: flex-start;
		grid-template-columns: 1fr;
	}

	.spandiva-timeline.layout-style-2 .item-left,
	.spandiva-timeline.layout-style-2 .item-right,
	.spandiva-timeline.layout-style-3 .item-left,
	.spandiva-timeline.layout-style-3 .item-right {
		text-align: left;
		align-items: flex-start;
	}
}

@media (max-width: 768px) {
	.spandiva-timeline {
		padding: 20px 0;
	}

	.timeline-item {
		margin-bottom: 40px;
		flex-direction: column !important;
	}

	.timeline-bullet {
		position: absolute;
		left: 15px;
		top: 50%;
		margin: 0;
		transform: translate(-50%, -50%);
	}

	.timeline-content {
		margin-left: 50px !important;
		margin-right: 0 !important;
		width: calc(100% - 50px);
		flex-direction: column;
	}

	.spandiva-timeline.layout-style-1 .timeline-track,
	.spandiva-timeline.layout-style-2 .timeline-track,
	.spandiva-timeline.layout-style-3 .timeline-track {
		left: 15px;
	}

	.spandiva-timeline.layout-style-2 .item-left,
	.spandiva-timeline.layout-style-2 .item-right,
	.spandiva-timeline.layout-style-3 .item-left,
	.spandiva-timeline.layout-style-3 .item-right {
		text-align: left;
		align-items: flex-start;
	}
}
