/*
 * Centre de notifications (app/features/notifications.js) : cloche de la barre du haut et
 * liste dans la modal #modal-notifications.
 */

/* Cloche */

nav .notification-pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	cursor: pointer;
	font: inherit;
	font-family: var(--FontFocus);
}

nav .notification-pill:not(.has-unread) {
	opacity: 0.55;
}

nav .notification-pill.has-unread i {
	animation: notification-ring 2.4s ease-in-out infinite;
	transform-origin: 50% 0;
}

.notification-count {
	position: absolute;
	top: -0.35rem;
	right: -0.35rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.3rem;
	border-radius: 99px;
	box-sizing: border-box;
	background: var(--ColorPrimary);
	color: var(--ColorPrimaryText, #1b1b1b);
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
}

/* Nouvelle notification (app/layout.js) : la cloche sonne fort et un halo s'en échappe */
nav .notification-pill.notified i {
	animation: notification-alert 1.2s ease-in-out 2;
}

nav .notification-pill.notified::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: 0 0 0 0 var(--ColorPrimary);
	pointer-events: none;
	animation: notification-halo 1.2s ease-out 2;
}

nav .notification-pill.notified .notification-count {
	animation: notification-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes notification-alert {
	0%, 100% {
		transform: rotate(0) scale(1);
	}

	10% {
		transform: rotate(-24deg) scale(1.25);
	}

	25% {
		transform: rotate(22deg) scale(1.25);
	}

	40% {
		transform: rotate(-18deg) scale(1.2);
	}

	55% {
		transform: rotate(12deg) scale(1.1);
	}

	70% {
		transform: rotate(-6deg) scale(1.05);
	}
}

@keyframes notification-halo {
	from {
		box-shadow: 0 0 0 0 var(--ColorPrimary);
	}

	to {
		box-shadow: 0 0 0 0.9rem transparent;
	}
}

@keyframes notification-pop {
	from {
		transform: scale(0.3);
	}

	to {
		transform: scale(1);
	}
}

@keyframes notification-ring {
	0%, 80%, 100% {
		transform: rotate(0);
	}

	84% {
		transform: rotate(16deg);
	}

	88% {
		transform: rotate(-14deg);
	}

	92% {
		transform: rotate(8deg);
	}

	96% {
		transform: rotate(-4deg);
	}
}

/* « Tout effacer » à côté du titre : bouton sans fond, rouge au second clic (confirmation) */

.notifications-clear-slot {
	display: flex;
	width: auto;
	font-size: inherit;
}

.notifications-clear {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.5rem;
	border: none;
	border-radius: var(--BorderRadius, 1rem);
	background: none;
	color: var(--ColorTextAlt);
	font: inherit;
	font-family: var(--FontFocus);
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: var(--Transition);
}

.notifications-clear:hover,
.notifications-clear.confirm {
	color: var(--ColorRed);
}

/* Liste */

#modal-notifications .modal-content .content {
	justify-content: flex-start;
}

.notifications-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.notification-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	padding: 0.75rem 1.5rem 0.75rem 0.75rem;
	border: none;
	border-radius: var(--BorderRadius, 1rem);
	background: var(--ColorRow);
	color: var(--ColorText);
	font: inherit;
	text-align: left;
	cursor: pointer;
	box-shadow: var(--Shadow);
}

.notification-item.static {
	cursor: default;
}

/* Non lue : icône et point à droite à la couleur principale */
.notification-item.unread::after {
	content: "";
	flex-shrink: 0;
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	background: var(--ColorPrimary);
}

.notification-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--ColorContainer);
}

.notification-item.unread .notification-icon {
	background: var(--ColorPrimary);
	color: var(--ColorPrimaryText, #1b1b1b);
}

.notification-text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex: 1;
	min-width: 0;
}

.notification-text small {
	width: auto;
	font-size: 0.75rem;
	opacity: 0.6;
}

/* Élément lié, à droite du texte (app/features/notifications.js : aside) */
.notification-aside {
	flex-shrink: 0;
	width: auto;
}

/* Boosters reçus : comme le ×N des paliers (css/rewards.css .progress-quest-qty) */
.notification-qty {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 18px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.notification-qty i {
	color: var(--ColorPrimary);
}

/* Carte offerte : miniature (la carte prend la largeur de son conteneur) */
.notification-card {
	display: block;
	width: 44px;
	pointer-events: none;
}

.notification-emoji {
	font-size: 28px;
	line-height: 1;
}

img.notification-avatar,
video.notification-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.notifications-empty,
.notifications-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 2rem 1rem;
	text-align: center;
}

.notifications-empty i {
	font-size: 2rem;
	opacity: 0.5;
}

.notifications-empty p {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	nav .notification-pill.has-unread i,
	nav .notification-pill.notified i,
	nav .notification-pill.notified::after,
	nav .notification-pill.notified .notification-count {
		animation: none;
	}
}

/* Compte : bloc « Notifications » push (app/pages/account.js, app/features/push.js) */

.push-block {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
	text-align: left;
}

.push-row {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.push-text {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	flex: 1;
	min-width: 0;
}

.push-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 1.05rem;
}

.push-text p {
	margin: 0;
}

/* Interrupteur de css/main.css, en plus grand pour le doigt */
.push-switch {
	flex-shrink: 0;
	width: auto;
}

.push-switch span {
	width: 3.25rem !important;
	height: 1.9rem;
}

.push-switch span::before {
	top: 0.2rem;
	left: 0.2rem;
	width: 1.5rem;
	height: 1.5rem;
}

.push-switch input:checked + span::before {
	left: calc(100% - 1.7rem);
}
