/* ALMODEER news ticker — fixed bottom bar, white/green identity, Apple-like depth.
   Arabic (RTL) text travels left -> right, English (LTR) right -> left.
   No inline styles (strict CSP); JS only sets the duration through CSSOM. */

:root { --tk-h: 44px; --tk-safe: env(safe-area-inset-bottom, 0px); }

body.has-ticker { padding-bottom: calc(var(--tk-h) + var(--tk-safe)); }
body.has-ticker #fahim-root:not(.fh-placed) #fahim-btn { bottom: calc(18px + var(--tk-h) + var(--tk-safe)); }
body.has-ticker #fahim-panel { bottom: calc(88px + var(--tk-h) + var(--tk-safe)); height: min(540px, calc(100vh - 110px - var(--tk-h))); }
body.has-ticker .lm-fahim-button { bottom: calc(18px + var(--tk-h) + var(--tk-safe)); }
body.has-ticker .lm-fahim-panel { bottom: calc(86px + var(--tk-h) + var(--tk-safe)); }

.news-ticker {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 1050;
  height: calc(var(--tk-h) + var(--tk-safe)); padding-bottom: var(--tk-safe);
  display: flex; align-items: stretch; overflow: hidden;
  font-family: "Cairo", "Inter", "Segoe UI", Tahoma, Arial, sans-serif;
  /* white and green woven together: soft diagonal ribbons over a glassy white */
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.70) 55%, rgba(232,249,243,.88)),
    repeating-linear-gradient(115deg, rgba(0,200,150,.13) 0 22px, rgba(255,255,255,0) 22px 58px),
    linear-gradient(90deg, #E8F9F3, #FFFFFF 30%, #DDF7EE 60%, #FFFFFF 85%, #E8F9F3);
  background-size: 100% 100%, 240px 100%, 200% 100%;
  animation: tk-sheen 18s linear infinite;
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid rgba(0,135,95,.22);
  box-shadow: 0 -1px 0 rgba(255,255,255,.9) inset, 0 -10px 30px rgba(11,31,51,.10), 0 -2px 6px rgba(0,135,95,.10);
}
.news-ticker::before { /* thin brand line on top, like a glass edge */
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #00C896 20%, #00875F 50%, #00C896 80%, transparent);
  opacity: .75;
}
@keyframes tk-sheen { to { background-position: 0 0, 240px 0, -200% 0; } }

