/* CLIK.ma - live posts, site wide (js/core/clik-live-feed.js, AdminCP → Réglages CLIK → « Publications en direct »):
   a new card grows in with a ring in the cube's colours, the « N nouvelles publications » pill, a count that changed. */

/* a card that just arrived (a post in a feed, a listing in the marketplace's grid): it grows in, a ring in the cube's
   colours runs round it and fades - transform / opacity only, nothing moves around it */
.clik-lf-new { position: relative; animation: clik-lf-in .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.clik-lf-new > .post, .clik-lf-new .fb-card-image { position: relative; }
.clik-lf-new > .post::after, .clik-lf-new .fb-card-image::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 2px #0A5CFF, 0 0 0 2px rgba(245, 16, 79, .55), 0 0 18px 2px rgba(255, 210, 0, .45);
  animation: clik-lf-ring 2.4s ease-out both;
}
.clik-lf-new.is-still, .clik-lf-new.is-still > .post::after, .clik-lf-new.is-still .fb-card-image::after { animation: none; }
.clik-lf-new.is-still > .post::after, .clik-lf-new.is-still .fb-card-image::after { opacity: 0; }
@keyframes clik-lf-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes clik-lf-ring { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: .9; } 100% { opacity: 0; } }

/* « 2 nouvelles publications »: 8 px under the header, over the feed's column; its authors' faces */
.clik-lf-pill {
  position: fixed; z-index: 1040; translate: -50% -14px; opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #0866FF, #0A5CFF 55%, #5B3CF5); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  box-shadow: 0 6px 18px rgba(8, 102, 255, .35), 0 0 0 2px rgba(255, 255, 255, .9); cursor: pointer; white-space: nowrap;
  transition: opacity .25s ease, translate .3s cubic-bezier(.2, .9, .3, 1.2), top .3s ease;
}
.clik-lf-pill.is-on { opacity: 1; translate: -50% 0; pointer-events: auto; }
.clik-lf-pill:hover { background: linear-gradient(135deg, #0A5CFF, #0647B8 60%, #4A2EE0); }
.clik-lf-pill:active { scale: .96; }
.clik-lf-pill:focus-visible { outline: 3px solid #93C5FD; outline-offset: 2px; }
.clik-lf-pill svg { flex: none; }
.clik-lf-pill b { font-weight: 700; }
.clik-lf-faces { display: inline-flex; }
.clik-lf-faces:empty { display: none; }
.clik-lf-faces i {
  width: 24px; height: 24px; border-radius: 50%; background: #e4e6eb center / cover no-repeat;
  box-shadow: 0 0 0 2px #fff; margin-inline-start: -8px;
}
.clik-lf-faces i:first-child { margin-inline-start: 0; }
body.night-mode .clik-lf-pill { box-shadow: 0 6px 18px rgba(0, 0, 0, .5), 0 0 0 2px rgba(36, 37, 38, .95); }
body.night-mode .clik-lf-faces i { box-shadow: 0 0 0 2px #242526; }
@media (max-width: 668px) {
  .clik-lf-pill { height: 36px; font-size: 13px; padding: 0 14px 0 10px; max-width: calc(100vw - 16px); }
}

/* a count that changed (comments, shares, the comment button's bubble) */
.clik-lf-bump { animation: clik-lf-bump .5s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes clik-lf-bump { 40% { transform: scale(1.18); } 100% { transform: none; } }

.clik-lf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .clik-lf-new, .clik-lf-new > .post::after, .clik-lf-new .fb-card-image::after, .clik-lf-bump { animation: none !important; }
  .clik-lf-new > .post::after, .clik-lf-new .fb-card-image::after { opacity: 0; }
  .clik-lf-pill { transition: opacity .2s; }
}

/* the connection-quality dot (`clik_down_dot`): amber on the header's avatar / person button while the site answers slowly */
.clik-hdr-user-droptoggle:has(> .clik-nq-dot) { position: relative; }
.clik-nq-dot {
  position: absolute; inset-block-end: -1px; inset-inline-end: -1px; z-index: 2; width: 12px; height: 12px; border-radius: 50%;
  background: #F59E0B; box-shadow: 0 0 0 2px #fff; pointer-events: auto;
  animation: clik-nq-pulse 1.6s ease-in-out infinite;
}
body.night-mode .clik-nq-dot { box-shadow: 0 0 0 2px #242526; }
@keyframes clik-nq-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .clik-nq-dot { animation: none; } }

/* a card in a list (Jobs, Offers, Le Mag) that just arrived: the same ring, round the card itself */
.clik-lf-new.is-card:not(.fb-col) { position: relative; }
.clik-lf-new.is-card:not(.fb-col)::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 12px;
  box-shadow: inset 0 0 0 2px #0A5CFF, 0 0 0 2px rgba(245, 16, 79, .55), 0 0 18px 2px rgba(255, 210, 0, .45);
  animation: clik-lf-ring 2.4s ease-out both;
}
.clik-lf-new.is-card.is-still::after { animation: none; opacity: 0; }

/* a post deleted / hidden meanwhile: it fades out of every page showing it, then leaves (transform / opacity only) */
.clik-lf-gone { pointer-events: none; animation: clik-lf-out .5s ease-in both; }
@keyframes clik-lf-out { to { opacity: 0; transform: scale(.94); } }

/* « Vendu » put on a listing by its seller meanwhile: stamped on, a turn and a bounce */
.clik-lf-stamp { animation: clik-lf-stamp .6s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes clik-lf-stamp { 0% { opacity: 0; transform: scale(1.8) rotate(-12deg); } 60% { opacity: 1; transform: scale(.92) rotate(2deg); } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .clik-lf-new.is-card::after, .clik-lf-gone, .clik-lf-stamp { animation: none !important; }
  .clik-lf-new.is-card::after { opacity: 0; }
}

/* round 3 (31 Oct) ---------------------------------------------------------------------------------------------------- */
/* the banners' counts that follow the cards arriving (Jobs, Offers): they bump */
.js_clik-lf-count { display: inline-block; }

/* « Nouveau » on what arrived live, for AdminCP's minutes: a small CLIK-blue chip after the post's time / on the card's
   price or title line, 8 px from its words */
.clik-lf-tag {
  display: inline-flex; align-items: center; flex: none; margin-inline-start: 8px; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(135deg, #0A5CFF, #7C3AED); color: #fff !important; font-size: 11px; font-weight: 800;
  line-height: 16px; letter-spacing: .2px; text-transform: none; vertical-align: middle; white-space: nowrap;
  animation: clik-lf-tagin .45s cubic-bezier(.2, .9, .3, 1.4) both;
}
.clik-lf-tag.is-card { font-size: 10.5px; line-height: 15px; }
.cd-ttl > .clik-lf-tag, .clik-mag-title > .clik-lf-tag { margin-inline: 0 8px; }
.clik-lf-tag.is-out { animation: clik-lf-tagout .4s ease-in both; }
@keyframes clik-lf-tagin { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: none; } }
@keyframes clik-lf-tagout { to { opacity: 0; transform: scale(.6); } }
.fb-card-price:has(> .clik-lf-tag, > .clik-lf-drop) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; white-space: normal; overflow: visible; }
.fb-card-price > .clik-lf-tag, .fb-card-price > .clik-lf-drop { margin-inline-start: 0; }

/* a price lowered meanwhile: « −12 % » in green beside the new price */
.clik-lf-drop {
  display: inline-flex; align-items: center; flex: none; margin-inline-start: 8px; padding: 2px 8px; border-radius: 999px;
  background: #16A34A; color: #fff !important; font-size: 11.5px; font-weight: 800; line-height: 16px; white-space: nowrap;
  unicode-bidi: isolate; vertical-align: middle;
}
.clik-pill-row .clik-lf-drop.is-pill { margin-inline-start: 0; padding: var(--pp, .45em .7em); background: #16A34A !important; color: #fff !important; border-color: #16A34A !important; line-height: 1; }
.clik-pill-row .clik-lf-drop.is-pill::before { display: none; }
body.night-mode .clik-lf-drop { background: #15803D; }

/* an open chat's listing, sold meanwhile: the line under its card */
.clik-lf-soldline {
  display: flex; align-items: center; gap: 8px; flex: none; margin: 0; padding: 8px; background: #FEF2F2; color: #B91C1C;
  font-size: 13px; font-weight: 700; line-height: 1.3; border-bottom: 1px solid rgba(220, 38, 38, .2);
  animation: clik-lf-soldin .45s ease-out both;
}
.clik-lf-soldline svg { flex: none; }
.clik-bx-lst + .clik-lf-soldline { margin: 0 8px 8px; border-radius: 10px; border: 0; }
body.night-mode .clik-lf-soldline { background: rgba(220, 38, 38, .16); color: #FCA5A5; border-color: rgba(220, 38, 38, .3); }
@keyframes clik-lf-soldin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .clik-lf-tag, .clik-lf-tag.is-out, .clik-lf-soldline { animation: none !important; }
}
.clik-lf-tag.is-still, .clik-lf-soldline.is-still { animation: none; }

/* round 70: the sponsored cards at the top of the home feed take their turn at each live check - the old ones fade, the
   new ones rise in their place (transform / opacity only; nothing with "less motion" - the script swaps them at once) */
.clik-feed-grid li.clik-feed-sponsored { transition: opacity .26s ease; }
.clik-feed-grid li.clik-feed-sponsored.clik-sp-out { opacity: 0; }
.clik-feed-grid li.clik-feed-sponsored.clik-sp-in > .post { animation: clik-sp-in .5s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes clik-sp-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .clik-feed-grid li.clik-feed-sponsored { transition: none; }
  .clik-feed-grid li.clik-feed-sponsored.clik-sp-in > .post { animation: none; }
}
