/**
 * FIFA Next Match — Frontend Styles
 */

.fifa-nm {
	--fifa-nm-primary: #0066cc;
	--fifa-nm-live: #e53935;
	--fifa-nm-upcoming: #43a047;
	--fifa-nm-finished: #757575;
	--fifa-nm-gold: #d4af37;
	--fifa-nm-radius: 12px;
	--fifa-nm-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	--fifa-nm-gap: 1.25rem;
	box-sizing: border-box;
}

.fifa-nm *,
.fifa-nm *::before,
.fifa-nm *::after {
	box-sizing: inherit;
}

.fifa-nm__toolbar {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding-bottom: 2px;
}

.fifa-nm__search,
.fifa-nm__filter {
	flex: 1 1 0;
	min-width: 130px;
	max-width: none;
}

.fifa-nm__search {
	flex: 1.4 1 0;
	min-width: 160px;
	padding: 0.5rem 0.75rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 0.9rem;
	background: #fff;
}

.fifa-nm__filter {
	padding: 0.5rem 0.65rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	font-size: 0.9rem;
	width: 100%;
}

.fifa-nm__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--fifa-nm-gap);
}

.fifa-nm__empty {
	text-align: center;
	padding: 2rem;
	color: #666;
}

/* Match Card */
.fifa-nm-card {
	position: relative;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: var(--fifa-nm-radius);
	box-shadow: var(--fifa-nm-shadow);
	padding: 1.25rem;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fifa-nm--hover .fifa-nm-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.fifa-nm-card--live {
	border-color: var(--fifa-nm-live);
	box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.15);
}

.fifa-nm-card--today {
	border-left: 4px solid var(--fifa-nm-primary);
}

.fifa-nm-card--final {
	grid-column: 1 / -1;
	max-width: 720px;
	width: 100%;
	margin-inline: auto;
	border: 2px solid var(--fifa-nm-gold);
	background:
		radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 215, 0, 0.18) 0%, transparent 55%),
		linear-gradient(160deg, #fffef8 0%, #fff8e7 45%, #fff3d6 100%);
	box-shadow:
		0 8px 32px rgba(184, 134, 11, 0.18),
		0 0 0 1px rgba(212, 175, 55, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.8);
	padding: 0 1.5rem 1.5rem;
	animation: fifa-nm-glow 3s ease-in-out infinite;
}

.fifa-nm-card--final.fifa-nm-card--live {
	animation: fifa-nm-glow 3s ease-in-out infinite, fifa-nm-pulse 1.5s ease-in-out infinite;
}

.fifa-nm--no-animations .fifa-nm-card--final {
	animation: none;
}

/* Final hero banner */
.fifa-nm-card__final-hero {
	position: relative;
	text-align: center;
	margin: 0 -1.5rem 1.25rem;
	padding: 1.35rem 1rem 1.15rem;
	background: linear-gradient(135deg, #8b6914 0%, #d4af37 35%, #ffd700 50%, #d4af37 65%, #8b6914 100%);
	background-size: 200% 100%;
	animation: fifa-nm-final-shimmer 4s ease-in-out infinite;
	overflow: hidden;
	border-radius: calc(var(--fifa-nm-radius) - 2px) calc(var(--fifa-nm-radius) - 2px) 0 0;
}

.fifa-nm--no-animations .fifa-nm-card__final-hero {
	animation: none;
}

.fifa-nm-card__final-shine {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		105deg,
		transparent 35%,
		rgba(255, 255, 255, 0.35) 50%,
		transparent 65%
	);
	animation: fifa-nm-final-shine 3s ease-in-out infinite;
	pointer-events: none;
}

.fifa-nm--no-animations .fifa-nm-card__final-shine {
	display: none;
}

.fifa-nm-card__final-title {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
}

