/* Tosconime motion polish — respeita .reduce-motion e prefers-reduced-motion */

.anime-card img,
.continue-card img,
.trending-card img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.anime-card img.is-img-loaded,
.continue-card img.is-img-loaded,
.trending-card img.is-img-loaded {
  opacity: 1;
}

.anime-card {
  transition:
    transform 0.22s var(--ease-out, ease),
    box-shadow 0.22s var(--ease-out, ease),
    border-color 0.22s ease;
}

.anime-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px -12px rgba(34, 197, 94, 0.28);
}

.btn-favorite.is-pulse,
.btn-watch-later.is-pulse {
  animation: actionBtnPulse 0.42s var(--ease-out, ease);
}

@keyframes actionBtnPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.online-modal.is-open .online-sheet,
.support-modal.is-open .support-sheet {
  animation: sheetSpringIn 0.38s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

@keyframes sheetSpringIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.app-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  height: 2px;
  pointer-events: none;
  background: rgba(34, 197, 94, 0.12);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.app-loading-bar.is-active {
  opacity: 1;
}

.app-loading-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #16a34a, #4ade80, #16a34a);
  animation: appLoadingSweep 1.1s ease-in-out infinite;
}

@keyframes appLoadingSweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1999;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fef3c7;
  background: linear-gradient(180deg, rgba(120, 40, 10, 0.95), rgba(80, 28, 8, 0.92));
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  transform: translateY(-100%);
  transition: transform 0.32s var(--ease-out, ease);
}

.offline-banner.is-visible {
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 1100;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 999px;
  background: rgba(8, 14, 11, 0.92);
  color: #86efac;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s,
    background 0.2s ease,
    border-color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(134, 239, 172, 0.55);
  color: #ecfdf5;
}

.news-bell-btn.news-bell-wiggle {
  animation: newsBellWiggle 0.55s ease;
}

@keyframes newsBellWiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-12deg);
  }
  60% {
    transform: rotate(8deg);
  }
  80% {
    transform: rotate(-6deg);
  }
}

.vjs-player.controls-idle .player-custom-controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.vjs-player .player-custom-controls {
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
  .anime-card img,
  .continue-card img,
  .trending-card img {
    opacity: 1;
    transition: none;
  }

  .anime-card {
    transition: none;
  }

  .anime-card:hover {
    transform: none;
  }

  .btn-favorite.is-pulse,
  .btn-watch-later.is-pulse,
  .online-modal.is-open .online-sheet,
  .support-modal.is-open .support-sheet,
  .news-bell-btn.news-bell-wiggle {
    animation: none;
  }

  .app-loading-bar::after {
    animation: none;
    width: 100%;
    transform: none;
  }

  .offline-banner,
  .back-to-top,
  .vjs-player.controls-idle .player-custom-controls,
  .vjs-player .player-custom-controls {
    transition: none;
  }

  .vjs-player.controls-idle .player-custom-controls {
    transform: none;
  }
}

.reduce-motion .anime-card img,
.reduce-motion .continue-card img,
.reduce-motion .trending-card img {
  opacity: 1;
}

.reduce-motion .anime-card:hover {
  transform: none;
}

.reduce-motion .btn-favorite.is-pulse,
.reduce-motion .btn-watch-later.is-pulse,
.reduce-motion .news-bell-btn.news-bell-wiggle {
  animation: none;
}
