/* =========================================================
   Kurs Timeline widget
   ========================================================= */

@keyframes kursMeshGradient {
	0% {
		background-position: 0% 20%;
	}
	25% {
		background-position: 100% 50%;
	}
	50% {
		background-position: 50% 70%;
	}
	100% {
		background-position: 0% 20%;
	}
}

.kurs-timeline-widget {
	padding: 48px 24px;
	border-radius: 16px;
	background: #0f172a;
	color: #f8fafc;
}

.kurs-timeline-header {
	text-align: center;
	margin-bottom: 32px;
}

.kurs-timeline-header h2 {
	font-size: 2rem;
	margin: 0 0 8px;
}

.kurs-timeline-header p {
	margin: 0;
	opacity: 0.7;
}

.kurs-timeline-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
}

.kurs-timeline-scroll {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 8px 4px 32px;
	scroll-behavior: smooth;
	scrollbar-width: none;
	scroll-snap-type: x mandatory;
	flex: 0 1 auto;
	margin-left: auto;
	margin-right: auto;
	min-width: 0; /* dopušta ispravno JS mjerenje širine unutar flex reda */
}

.kurs-timeline-scroll::-webkit-scrollbar {
	display: none;
}

.kurs-timeline-item {
	flex: 0 0 260px;
	scroll-snap-align: start;
}

.kurs-timeline-card {
	position: relative;
	border-radius: 16px;
	background: #1e293b;
	border: 1px solid rgba(255, 255, 255, 0.1);
	cursor: pointer;
	transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
	height: 340px;
	overflow: hidden;
}

.kurs-timeline-card-img,
.elementor-widget-container .kurs-timeline-card-img,
.elementor-element .kurs-timeline-card-img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	opacity: 0;
	transform: scale(1.05);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.kurs-timeline-card-img[src] {
	opacity: 1;
}

.kurs-timeline-card:hover .kurs-timeline-card-img,
.kurs-timeline-card:focus .kurs-timeline-card-img {
	transform: scale(1.12);
}

.kurs-timeline-card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient( to bottom, transparent 30%, rgba(15, 23, 42, 0.95) );
	opacity: 0;
	transition: opacity 0.5s ease;
}

.kurs-timeline-card-img[src] ~ .kurs-timeline-card-overlay {
	opacity: 1;
}

.kurs-timeline-card:hover,
.kurs-timeline-card:focus {
	transform: translateY(-10px);
	border-color: #3b82f6;
	box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
	outline: none;
}

.kurs-timeline-period-tag {
	position: absolute;
	top: 16px;
	left: 16px;
	background: #3b82f6;
	color: #fff;
	padding: 3px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	z-index: 2;
}

.kurs-timeline-card-body {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px;
	z-index: 2;
}

.kurs-timeline-card-body p {
	margin: 0;
	font-size: 1rem;
	color: #f8fafc;
	font-weight: 500;
}

.kurs-timeline-axis {
	margin-top: 16px;
	height: 1px;
	background: rgba(255, 255, 255, 0.1);
	position: relative;
	display: flex;
	justify-content: center;
}

.kurs-timeline-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #0f172a;
	border: 3px solid #94a3b8;
	position: absolute;
	top: -7px;
	transition: 0.3s ease;
}

.kurs-timeline-item:hover .kurs-timeline-dot,
.kurs-timeline-item:focus-within .kurs-timeline-dot {
	transform: scale(1.3);
}

/* --- Strelice --- */
.kurs-timeline-arrow {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: transparent;
	color: #f8fafc;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: 0.25s ease;
}

.kurs-timeline-arrow:hover {
	background: #3b82f6;
	border-color: #3b82f6;
}

/* --- Modal --- */
.kurs-timeline-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 20px;
}

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

.kurs-timeline-modal-overlay {
	position: absolute;
	inset: 0;
}

.kurs-timeline-modal-box {
	position: relative;
	background: #0f172a;
	color: #f8fafc;
	width: 100%;
	max-width: 600px;
	max-height: 85vh;
	overflow-y: auto;
	border-radius: 20px;
	padding: 32px;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.kurs-timeline-modal-box h2 {
	margin: 0 0 20px;
	color: #3b82f6;
}

.kurs-timeline-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
}

.kurs-timeline-event-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.kurs-timeline-event-row {
	display: block;
	text-decoration: none;
	color: inherit;
	padding: 14px 16px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.04);
	transition: background-color 0.2s ease;
}

.kurs-timeline-event-row:hover {
	background: rgba(59, 130, 246, 0.15);
}

.kurs-timeline-event-title {
	font-weight: 600;
	margin-bottom: 4px;
}

.kurs-timeline-event-excerpt {
	font-size: 0.85rem;
	opacity: 0.65;
}

@media (max-width: 768px) {
	.kurs-timeline-item {
		flex: 0 0 220px;
	}

	.kurs-timeline-header h2 {
		font-size: 1.5rem;
	}

	.kurs-timeline-arrow {
		display: none;
	}
}
