/* ============================================
   Animated Badge Styles (Popular, Rating)
   ============================================ */

/* Общий контейнер для всех бейджей */
.popular-badge,
.rating-badge,
.new-badge {
  position: absolute;
  left: 12px;
  z-index: 10;
  pointer-events: none;
  display: none;
}

/* ============================================
   Popular Badge
   ============================================ */
.asset-card.has-popular .popular-badge {
  display: block;
  top: 12px;
}

.popular-badge-text {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7em;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 6px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 50%, #ff8c00 100%);
  background-size: 200% 200%;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(255, 65, 108, 0.7), 0 0 25px rgba(255, 75, 43, 0.5), 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: popularBadgePulse 2s ease-in-out infinite, popularBadgeGradient 3s ease infinite;
  white-space: nowrap;
}

@keyframes popularBadgePulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.7), 0 0 25px rgba(255, 75, 43, 0.5), 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 25px rgba(255, 65, 108, 0.9), 0 0 40px rgba(255, 75, 43, 0.7), 0 6px 16px rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
  }
}

@keyframes popularBadgeGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================
   Rating Badge
   ============================================ */
.rating-badge {
  top: 42px;
}

/* Рейтинг второй (после популярного или новинки) */
.asset-card.has-popular:not(.has-new) .rating-badge,
.asset-card.has-new:not(.has-popular) .rating-badge {
  display: block;
}

/* Рейтинг третий (после популярного и новинки) */
.asset-card.has-popular.has-new .rating-badge {
  display: block;
  top: 72px;
}

.rating-badge-text {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7em;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 6px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 50%, #00ff88 100%);
  background-size: 200% 200%;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(56, 239, 125, 0.6), 0 0 25px rgba(17, 153, 142, 0.5), 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: ratingBadgePulse 2s ease-in-out infinite, ratingBadgeGradient 3s ease infinite;
  white-space: nowrap;
}

@keyframes ratingBadgePulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.6), 0 0 25px rgba(17, 153, 142, 0.5), 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 25px rgba(56, 239, 125, 0.8), 0 0 40px rgba(17, 153, 142, 0.7), 0 6px 16px rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
  }
}

@keyframes ratingBadgeGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .popular-badge-text,
  .rating-badge-text {
    animation: none;
    background-size: 200% 200%;
  }
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 860px) {
  .asset-card.has-popular .popular-badge {
    top: 10px;
    left: 8px;
  }

  .asset-card.has-popular:not(.has-new) .rating-badge,
  .asset-card.has-new:not(.has-popular) .rating-badge {
    top: 38px;
    left: 8px;
  }

  .asset-card.has-popular.has-new .rating-badge,
  .asset-card.has-popular.has-rating:not(.has-new) .new-badge {
    top: 62px;
    left: 8px;
  }

  .asset-card:not(.has-popular):not(.has-new) .rating-badge {
    top: 38px;
    left: 8px;
  }

  .popular-badge-text,
  .rating-badge-text {
    padding: 2px 8px;
    font-size: 0.65em;
  }
}