/* label chip — the 3D green pill at the start side */
.news-ticker .tk-label {
  position: relative; z-index: 2; flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  margin: 6px; margin-inline-end: 0; padding: 0 14px; border-radius: 12px;
  color: #fff; font-weight: 800; font-size: .86rem; letter-spacing: .2px; white-space: nowrap;
  background: linear-gradient(180deg, #2EE0B0 0%, #00C896 45%, #00875F 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 4px 10px rgba(0,135,95,.35);
  text-shadow: 0 1px 1px rgba(0,60,40,.45);
}
.news-ticker .tk-label img { width: 20px; height: 20px; border-radius: 6px; background: #fff; padding: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.news-ticker .tk-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.8);
  animation: tk-pulse 1.8s ease-out infinite; }
@keyframes tk-pulse { 70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

/* the moving lane, with soft fade at both edges */
.news-ticker .tk-viewport {
  position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.news-ticker .tk-track { display: flex; flex: 0 0 auto; align-items: center; white-space: nowrap; will-change: transform;
  animation: tk-move-ltr var(--tk-dur, 40s) linear infinite; }
[dir="rtl"] .news-ticker .tk-track { animation-name: tk-move-rtl; }
.news-ticker .tk-group { display: flex; flex: 0 0 auto; align-items: center; }
@keyframes tk-move-ltr { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }   /* right -> left */
@keyframes tk-move-rtl { from { transform: translate3d(0,0,0); } to { transform: translate3d(50%,0,0); } }    /* left -> right */

.news-ticker .tk-item {
  display: inline-flex; align-items: center; gap: 10px; padding-inline: 22px;
  font-size: 1rem; font-weight: 700; line-height: 1; color: #0B3B2E; text-decoration: none;
  /* Apple-like embossed 3D lettering: highlight above, layered depth below */
  text-shadow: 0 1px 0 #fff, 0 1px 1px rgba(0,135,95,.35), 0 2px 2px rgba(0,107,76,.22), 0 4px 8px rgba(11,31,51,.14);
}
.news-ticker a.tk-item:hover, .news-ticker a.tk-item:focus-visible { color: #00875F; text-decoration: none; }
.news-ticker .tk-sep { width: 8px; height: 8px; flex: 0 0 8px; transform: rotate(45deg); border-radius: 2px;
  background: linear-gradient(135deg, #2EE0B0, #00875F); box-shadow: 0 1px 2px rgba(0,107,76,.4); }

/* pause on hover / keyboard focus / pause button */
.news-ticker:hover .tk-track, .news-ticker:focus-within .tk-track, .news-ticker.is-paused .tk-track { animation-play-state: paused; }

.news-ticker .tk-toggle {
  position: relative; z-index: 2; flex: 0 0 auto; align-self: center; width: 30px; height: 30px; margin-inline: 6px;
  display: grid; place-items: center; border: 1px solid rgba(0,135,95,.25); border-radius: 50%; cursor: pointer;
  color: #00875F; background: linear-gradient(180deg, #fff, #E8F9F3); box-shadow: 0 2px 6px rgba(0,135,95,.18); font-size: .72rem;
}
.news-ticker .tk-toggle:focus-visible { outline: 3px solid #ffd43b; outline-offset: 2px; }
.news-ticker .tk-toggle .tk-play { display: none; }
.news-ticker.is-paused .tk-toggle .tk-play { display: inline; }
.news-ticker.is-paused .tk-toggle .tk-pause { display: none; }

@media (max-width: 640px) {
  :root { --tk-h: 40px; }
  .news-ticker .tk-label { padding: 0 10px; font-size: .78rem; }
  .news-ticker .tk-label .tk-text { display: none; }
  .news-ticker .tk-item { font-size: .92rem; padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .news-ticker, .news-ticker .tk-dot { animation: none; }
  .news-ticker .tk-track { animation-duration: calc(var(--tk-dur, 40s) * 2.5); }
}
@media print { .news-ticker { display: none; } body.has-ticker { padding-bottom: 0; } }

/* item badges and icons */
.news-ticker .tk-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; color: #fff; text-shadow: none; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 2px 5px rgba(0,0,0,.15); }
.news-ticker .tk-badge-new { background: linear-gradient(180deg, #2EE0B0, #00875F); }
.news-ticker .tk-badge-offer { background: linear-gradient(180deg, #FFB547, #E07B00); }
.news-ticker .tk-badge-alert { background: linear-gradient(180deg, #FF6B5E, #C0352B); }
.news-ticker .tk-badge-update { background: linear-gradient(180deg, #4BA3F5, #1B6FC2); }
.news-ticker .tk-item > i { color: #00A47A; font-size: .95em; }

/* separator between items: stars + weekday, date and time */
.news-ticker .tk-when { display: inline-flex; align-items: center; gap: 8px; padding-inline: 18px; white-space: nowrap;
  font-size: .78rem; font-weight: 700; color: #00875F; }
.news-ticker .tk-clock { padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,135,95,.18); box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(0,135,95,.12); }
.news-ticker .tk-star { color: #00C896; font-size: .9rem; text-shadow: 0 1px 2px rgba(0,107,76,.35); }
.news-ticker .tk-article { font-weight: 600; font-size: .95rem; }
@media (max-width: 640px) { .news-ticker .tk-when { font-size: .7rem; padding-inline: 12px; } }
