/* ============================================================
   FYFX Marquee Card Widget
   ============================================================ */

.fyfx-marquee-card-wrapper {
	position: relative;
	overflow: hidden;
	width: 100%;
	display: flex;
	align-items: center;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.fyfx-marquee-card-wrapper:active {
	cursor: grabbing;
}

/* Fade edge overlays */
.fyfx-marquee-card-wrapper.fyfx-card-marquee-fade::before,
.fyfx-marquee-card-wrapper.fyfx-card-marquee-fade::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 80px;
	z-index: 2;
	pointer-events: none;
}

.fyfx-marquee-card-wrapper.fyfx-card-marquee-fade::before {
	left: 0;
	background: linear-gradient(to right, #0a0f2e, transparent);
}

.fyfx-marquee-card-wrapper.fyfx-card-marquee-fade::after {
	right: 0;
	background: linear-gradient(to left, #0a0f2e, transparent);
}

/* Scrolling track */
.fyfx-marquee-card-track {
	display: flex;
	align-items: stretch;
	gap: 16px;
	will-change: transform;
	animation-name: fyfx-marquee-card-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	animation-duration: 30s;
}

.fyfx-marquee-card-track.fyfx-card-pause-hover:hover {
	animation-play-state: paused;
}

@keyframes fyfx-marquee-card-scroll {
	0%   { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

/* ── Card (Desktop: image on right) ─────────────────────── */
.fyfx-marquee-card-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex-shrink: 0;
	gap: 12px;
	min-width: 190px;
	padding: 14px 16px;
	border-radius: 10px;
	background-color: #0d1545;
	border: 1px solid #1e2d6e;
	box-sizing: border-box;
	text-decoration: none;
	cursor: default;
}

/* Left: text content */
.fyfx-card-content {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	flex: 1;
	min-width: 0;
}

/* Right: image container */
.fyfx-card-image-wrap {
	flex-shrink: 0;
	width: 90px;
	height: 70px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(0, 0, 0, 0.2);
}

.fyfx-card-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Amount text */
.fyfx-card-amount {
	font-size: 24px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 6px;
	line-height: 1.2;
	white-space: nowrap;
}

/* Name + flag row */
.fyfx-card-name-row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.fyfx-card-name {
	font-size: 14px;
	color: #ffffff;
	font-weight: 500;
	white-space: nowrap;
}

.fyfx-card-flag {
	font-size: 18px;
	line-height: 1;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	overflow: hidden;
}

/* SVG flag images from shortcode */
.fyfx-card-flag img,
.fyfx-card-flag svg {
	width: 22px;
	height: auto;
	display: inline-block;
	vertical-align: middle;
}

/* ── Mobile: 2 cards visible, image top / content bottom, no overlay ── */
@media (max-width: 767px) {

	/* Track: stretch so cards with images are equal height */
	.fyfx-marquee-card-track {
		align-items: stretch;
	}

	/* Card: column layout, width controlled by --fyfx-mobile-card-width CSS variable */
	.fyfx-marquee-card-item {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0;
		min-width: var(--fyfx-mobile-card-width, 45vw);
		max-width: var(--fyfx-mobile-card-width, 45vw);
		overflow: hidden;
	}

	/* Image: static flow, sits at the top, fixed height */
	.fyfx-card-image-wrap {
		position: static;
		width: 100%;
		height: 160px;
		flex-shrink: 0;
		border-radius: 0;
		border: none;
		order: -1;
	}

	.fyfx-card-image-wrap img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	/* Content: normal flow below the image, name left / amount right */
	.fyfx-card-content {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 8px 0px 0px 0px;
		gap: 6px;
		background: none;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	/* Name + flag on the left */
	.fyfx-card-name-row {
		order: 1;
		flex-shrink: 1;
		min-width: 0;
	}

	.fyfx-card-name {
		font-size: 12px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* Amount on the right */
	.fyfx-card-amount {
		order: 2;
		margin-bottom: 0;
		font-size: 15px;
		flex-shrink: 0;
		white-space: nowrap;
	}

	/* No-image card: auto size, don't stretch to image-card height */
	.fyfx-marquee-card-item.fyfx-card-no-image {
		align-self: flex-start;
		min-width: 150px;
		max-width: none;
		padding: 12px;
		gap: 4px;
	}

	.fyfx-marquee-card-item.fyfx-card-no-image .fyfx-card-content {
		flex-direction: column;
		align-items: flex-start;
		padding: 0;
		justify-content: flex-start;
	}

	.fyfx-marquee-card-item.fyfx-card-no-image .fyfx-card-amount {
		order: 0;
		margin-bottom: 4px;
	}
}