.fifa-nm-card__final-trophy {
	font-size: 1.35rem;
	line-height: 1;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.fifa-nm-card__final-word {
	font-size: clamp(1.75rem, 5vw, 2.25rem);
	font-weight: 900;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #1a1200;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
	line-height: 1;
}

.fifa-nm-card__final-subtitle {
	position: relative;
	margin: 0.45rem 0 0;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(26, 18, 0, 0.72);
}

.fifa-nm-card__final-venue {
	font-size: 0.78rem;
	font-weight: 600;
	color: #8b6914;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* Final card — teams & score */
.fifa-nm-card__teams--final {
	gap: 1rem;
	padding: 0.25rem 0;
}

.fifa-nm-card__flag--final {
	width: 64px;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	border: 2px solid rgba(212, 175, 55, 0.45);
}

.fifa-nm-card__team-name--final {
	font-size: 1.1rem;
	font-weight: 800;
	color: #1a1200;
}

.fifa-nm-card__center--final .fifa-nm-card__vs {
	font-size: 1rem;
	font-weight: 900;
	color: var(--fifa-nm-gold);
	letter-spacing: 0.12em;
}

.fifa-nm-card__center--final .fifa-nm-card__score {
	font-size: 2.25rem;
	color: #1a1200;
}

.fifa-nm-card--final .fifa-nm-card__footer {
	border-top-color: rgba(212, 175, 55, 0.35);
}

.fifa-nm-card--final .fifa-nm-card__countdown-value {
	color: #8b6914;
}

.fifa-nm-card--final .fifa-nm-card__status--upcoming {
	background: linear-gradient(135deg, #b8860b, #d4af37);
	color: #1a1200;
}

/* Dark layout — final card */
.fifa-nm--layout-dark .fifa-nm-card--final,
.fifa-nm-card--dark.fifa-nm-card--final {
	background:
		radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 215, 0, 0.12) 0%, transparent 55%),
		linear-gradient(160deg, #1e1a10 0%, #252015 45%, #1a1810 100%);
	border-color: #d4af37;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.45),
		0 0 0 1px rgba(212, 175, 55, 0.3);
}

.fifa-nm--layout-dark .fifa-nm-card__team-name--final,
.fifa-nm-card--dark.fifa-nm-card--final .fifa-nm-card__team-name--final {
	color: #fff8e1;
}

.fifa-nm--layout-dark .fifa-nm-card__center--final .fifa-nm-card__score,
.fifa-nm-card--dark.fifa-nm-card--final .fifa-nm-card__center--final .fifa-nm-card__score {
	color: #ffd700;
}

.fifa-nm--layout-dark .fifa-nm-card__final-venue,
.fifa-nm-card--dark.fifa-nm-card--final .fifa-nm-card__final-venue {
	color: #d4af37;
}

.fifa-nm--layout-dark .fifa-nm-card--final .fifa-nm-card__footer,
.fifa-nm-card--dark.fifa-nm-card--final .fifa-nm-card__footer {
	border-top-color: rgba(212, 175, 55, 0.25);
}

.fifa-nm--layout-dark .fifa-nm-card--final .fifa-nm-card__countdown-value,
.fifa-nm-card--dark.fifa-nm-card--final .fifa-nm-card__countdown-value {
	color: #ffd700;
}

/* Legacy ribbon alias (Elementor style controls) */
.fifa-nm-card__ribbon {
	display: none;
}

.fifa-nm-card__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	gap: 0.5rem;
}

.fifa-nm-card__stage {
	font-size: 0.8rem;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fifa-nm-card__status {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	color: #fff;
}

.fifa-nm-card__status--upcoming {
	background: var(--fifa-nm-upcoming);
}

.fifa-nm-card__status--live {
	background: var(--fifa-nm-live);
}

.fifa-nm-card__status--finished {
	background: var(--fifa-nm-finished);
}

.fifa-nm-card__teams {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 0.75rem;
	align-items: center;
	text-align: center;
}

.fifa-nm-card__team {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
}

.fifa-nm-card__team-name {
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.3;
}

.fifa-nm-card__team-hint {
	display: block;
	font-size: 0.72rem;
	font-weight: 500;
	color: #888;
	line-height: 1.35;
	margin-top: 0.2rem;
	max-width: 140px;
}

.fifa-nm-card--placeholder .fifa-nm-card__team-name {
	font-size: 0.82rem;
	line-height: 1.35;
}

.fifa-nm-card__flag {
	width: 48px;
	height: auto;
	border-radius: 4px;
	object-fit: cover;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.fifa-nm-card__center {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
}

.fifa-nm-card__vs {
	font-weight: 700;
	font-size: 0.85rem;
	color: #999;
}

.fifa-nm-card__score {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.75rem;
	font-weight: 800;
}

.fifa-nm-card__period,
.fifa-nm-card__pen {
	font-size: 0.75rem;
	font-weight: 600;
	color: #666;
}

.fifa-nm-card__pen {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: rgba(0, 102, 204, 0.08);
	color: var(--fifa-nm-primary);
}

.fifa-nm-card__draw {
	font-size: 0.8rem;
	color: #e65100;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fifa-nm-card__winner {
	font-size: 0.8rem;
	color: var(--fifa-nm-upcoming);
	font-weight: 600;
}

.fifa-nm-card__countdown-units {
	display: flex;
	flex-wrap: nowrap;
	align-items: baseline;
	justify-content: center;
	gap: 0.65rem;
	white-space: nowrap;
}

.fifa-nm-card__countdown-segment {
	display: inline-flex;
	align-items: baseline;
	gap: 0.25rem;
	font-size: 0.78rem;
	color: #666;
}

.fifa-nm-card__countdown-value {
	font-size: 1rem;
	font-weight: 800;
	line-height: 1;
	color: var(--fifa-nm-primary);
}

.fifa-nm-card__live-now {
	display: inline-block;
	padding: 0.35rem 0.85rem;
	background: var(--fifa-nm-live);
	color: #fff;
	font-weight: 800;
	font-size: 0.85rem;
	border-radius: 6px;
	animation: fifa-nm-pulse 1.5s ease-in-out infinite;
}

.fifa-nm--no-animations .fifa-nm-card__live-now {
	animation: none;
}

.fifa-nm-card__meta {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.85rem;
	color: #666;
	text-align: center;
}

.fifa-nm-card__footer {
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid #eee;
}

.fifa-nm-card__countdown {
	margin-bottom: 0.65rem;
	text-align: center;
}

.fifa-nm--layout-dark .fifa-nm-card__footer,
.fifa-nm-card--dark .fifa-nm-card__footer {
	border-top-color: #2d3340;
}

.fifa-nm-card__datetime {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: center;
}

.fifa-nm-card--dark,
.fifa-nm--layout-dark .fifa-nm-card {
	background: #1a1d24;
	border-color: #2d3340;
	color: #e8eaed;
}

.fifa-nm--layout-dark .fifa-nm-card__stage,
.fifa-nm-card--dark .fifa-nm-card__stage {
	color: #aab0bc;
}

.fifa-nm--layout-dark .fifa-nm-card__meta,
.fifa-nm-card--dark .fifa-nm-card__meta {
	color: #aab0bc;
}

.fifa-nm--layout-dark .fifa-nm-card__countdown-segment {
	color: #aab0bc;
}

.fifa-nm--layout-dark .fifa-nm-card__countdown-value {
	color: #64b5f6;
}

.fifa-nm--layout-dark .fifa-nm-card__pen,
.fifa-nm-card--dark .fifa-nm-card__pen {
	background: rgba(100, 181, 246, 0.12);
	color: #64b5f6;
}

.fifa-nm--layout-dark .fifa-nm-card__draw,
.fifa-nm-card--dark .fifa-nm-card__draw {
	color: #ffb74d;
}

.fifa-nm--layout-dark .fifa-nm-card__team-hint,
.fifa-nm-card--dark .fifa-nm-card__team-hint {
	color: #8892a0;
}

/* Skeleton */
.fifa-nm--loading .fifa-nm-card {
	pointer-events: none;
}

.fifa-nm-skeleton {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: fifa-nm-shimmer 1.5s infinite;
	border-radius: var(--fifa-nm-radius);
	min-height: 180px;
}

/* Confetti */
.fifa-nm-card__confetti {
	pointer-events: none;
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.fifa-nm-card--live.fifa-nm-card--final .fifa-nm-card__confetti::before,
.fifa-nm-card--live.fifa-nm-card--final .fifa-nm-card__confetti::after {
	content: '';
	position: absolute;
	width: 6px;
	height: 6px;
	border-radius: 1px;
	animation: fifa-nm-confetti 2s ease-out infinite;
}

.fifa-nm-card--live.fifa-nm-card--final .fifa-nm-card__confetti::before {
	background: #ffd700;
	top: 0;
	left: 20%;
	animation-delay: 0s;
}

.fifa-nm-card--live.fifa-nm-card--final .fifa-nm-card__confetti::after {
	background: #e53935;
	top: 0;
	left: 70%;
	animation-delay: 0.5s;
}

.fifa-nm--no-animations .fifa-nm-card__confetti {
	display: none;
}

@keyframes fifa-nm-glow {
	0%, 100% { box-shadow: 0 8px 32px rgba(184, 134, 11, 0.18), 0 0 0 1px rgba(212, 175, 55, 0.25); }
	50% { box-shadow: 0 8px 40px rgba(212, 175, 55, 0.35), 0 0 20px rgba(255, 215, 0, 0.2); }
}

@keyframes fifa-nm-final-shimmer {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

@keyframes fifa-nm-final-shine {
	0%, 100% { transform: translateX(-120%); opacity: 0; }
	50% { transform: translateX(120%); opacity: 1; }
}

@keyframes fifa-nm-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.75; }
}

@keyframes fifa-nm-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

@keyframes fifa-nm-confetti {
	0% { transform: translateY(0) rotate(0deg); opacity: 1; }
	100% { transform: translateY(120px) rotate(360deg); opacity: 0; }
}

@media (max-width: 600px) {
	.fifa-nm__toolbar {
		flex-wrap: wrap;
		overflow-x: visible;
	}

	.fifa-nm__search,
	.fifa-nm__filter {
		flex: 1 1 calc(50% - 0.25rem);
		min-width: calc(50% - 0.25rem);
	}

	.fifa-nm__search {
		flex: 1 1 100%;
		min-width: 100%;
	}

	.fifa-nm__grid {
		grid-template-columns: 1fr;
	}

	.fifa-nm-card__countdown-units {
		flex-wrap: wrap;
		white-space: normal;
		justify-content: center;
	}

	.fifa-nm-card__countdown-value {
		font-size: 0.9rem;
	}
}
