/**
 * Wallex Service Notifications Widget Stylesheet
 *
 * Designed according to Wallex Token Style design system.
 * Supports light mode and dark mode via CSS variable tokens.
 *
 * @package Wallex_Core
 * @since   2.0.3
 */

.wallex-service-notifications {
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: inherit;
	color: var(--color-text-1, #F7F7F7);
	direction: rtl;
	text-align: right;
}

.wallex-service-notifications *,
.wallex-service-notifications *::before,
.wallex-service-notifications *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   Header
   ========================================================================== */

.wallex-service-notifications__header {
	margin-bottom: var(--spacingMNudge, 20px);
}

.wallex-service-notifications__title {
	margin: 0;
	font-size: 16px;
	line-height: 28px;
	font-weight: 500;
	color: var(--color-text-1, #F7F7F7);
}

/* ==========================================================================
   Featured Announcement Card
   ========================================================================== */

.wallex-service-notifications__featured-section {
	margin-bottom: var(--spacingMNudge, 20px);
}

.wallex-service-notifications__featured-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacingM, 16px);
	background: var(--color-bg-2, #171D26);
	border: 1px solid var(--color-stroke-2, rgba(255, 255, 255, 0.08));
	border-radius: var(--cornerRadiusXL, 16px);
	padding: 12px;
	min-height: 88px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wallex-service-notifications__featured-card:hover {
	border-color: var(--color-primaryBrandStroke, #007AFF);
}

.wallex-service-notifications__featured-text {
	flex: 1;
	min-width: 0;
}

.wallex-service-notifications__featured-title {
	margin: 0 0 var(--spacingXXS, 8px);
	font-size: var(--body-size, 14px);
	line-height: 24px;
	font-weight: 500;
	color: var(--color-text-1, #F7F7F7);
}

.wallex-service-notifications__featured-desc {
	margin: 0;
	font-size: var(--caption-size, 12px);
	line-height: 20px;
	font-weight: 400;
	color: var(--color-text-2, rgba(255, 255, 255, 0.6));
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wallex-service-notifications__featured-media {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wallex-service-notifications__featured-badge {
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--cornerRadiusL, 12px);
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.wallex-service-notifications__featured-badge svg {
	width: 64px;
	height: 64px;
	display: block;
}

.wallex-service-notifications__featured-img {
	width: 64px;
	height: 64px;
	border-radius: var(--cornerRadiusL, 12px);
	object-fit: cover;
	display: block;
}

/* ==========================================================================
   Timeline / Grouped by Date
   ========================================================================== */

.wallex-service-notifications__timeline {
	display: flex;
	flex-direction: column;
	gap: var(--spacingL, 24px);
}

.wallex-service-notifications__date-group {
	position: relative;
	margin-bottom: 0;
	padding-bottom: 0;
}

.wallex-service-notifications__date-group:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.wallex-service-notifications__date-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--spacingXXS, 4px);
	font-size: var(--caption-size, 12px);
	line-height: 20px;
	font-weight: 500;
	color: var(--color-text-2, rgba(255, 255, 255, 0.6));
	margin-bottom: var(--spacingM, 16px);
}

.wallex-service-notifications__date-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	color: var(--color-text-2, rgba(255, 255, 255, 0.6));
	flex-shrink: 0;
}

.wallex-service-notifications__date-icon svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: var(--color-text-2);
}

.wallex-service-notifications__items {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.wallex-service-notifications__item {
	display: block;
	text-decoration: none;
	color: inherit;
	padding-bottom: var(--spacingS, 12px);
	margin-bottom: var(--spacingS, 12px);
	transition: background-color 0.15s ease;
}

.wallex-service-notifications__item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

a.wallex-service-notifications__item:hover .wallex-service-notifications__item-title {
	color: var(--color-primaryBrandText, #007AFF);
}

.wallex-service-notifications__item-title {
	margin: 0 0 var(--spacingXXS, 8px);
	font-size: var(--body-size, 14px);
	line-height: 24px;
	font-weight: 500;
	color: var(--color-text-1, #F7F7F7);
	transition: color 0.15s ease;
}

.wallex-service-notifications__item-desc {
	margin: 0;
	font-size: var(--caption-size, 12px);
	line-height: 20px;
	font-weight: 400;
	color: var(--color-text-2, rgba(255, 255, 255, 0.6));
	word-break: break-word;
}

/* ==========================================================================
   Infinite Scroll & Reveal Transitions
   ========================================================================== */

.wallex-service-notifications__date-group--hidden {
	display: none !important;
}

.wallex-service-notifications__date-group--revealing {
	animation: wallexFadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes wallexFadeInUp {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wallex-service-notifications__sentinel {
	width: 100%;
	min-height: 48px;
	margin-top: var(--spacingL, 20px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wallex-service-notifications__loading-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--spacingXXS, 10px);
	padding: var(--spacingM, 16px) var(--spacingL, 24px);
	width: 100%;
	max-width: 320px;
}

.wallex-service-notifications__loading-text {
	font-size: var(--caption-size, 13px);
	line-height: 1.5;
	font-weight: 500;
	color: var(--color-text-2, rgba(255, 255, 255, 0.6));
	text-align: center;
	user-select: none;
}

.wallex-service-notifications__loading-bar {
	width: 100%;
	height: 4px;
	background-color: var(--color-stroke-2, rgba(255, 255, 255, 0.08));
	border-radius: 99px;
	overflow: hidden;
	position: relative;
}

.wallex-service-notifications__loading-bar-fill {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, var(--color-primaryBrandText, #007AFF), #409CFF);
	border-radius: 99px;
	box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
	position: relative;
}

.wallex-service-notifications__loading-bar-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(90deg,
			transparent 0%,
			rgba(255, 255, 255, 0.4) 50%,
			transparent 100%);
	animation: wallexShimmer 1.5s infinite linear;
}

@keyframes wallexShimmer {
	0% {
		transform: translateX(-100%);
	}

	100% {
		transform: translateX(100%);
	}
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.wallex-service-notifications__empty {
	padding: var(--spacingXL, 32px);
	text-align: center;
	color: var(--color-text-3, rgba(255, 255, 255, 0.4));
	font-size: var(--body-size, 14px);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 480px) {
	.wallex-service-notifications__featured-card {
		padding: 16px 12px;
		gap: var(--spacingS, 12px);
		min-height: 96px;
	}

	.wallex-service-notifications__featured-title {
		font-size: 14px;
		line-height: 24px;
	}

	.wallex-service-notifications__featured-badge,
	.wallex-service-notifications__featured-img {
		width: 64px;
		height: 64px;
	}

	.wallex-service-notifications__featured-badge svg {
		width: 64px;
		height: 64px;
	}

	.wallex-service-notifications__item-title {
		font-size: 14px;
		line-height: 24px;
	}

	.wallex-service-notifications__item-desc {
		font-size: 12px;
		line-height: 20px;
	}
}