/* ==========================================================================
   Eid Al Etihad (UAE National Day) -- top announcement strip
   Loaded from header.blade.php only while get_eid_strip_details() is live
   (UAE store, dates in app/helpers.php). Outside that window none of this
   loads and the strip is exactly as before.

   The WHOLE strip rolls like a box between two sides:
     side 1 -- the original strip: admin colour, orange slant, the
               "UAE E-Invoicing" message with its original shimmer
     side 2 -- Eid Al Etihad: green, green slant, flag-colour line, the wish
   Two boxes turn in step, on the same keyframes and timing:
     .ann-bg-cube  full-width colours, behind everything (decorative)
     .ann-cube     the message, inside the clickable #newAnnouncementClick
   Each has four faces (side 1 / side 2 / side 1 / side 2) so the roll always
   goes the same way; a quarter turn every 4s (hold 3.4s, roll 0.6s).
   Both pause together on hover or keyboard focus. Reduced motion: the two
   sides crossfade instead of rolling.
   ========================================================================== */

.ads_popup.eid-etihad {
	--cube-h: 30px;
	--roll: annRoll 16s cubic-bezier(.65, 0, .35, 1) infinite;
	perspective: 1400px;
	overflow: hidden;
}
/* the static orange slant is replaced by the one on side 1 of the box */
.main-header .ads_popup.eid-etihad::after { display: none; }
/* content (message + email/phone) sits above the rolling colours */
.ads_popup.eid-etihad > div { position: relative; z-index: 1; }
/* the message box is absolutely positioned, so its column has no content
   width of its own; split the strip evenly (as the original effectively does,
   ~505px / 503px at 1024px) so the message sits in the same place */
.ads_popup.eid-etihad > div { flex: 1 1 0; min-width: 0; }

