/* ==========================================================================
   SocialAnime Translations — motion & accent layer.
   The latest socialanime.it details (community-card-accent gradients,
   ripple ink, animate.css fadeIn, modal scale-in, ripplelink hover lift),
   reworked: staggered entrances, a rotating accent palette, softer depth.
   ========================================================================== */

:root {
  --ac-magenta: 236, 72, 153;
  --ac-violet: 139, 92, 246;
  --ac-orange: 249, 115, 22;
  --ac-aqua: 6, 182, 212;
  --ac-lime: 132, 204, 22;
  --ac-emerald: 16, 185, 129;
  --lift: 0 3px 6px rgba(0, 0, 0, .16), 0 3px 6px rgba(0, 0, 0, .23);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---- accent cards (socialanime.it "community-card-accent", one hue per card) */
:where(.sa-accent, .translation-item, .recent-translation-item, .lp-latest-i:not(.is-sk), #translations-list .card, #comments-list .card,
#users-list .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div, .community-item, .activity-item) {
  --ac: var(--ac-aqua);
  position: relative; isolation: isolate;
}
.sa-accent::before, .translation-item::before, .recent-translation-item::before, .lp-latest-i:not(.is-sk)::before, #translations-list .card::before,
#comments-list .card::before, #users-list .card::before, .metric-card::before, .translation-card::before, .contributor-card::before,
.keyword-box::before, .post::before, .lp-feat > div::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(var(--ac), .2), rgba(var(--ac), .02) 60%, transparent);
  transition: opacity .3s;
}
:root[data-theme="dark"] .translation-item::before, :root[data-theme="dark"] .metric-card::before, :root[data-theme="dark"] .translation-card::before,
:root[data-theme="dark"] .post::before, :root[data-theme="dark"] .card::before, :root[data-theme="dark"] .lp-feat > div::before { opacity: .8; }
.recent-translation-item::before, .community-item::before, .keyword-box::before { background: linear-gradient(90deg, rgba(var(--ac), .14), transparent 55%); }
/* the hue rotates through the six socialanime.it accents */
:is(.translation-item, .recent-translation-item, .lp-latest-i, .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div):nth-child(6n+1) { --ac: var(--ac-aqua); }
:is(.translation-item, .recent-translation-item, .lp-latest-i, .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div):nth-child(6n+2) { --ac: var(--ac-magenta); }
:is(.translation-item, .recent-translation-item, .lp-latest-i, .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div):nth-child(6n+3) { --ac: var(--ac-orange); }
:is(.translation-item, .recent-translation-item, .lp-latest-i, .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div):nth-child(6n+4) { --ac: var(--ac-violet); }
:is(.translation-item, .recent-translation-item, .lp-latest-i, .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div):nth-child(6n+5) { --ac: var(--ac-emerald); }
:is(.translation-item, .recent-translation-item, .lp-latest-i, .card, .metric-card, .translation-card, .contributor-card, .keyword-box, .post, .lp-feat > div):nth-child(6n) { --ac: var(--ac-lime); }
/* a thin top light in the card colour */
.translation-item, .metric-card, .translation-card, #translations-list .card, #users-list .card { background-image: linear-gradient(90deg, rgba(var(--ac), .9), rgba(var(--ac), 0) 70%); background-size: 100% 3px; background-repeat: no-repeat; }
.translation-item .translation-language, .translation-card .translation-language { color: rgb(var(--ac)); background: rgba(var(--ac), .12); }
:root:not([data-theme="dark"]) .translation-item .translation-language, :root:not([data-theme="dark"]) .translation-card .translation-language { filter: saturate(1.2) brightness(.8); }
.metric-card .metric-icon { color: rgb(var(--ac)); background: rgba(var(--ac), .14); }

/* ---- hover: depth only, never moves the element (moving it made cards jitter under the pointer) */
.translation-box .card, .translation-item, .card, .post, .lp-lang, .lp-latest-i, .keyword-box, .translation-card, .quick-action-btn, .lp-feat > div, .metric-card, .related-keyword, .contributor-card {
  transition: box-shadow .25s var(--ease-out), background-color .25s;
}
@media (hover: hover) {
  .translation-box:hover .card, .card:hover, .post:hover, .keyword-box:hover, .translation-card:hover, .quick-action-btn:hover, .lp-feat > div:hover, .metric-card:hover, .related-keyword:hover, .contributor-card:hover, .translation-item:hover { transform: none; box-shadow: var(--lift); }
}
.sx-btn:active, .hb-chip:active, .action-icon:active, .button-send:active, .sa-chip:active { transform: scale(.97); }

