/* Apex Bar : barre d'annonce (une ligne, hauteur fixe, messages qui défilent). */
.apxbar {
	--o: #ff4d1c;
	--g: #ffb347;
	--t: #f5f5f5;
	--m: #a3a3ad;
	position: relative;
	z-index: 1000;
	height: 40px;
	overflow: hidden;
	color: var(--t);
	font-family: 'Rajdhani', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 15px;
	line-height: 1;
	background:
		radial-gradient(500px 80px at 50% 120%, rgba(255, 77, 28, 0.28), transparent 70%),
		#0a0a0c;
	box-shadow: inset 0 -1px 0 rgba(255, 77, 28, 0.45);
}

.apxbar *,
.apxbar *::before,
.apxbar *::after {
	box-sizing: border-box;
}

.apxbar.is-preview::before {
	content: 'Aperçu';
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
	padding: 2px 6px;
	background: rgba(255, 179, 71, 0.15);
	color: var(--g);
	font-size: 11px;
	font-weight: 700;
}

.apxbar__inner {
	height: 100%;
	max-width: 980px;
	margin: 0 auto;
	padding: 0 44px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 8px;
}

.apxbar__track {
	position: relative;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

.apxbar__item {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	opacity: 0;
	pointer-events: none;
}

.apxbar__item.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* Arrivée et départ selon le sens : vers le haut (automatique), vers la gauche (suivant), vers la droite (précédent). */
.apxbar__item.in-up { animation: apxbarInUp 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.apxbar__item.out-up { animation: apxbarOutUp 0.45s cubic-bezier(0.55, 0, 0.75, 0.25) both; }
.apxbar__item.in-next { animation: apxbarInNext 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.apxbar__item.out-next { animation: apxbarOutNext 0.35s ease-in both; }
.apxbar__item.in-prev { animation: apxbarInPrev 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.apxbar__item.out-prev { animation: apxbarOutPrev 0.35s ease-in both; }

@keyframes apxbarInUp { from { opacity: 0; transform: translateY(70%); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes apxbarOutUp { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-70%); filter: blur(3px); } }
@keyframes apxbarInNext { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes apxbarOutNext { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-48px); } }
@keyframes apxbarInPrev { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@keyframes apxbarOutPrev { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(48px); } }

/* Petit « pop » de l'icône à l'arrivée du message. */
.apxbar__item.in-up .apxbar__icon,
.apxbar__item.in-next .apxbar__icon,
.apxbar__item.in-prev .apxbar__icon {
	animation: apxbarPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes apxbarPop { from { transform: scale(0.3) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Barre de progression jusqu'au prochain message. */
.apxbar__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: rgba(255, 255, 255, 0.06);
	pointer-events: none;
}

.apxbar__progress span {
	display: block;
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, var(--o), var(--g));
	transform: scaleX(0);
	transform-origin: left;
}

.apxbar__progress span.is-running {
	animation: apxbarProgress var(--apxbar-delay, 5s) linear both;
}

.apxbar.is-paused .apxbar__progress span {
	animation-play-state: paused;
}

@keyframes apxbarProgress { to { transform: scaleX(1); } }

.apxbar__msg {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
	color: var(--t) !important;
	text-decoration: none !important;
	font-weight: 600;
	white-space: nowrap;
}

a.apxbar__msg:hover .apxbar__full,
a.apxbar__msg:hover .apxbar__short {
	text-decoration: underline;
	text-decoration-color: var(--o);
	text-underline-offset: 3px;
}

.apxbar__msg b {
	font-weight: 700;
	color: #fff;
}

.apxbar__full,
.apxbar__short {
	overflow: hidden;
	text-overflow: ellipsis;
}

.apxbar__short {
	display: none;
}

.apxbar__icon {
	flex: none;
	display: grid;
	place-items: center;
	color: var(--o);
}

.apxbar__icon svg {
	width: 17px;
	height: 17px;
}

.apxbar-code {
	display: inline-block;
	padding: 3px 7px;
	color: var(--g);
	font-family: 'Orbitron', 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: 0.06em;
	border: 1px dashed rgba(255, 179, 71, 0.6);
}

.apxbar__copy {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 10px;
	background: var(--o);
	color: #fff;
	border: 0;
	font: inherit;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
	transition: background-color 0.15s ease;
}

.apxbar__copy:hover {
	background: #ff6a40;
}

.apxbar__copy.is-done {
	background: #22a35a;
}

.apxbar__copy svg {
	width: 14px;
	height: 14px;
}

.apxbar__nav {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: transparent;
	color: var(--m);
	border: 0;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.apxbar__nav:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.07);
}

.apxbar__nav svg {
	width: 16px;
	height: 16px;
}

.apxbar button:focus-visible,
.apxbar a:focus-visible {
	outline: 2px solid var(--g);
	outline-offset: 2px;
}

/* Mobile : une seule ligne, texte court, pas de flèches (glisser du doigt). */
@media (max-width: 700px) {
	.apxbar {
		height: 36px;
		font-size: 14px;
	}
	.apxbar__inner {
		grid-template-columns: 1fr;
		padding: 0 10px;
	}
	.apxbar__nav {
		display: none;
	}
	.apxbar__full {
		display: none;
	}
	.apxbar__short {
		display: inline;
	}
	.apxbar__item {
		gap: 8px;
	}
	.apxbar__copy {
		height: 24px;
		padding: 0 7px;
	}
	.apxbar__copy span {
		display: none;
	}
	.apxbar.is-preview::before {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	/* Changement en fondu simple, sans mouvement. */
	.apxbar__item[class*="in-"],
	.apxbar__item[class*="out-"] {
		animation-name: apxbarFade;
		animation-duration: 0.3s;
	}
	.apxbar__item[class*="out-"] {
		animation-direction: reverse;
	}
	.apxbar__item .apxbar__icon {
		animation: none !important;
	}
	@keyframes apxbarFade { from { opacity: 0; } to { opacity: 1; } }
}