/* ---------- shared box mechanics ---------- */
.ann-bg-cube,
.ads_popup #newAnnouncementClick.is-cube > .ann-cube {
	position: absolute; inset: 0; display: block; margin: 0; width: auto;
	transform-style: preserve-3d;
	transform: translateZ(calc(var(--cube-h) * -0.5)) rotateX(0deg);
	animation: var(--roll);
	pointer-events: none;
}
.ann-bg-cube { z-index: 0; }
.ann-bg-face, .ann-face {
	position: absolute; inset: 0;
	-webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.ann-bg-face-1, .ann-face-1 { transform: rotateX(0deg)    translateZ(calc(var(--cube-h) * 0.5)); }
.ann-bg-face-2, .ann-face-2 { transform: rotateX(-90deg)  translateZ(calc(var(--cube-h) * 0.5)); }
.ann-bg-face-3, .ann-face-3 { transform: rotateX(-180deg) translateZ(calc(var(--cube-h) * 0.5)); }
.ann-bg-face-4, .ann-face-4 { transform: rotateX(-270deg) translateZ(calc(var(--cube-h) * 0.5)); }

@keyframes annRoll {
	0%,   21.25% { transform: translateZ(calc(var(--cube-h) * -0.5)) rotateX(0deg); }
	25%,  46.25% { transform: translateZ(calc(var(--cube-h) * -0.5)) rotateX(90deg); }
	50%,  71.25% { transform: translateZ(calc(var(--cube-h) * -0.5)) rotateX(180deg); }
	75%,  96.25% { transform: translateZ(calc(var(--cube-h) * -0.5)) rotateX(270deg); }
	100%         { transform: translateZ(calc(var(--cube-h) * -0.5)) rotateX(360deg); }
}
/* pause both boxes together. The message box's own rule is ID-based
   (#newAnnouncementClick.is-cube > .ann-cube) and its animation shorthand
   resets play-state, so its pause rule must carry the same ID or it loses
   and the two boxes drift apart. */
.ads_popup.eid-etihad:hover .ann-bg-cube,
.ads_popup.eid-etihad:hover #newAnnouncementClick.is-cube > .ann-cube,
.ads_popup.eid-etihad:has(#newAnnouncementClick:focus-visible) .ann-bg-cube,
.ads_popup.eid-etihad:has(#newAnnouncementClick:focus-visible) #newAnnouncementClick.is-cube > .ann-cube { animation-play-state: paused; }

/* ---------- background faces ---------- */
/* side 1: the original strip -- the admin colour (main.js puts it inline on
   #adsPopups) inherited down, plus the orange slant at its original size */
.ann-bg-cube { background: inherit; }
.ann-bg-face.is-orig { background: inherit; }
.ann-bg-shape {
	position: absolute; top: 0; height: 100%; width: 100%; left: -27rem;
	clip-path: polygon(1.7rem 0, 100% 0, calc(100% - 1.7rem) 100%, 0 100%);
}
.ann-bg-face.is-orig .ann-bg-shape { background: #f16e25; }
/* side 2: Eid green, a lighter green slant, flag-colour line along the bottom */
.ann-bg-face.is-eid { background: #04462a; }
.ann-bg-face.is-eid .ann-bg-shape { background: linear-gradient(90deg, #04462a 0%, #077a44 38%, #0a9a55 62%, #087d45 100%); }
.ann-bg-face.is-eid::after {
	content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
	background: linear-gradient(90deg, #e11e32 0 10%, #0bb060 10% 40%, #ffffff 40% 70%, #111111 70% 100%);
}

/* ---------- the clickable message ---------- */
/* undo the strip's shimmer-on-the-whole-bar trick (transparent text with a
   clipped gradient), which cannot paint through 3D faces -- the shimmer is
   put back on side 1's text itself, below */
.ads_popup #newAnnouncementClick.is-cube {
	display: block; position: relative; height: 100%; width: 100%;
	color: #fff; background: none; -webkit-background-clip: border-box; background-clip: border-box;
	animation: none; -webkit-animation: none;
	perspective: 1400px; overflow: hidden; padding: 0;
	font-size: .95rem; font-weight: 500; word-spacing: normal;
}
/* keep the old ">span" / ">span:last-child" rules (line clamp, margin-top)
   off the box */
.ads_popup #newAnnouncementClick.is-cube > .ann-cube {
	overflow: visible; line-height: normal; -webkit-line-clamp: unset;
}
/* only the e-invoicing side is clickable: plain cursor while the wish side
   shows (class toggled by the strip's script in header.blade.php) */
.ads_popup #newAnnouncementClick.is-cube.is-wish { cursor: default; }
.ann-face {
	display: flex; align-items: center; justify-content: center; gap: .5rem;
	padding: 0 .75rem; white-space: nowrap; color: #fff;
}
.ann-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ann-arrow { font-size: 1.5rem; line-height: 1; animation: moveLefttoRight 1.5s linear infinite; }

/* side 1: the original look, matching main.css #newAnnouncementClick and
   ".ads_popup a span:last-child .fi-rs-arrow-small-right" on the live site --
   1.1rem text with 5px word spacing, ONE white / blue shimmer sweeping across
   the whole strip (text and arrow share it), 1.85rem arrow in a 50px slot
   nudged by padding (moveLefttoRight). */
.ann-face-1, .ann-face-3 {
	gap: 0; font-size: 1.1rem; font-weight: 500; word-spacing: 5px;
	color: transparent;
	background-image: linear-gradient(90deg, #ffffff 0%, #223451 35%, #fefefe 70%);
	background-size: 200% 100%;
	-webkit-background-clip: text; background-clip: text;
	animation: textHighlight 2.5s linear infinite;
}
.ann-face-1 .ann-text, .ann-face-3 .ann-text { color: transparent; }
.ann-face-1 .ann-arrow, .ann-face-3 .ann-arrow {
	flex: 0 0 50px; width: 50px; font-size: 1.85rem; line-height: 0;
	padding-left: 0; color: transparent;
	animation: moveLefttoRight 1.5s linear infinite;
}

/* side 2 text: the wish, white on green */
.ann-wish { text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.ann-wish b { font-weight: 700; letter-spacing: .03em; }
.ann-wish .ann-sub { font-weight: 400; opacity: .9; }
.ann-flag {
	flex: 0 0 auto; width: 18px; height: 12px; border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
	background:
		linear-gradient(90deg, #e11e32 0 28%, transparent 28%),
		linear-gradient(180deg, #0bb060 0 33.3%, #ffffff 33.3% 66.6%, #111111 66.6% 100%);
}
.ann-spark { flex: 0 0 auto; font-size: .7rem; color: #fff; animation: annTwinkle 2.2s ease-in-out infinite; }
.ann-spark-2 { animation-delay: -1.1s; }
@keyframes annTwinkle {
	0%, 100% { opacity: .25; transform: scale(.7); }
	50%      { opacity: 1;   transform: scale(1.1); }
}

/* ---------- responsive (slant positions follow the original ::after) ---------- */
@media screen and (max-width: 1280px) {
	.ads_popup #newAnnouncementClick.is-cube { font-size: .85rem; }
}
@media (max-width: 1199.98px) {
	.ann-bg-shape { left: -21rem; }
}
@media screen and (max-width: 992px) {
	.ads_popup.eid-etihad { --cube-h: 35px; }
	/* the original hides its slant here -- side 1 is the plain admin colour,
	   side 2 is plain green */
	.ann-bg-shape { display: none; }
	.ann-bg-face.is-eid { background: linear-gradient(90deg, #04462a, #0a9a55 50%, #04462a); }
	.ann-wish .ann-sub { display: none; }
}
@media screen and (max-width: 767px) {
	.ads_popup #newAnnouncementClick.is-cube { font-size: .78rem; }
	.ann-face { gap: .4rem; padding: 0 .5rem; }
	.ann-arrow { font-size: 1.25rem; }
}

/* ---------- reduced motion: crossfade the two sides, no rolling ---------- */
@media (prefers-reduced-motion: reduce) {
	.ann-bg-cube,
	.ads_popup #newAnnouncementClick.is-cube > .ann-cube { animation: none; transform: none; }
	.ann-bg-face, .ann-face { transform: none; }
	.ann-bg-face-3, .ann-bg-face-4, .ann-face-3, .ann-face-4 { display: none; }
	.ann-bg-face-1, .ann-face-1 { animation: annFadeA 10s ease-in-out infinite; }
	.ann-bg-face-2, .ann-face-2 { animation: annFadeB 10s ease-in-out infinite; }
	.ann-arrow, .ann-spark,
	.ann-face-1 .ann-text, .ann-face-3 .ann-text { animation: none; }
}
@keyframes annFadeA { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
@keyframes annFadeB { 0%, 45% { opacity: 0; } 50%, 95% { opacity: 1; } 100% { opacity: 0; } }