/* ---- ripple ink (socialanime.it .ink/.animate, made smoother) ------------- */
.sa-ink-host { position: relative; overflow: hidden; }
.sa-ink { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); background: currentColor; opacity: .18; animation: sa-ink .6s var(--ease-out) forwards; }
.sx-btn.is-acc .sa-ink, .btn-primary .sa-ink, .button-send .sa-ink, .comment-submit-button .sa-ink, .sa-tabbar .sa-ink { background: #fff; opacity: .35; }
@keyframes sa-ink { to { transform: scale(2.6); opacity: 0; } }

/* ---- entrances: a plain fade (no rise), only on lists that render once per navigation.
   Lists the scripts redraw often (translations after a like, latest translations, notifications,
   search results, cards filtered while typing) never animate, so their text never jumps. */
@media (prefers-reduced-motion: no-preference) {
  .translation-box, .metric-card, .keyword-box, .translation-card, .contributor-card, .related-keyword, .gallery-item, .activity-box, .lp-latest-i { animation: sa-fade .35s ease-out both; }
  .search-modal-content, #languagePopup .popup-content, .settings-content, .modal-content, #user-management-panel, .popup .popup-content,
  .dropdown-menu.show, .custom-filters-menu.show, .language-popup-content.show, div.swal2-popup.swal2-show { animation: sa-pop .22s var(--ease-out) both; }
  .notification-popup.open, .activity-container { animation: sa-slide .3s var(--ease-out) both; }
}
@keyframes sa-fade { from { opacity: 0; } }
@keyframes sa-in { from { opacity: 0; } }
@keyframes sa-pop { from { opacity: 0; transform: scale(.97); } }
@keyframes sa-slide { from { opacity: 0; transform: translateX(20px); } }

/* ---- skeletons while the hub loads ---------------------------------------- */
#contentContainer:empty { min-height: 260px; border-radius: var(--rad); background:
  linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent) -200% 0 / 50% 100% no-repeat,
  linear-gradient(var(--s1), var(--s1)) 0 0 / 100% 56px no-repeat,
  linear-gradient(var(--s1), var(--s1)) 0 68px / 100% 56px no-repeat,
  linear-gradient(var(--s1), var(--s1)) 0 136px / 100% 56px no-repeat,
  linear-gradient(var(--s1), var(--s1)) 0 204px / 100% 56px no-repeat;
  animation: sa-shimmer 1.3s linear infinite; }
#recentTranslationsList:empty { min-height: 240px; background: linear-gradient(90deg, transparent, var(--s2), transparent) -200% 0 / 50% 100% no-repeat; animation: sa-shimmer 1.3s linear infinite; }
:root[data-theme="dark"] #contentContainer:empty { background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent), linear-gradient(var(--s1), var(--s1)), linear-gradient(var(--s1), var(--s1)), linear-gradient(var(--s1), var(--s1)), linear-gradient(var(--s1), var(--s1)); }
@keyframes sa-shimmer { to { background-position: 300% 0, 0 0, 0 68px, 0 136px, 0 204px; } }

/* ---- chips row (socialanime.it mobile "Popolari / Streaming / Opening") ------ */
.sa-chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.sa-chips::-webkit-scrollbar { display: none; }
.sa-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px; background: var(--s1); color: var(--ink-2); font-size: 13.5px; font-weight: 600; box-shadow: var(--card-sh); transition: color .2s, background .2s, transform .15s; }
.sa-chip:hover { color: var(--ink); }
.sa-chip.is-on { background: var(--acc); color: #fff; }
.sa-chip i { font-size: 12px; opacity: .8; }

/* ---- smooth theme switch ----------------------------------------------- */
html.sa-theming, html.sa-theming * { transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease !important; }

/* ---- "Novità"-style new badge + gradient underline on section titles ------ */
.hb-head h1, .pn-h h2, .lp-title { position: relative; }
.lp-title::after { content: ''; display: block; width: 56px; height: 3px; margin: 10px auto 0; border-radius: 3px; background: linear-gradient(90deg, #3591cc, #f0a04b); }

@media (prefers-reduced-motion: reduce) {
  .sa-ink { display: none; }
  #contentContainer:empty, #recentTranslationsList:empty { animation: none; }
}
