:root {
  --primary: #e50914;
  --primary-hover: #ff0a16;
  --primary-glow: rgba(229, 9, 20, 0.4);
  --background: #121212;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-tertiary: #707070;
  --rating-color: #ffd700;
  --card-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  --card-shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.25);
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  --bezier-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(229, 9, 20, 0.3); }
  50% { box-shadow: 0 0 20px rgba(229, 9, 20, 0.5); }
  100% { box-shadow: 0 0 5px rgba(229, 9, 20, 0.3); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.trending-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  animation: fadeIn 0.6s ease-out;
  perspective: 1000px;
}

body {
  background-color: var(--background);
  color: #fff;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.trending-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
  position: relative;
}

.trending-title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.7px;
  position: relative;
  background: linear-gradient(to right, #fff, #f0f0f0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.5s ease;
}

.trending-title:hover {
  transform: translateZ(10px);
}

.trending-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, var(--primary), #ff6b6b);
  border-radius: 3px;
  opacity: 0.8;
  transition: width 0.5s ease;
}

.trending-title:hover::after {
  width: 100px;
}

.trending-title svg {
  width: 32px;
  height: 32px;
  margin-left: 15px;
  color: var(--primary);
  filter: drop-shadow(0 0 10px var(--primary-glow));
  animation: pulse 3s var(--bezier-bounce) infinite;
  background: none;
  box-shadow: none;
  border: none;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.trending-title:hover svg {
  transform: translateZ(15px) rotate(15deg);
}

.trending-description {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  font-weight: 400;
  opacity: 0.9;
  animation: slideInUp 0.8s ease-out forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.trending-layout-switcher {
  display: flex;
  gap: 10px;
  margin-left: auto;
  margin-top: 16px;
}

.trending-layout-button {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2a2a2a;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s var(--bezier-bounce);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.trending-layout-button:hover {
  background-color: #3a3a3a;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.trending-layout-button.active {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
  animation: glow 2s infinite;
}

.trending-layout-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.trending-layout-button:hover::before {
  left: 100%;
}

.trending-layout-button svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.trending-layout-button:hover svg {
  transform: scale(1.15);
}

.tabs-container {
  text-align: center;
  margin-bottom: 35px;
  position: relative;
}

.tabs-list {
  display: inline-flex;
  list-style: none;
  gap: 18px;
  margin: 0 auto;
  white-space: nowrap;
  overflow-x: auto;
  padding-bottom: 12px;
}

.tab-item {
  position: relative;
}

.tab-input {
  display: none;
}

.tab-label {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s var(--bezier-bounce);
  position: relative;
  letter-spacing: -0.2px;
  overflow: hidden;
  z-index: 1;
  box-shadow: none;
  border: none;
  outline: none;
  margin-top: 2px;
}

.tab-label::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: rgba(229, 9, 20, 0.05);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  border-radius: 12px;
}

.tab-label:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

.tab-label:hover::before {
  height: 100%;
}

.tab-input:checked + .tab-label {
  color: var(--text-primary);
  font-weight: 600;
  background-color: rgba(229, 9, 20, 0.05);
}

.tab-input:checked + .tab-label::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 12px;
  right: 12px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), #ff6b6b);
  border-radius: 4px;
  box-shadow: 0 0 15px var(--primary-glow);
  animation: glow 2s infinite alternate;
}

.tab-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  margin-bottom: 35px;
  margin-top: auto;
  opacity: 0.3;
  position: relative;
  overflow: hidden;
}

.tab-divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  position: relative;
  padding-left: 18px;
  letter-spacing: -0.5px;
  animation: slideInUp 0.5s ease-out forwards;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: inline-block;
  overflow: hidden;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 75%;
  width: 5px;
  background: linear-gradient(to bottom, var(--primary) 30%, #ff6b6b 100%);
  border-radius: 3px;
  box-shadow: 0 0 15px var(--primary-glow);
  animation: glow 3s infinite alternate;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  transition: width 0.5s ease;
}

.section-header:hover .section-title::after {
  width: 120px;
}

.view-all-link {
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  padding: 8px 14px;
  border-radius: 10px;
  overflow: hidden;
  animation: slideInUp 0.5s ease-out forwards;
}

.view-all-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(229, 9, 20, 0.08);
  border-radius: 10px;
  transition: all 0.3s ease;
  transform: scaleX(0);
  transform-origin: right;
}

.view-all-link:hover {
  color: var(--primary-hover);
  transform: translateX(4px);
  text-shadow: 0 0 8px var(--primary-glow);
  padding-right: 20px;
}

.view-all-link:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.view-all-link svg {
  width: 16px;
  height: 16px;
  margin-left: 6px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.view-all-link:hover svg {
  transform: translateX(6px);
}

.trending-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 60px;
  position: relative;
}

body {
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  background-size: 100% 100%;
}

.trending-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background-image: var(--card-gradient);
  backdrop-filter: blur(10px);
  transition: all 0.5s var(--bezier-bounce);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  transform: perspective(1000px) rotateX(0) rotateY(0);
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

.trending-card:hover {
  transform: translateY(-10px) perspective(1000px) rotateX(2deg) rotateY(-1deg) scale(1.02);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3), 0 0 30px rgba(229, 9, 20, 0.1);
  background-image: var(--card-hover-gradient);
  border-color: rgba(229, 9, 20, 0.3);
  z-index: 5;
}

.trending-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--card-highlight);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: 18px;
}

.trending-card:hover::before {
  opacity: 1;
}

.trending-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  box-shadow: 0 0 0 0 rgba(229, 9, 20, 0);
  transition: box-shadow 0.4s ease;
  pointer-events: none;
}

.trending-card:hover::after {
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.trending-card a {
  display: flex;
  gap: 20px;
  height: 100%;
}

.trending-card-image-container {
  position: relative;
  width: 33.333%;
  min-width: 120px;
  flex-shrink: 0;
  overflow: hidden;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #333, #222);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.trending-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform;
  filter: brightness(0.95) contrast(1.05);
}

.trending-card:hover .trending-card-image {
  transform: scale(1.12);
  filter: brightness(1.05) contrast(1.1) saturate(1.1);
}

.trending-card-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.trending-card:hover .trending-card-image-container::after {
  opacity: 1;
}

.trending-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.trending-card:hover .trending-card-overlay {
  opacity: 1;
}

.trending-card-rating {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 12px;
  z-index: 2;
  padding: 6px 10px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  transform: translateY(10px);
  opacity: 0;
}

.trending-card-image-container:hover .trending-card-rating,
.trending-card:hover .trending-card-rating {
  transform: translateY(0);
  opacity: 1;
}

.trending-card-rating svg {
  width: 14px;
  height: 14px;
  color: var(--rating-color);
  margin-right: 5px;
  filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3));
}

.trending-card-content {
  flex: 1;
  padding: 24px 24px 24px 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.trending-card-content::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.trending-card-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.rating-circle-container {
  position: relative;
  width: 46px;
  height: 46px;
  margin-right: 8px;
  transition: transform 0.3s ease;
  background: none;
  border: none;
  box-shadow: none;
}

.trending-card:hover .rating-circle-container {
  transform: scale(1.05);
}

.rating-circle {
  transform: rotate(90deg);
  width: 100%;
  height: 100%;
  transform-origin: center;
  transition: transform 0.5s ease;
  background: none;
  border: none;
  box-shadow: none;
}

.trending-card:hover .rating-circle {
  transform: rotate(450deg);
}

.rating-circle-bg {
  stroke: rgba(255, 204, 0, 0.15);
  fill: rgba(32, 32, 32, 0.6);
  stroke-width: 2px;
  filter: none;
  box-shadow: none;
  border: none;
}

.rating-circle-value {
  stroke: var(--rating-color);
  stroke-linecap: round;
  fill: none;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
  transition: stroke-dasharray 1.5s ease;
  box-shadow: none;
  border: none;
}

.rating-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.trending-card:hover .rating-value {
  font-size: 14px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.trending-card-type {
  background-color: #333;
  color: #f0f0f0;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  display: inline-block;
  transform: none;
  outline: none;
  box-shadow: none;
}

.trending-card:hover .trending-card-type {
  background-color: var(--primary);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
  transform: translateY(-2px);
}

.trending-card-original-title {
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.trending-card:hover .trending-card-original-title {
  color: var(--text-secondary);
}

.trending-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease;
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: 5px;
}

.trending-card-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), transparent);
  transition: width 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  border-radius: 2px;
}

.trending-card:hover .trending-card-title {
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.trending-card:hover .trending-card-title::after {
  width: 80px;
  animation: glow 2s infinite alternate;
}

.trending-card-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.trending-card:hover .trending-card-description {
  color: #d0d0d0;
}

.trending-card-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.trending-card-genre-tag {
  background-color: rgba(229, 9, 20, 0.1);
  color: #f0f0f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(229, 9, 20, 0.3);
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.trending-card-genre-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: 0.5s;
}

.trending-card:hover .trending-card-genre-tag {
  background-color: rgba(229, 9, 20, 0.15);
  border-color: rgba(229, 9, 20, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.trending-card:hover .trending-card-genre-tag::before {
  left: 100%;
}

.ri-film-line,
.ri-tv-line,
.ri-netflix-line,
.ri-gamepad-line,
.ri-heart-line,
.ri-eye-line,
.ri-star-line,
.ri-fire-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
}

.trending-section {
  margin-bottom: 60px;
  position: relative;
}

.active-filter-indicator {
    position: fixed;
    top: 100px;
    right: 30px;
    background-color: rgba(229, 9, 20, 0.9);
    color: white;
    padding: 10px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(5px);
    }

.active-filter-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.active-filter-indicator::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 30px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent, rgba(255, 255, 255, 0.1));
    z-index: -1;
}

.how-trending-works {
  background-color: rgba(32, 32, 32, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 60px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
}

.how-trending-works::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  opacity: 0.5;
}

.how-trending-works::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 70% 30%, rgba(229, 9, 20, 0.1), transparent 70%);
  pointer-events: none;
}

.how-trending-works:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.how-trending-works-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 35px;
  position: relative;
  padding-left: 20px;
  letter-spacing: -0.5px;
}

.how-trending-works-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 70%;
  width: 5px;
  background-color: var(--primary);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--primary-glow);
}

.trending-factors {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.trending-factor {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  position: relative;
  overflow: hidden;
}

.trending-factor::before {
  content: '';
  position: absolute;
  inset: 1px;
  background: radial-gradient(circle at center 10%, rgba(255, 255, 255, 0.03), transparent 70%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.trending-factor:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
  border-color: rgba(229, 9, 20, 0.3);
}

.trending-factor:hover::before {
  opacity: 1;
}

.trending-factor-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(229, 9, 20, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border: 2px solid rgba(229, 9, 20, 0.3);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.trending-factor-icon::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(229, 9, 20, 0), rgba(229, 9, 20, 0.3), rgba(229, 9, 20, 0));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease, transform 1s ease;
  transform: rotate(0deg);
}

.trending-factor:hover .trending-factor-icon {
  background-color: rgba(229, 9, 20, 0.15);
  transform: scale(1.15);
  border-color: rgba(229, 9, 20, 0.5);
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.4);
}

.trending-factor:hover .trending-factor-icon::after {
  opacity: 1;
  transform: rotate(360deg);
}

.trending-factor-icon svg {
  width: 38px;
  height: 38px;
  color: var(--primary);
  filter: drop-shadow(0 0 5px rgba(229, 9, 20, 0.4));
  transition: all 0.5s ease;
  position: relative;
  z-index: 1;
}

.trending-factor:hover .trending-factor-icon svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.6));
}

.trending-factor-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.trending-factor-title::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.4s ease;
  border-radius: 2px;
}

.trending-factor:hover .trending-factor-title {
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.trending-factor:hover .trending-factor-title::after {
  width: 40px;
}

.trending-factor-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
  margin-bottom: 15px;
}

.trending-factor:hover .trending-factor-description {
  color: #d0d0d0;
}

.trending-factor-progress {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  margin-top: 5px;
}

.trending-factor-progress .progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary), #ff4d4d);
  border-radius: 3px;
  position: relative;
  animation: progress-animation 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: calc(0.3s * var(--factor-index, 0) + 0.8s);
}

@keyframes progress-animation {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

.genre-discovery {
  margin-bottom: 60px;
}

.genre-discovery-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 30px;
  position: relative;
  padding-left: 20px;
  letter-spacing: -0.5px;
}

.genre-discovery-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 70%;
  width: 5px;
  background-color: var(--primary);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--primary-glow);
}

.genre-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.genre-card {
  position: relative;
  height: 180px;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(0);
  will-change: transform, box-shadow;
}

.genre-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(229, 9, 20, 0.15);
  border-color: rgba(229, 9, 20, 0.3);
  z-index: 1;
}

.genre-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent 50%);
  opacity: 0;
  transform: scale(1.5);
  transform-origin: center;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 1s ease;
}

.genre-card:hover::after {
  opacity: 1;
  transform: scale(1);
}

.genre-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  will-change: transform;
  transform: scale(1.05);
}

.genre-card:hover .genre-card-bg {
  transform: scale(1.15) translateY(-5px);
  filter: brightness(1.1) contrast(1.1) saturate(1.1);
}

.genre-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top, 
    rgba(0, 0, 0, 0.95) 0%, 
    rgba(0, 0, 0, 0.7) 30%,
    rgba(0, 0, 0, 0.4) 60%, 
    rgba(0, 0, 0, 0.1) 80%
  );
  transition: all 0.7s ease;
  z-index: 1;
}

.genre-card:hover .genre-card-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.98) 0%,
    rgba(0, 0, 0, 0.8) 20%,
    rgba(0, 0, 0, 0.6) 40%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.2) 80%
  );
}

.genre-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 30px;
  width: 100%;
  z-index: 2;
  transform: translateY(0);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.genre-card:hover .genre-card-content {
  transform: translateY(-8px);
}

.genre-card-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: all 0.4s ease;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

.genre-card-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.4s ease;
  border-radius: 2px;
}

.genre-card:hover .genre-card-title {
  transform: scale(1.05);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.genre-card:hover .genre-card-title::after {
  width: 100%;
}

.genre-card-count {
  font-size: 16px;
  font-weight: 500;
  color: #ddd;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
  opacity: 0.9;
}

.genre-card:hover .genre-card-count {
  color: #fff;
  opacity: 1;
}

.genre-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 54px;
  height: 54px;
  background-color: rgba(229, 9, 20, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  z-index: 2;
  border: 2px solid rgba(229, 9, 20, 0.3);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  font-size: 24px;
  transform: rotate(0);
}

.genre-card-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(229, 9, 20, 0), rgba(229, 9, 20, 0.3), rgba(229, 9, 20, 0));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease, transform 1s ease;
  transform: rotate(0deg);
}

.genre-card:hover .genre-card-icon {
  transform: rotate(15deg) scale(1.15);
  background-color: rgba(229, 9, 20, 0.3);
  border-color: rgba(229, 9, 20, 0.5);
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.5);
}

.genre-card:hover .genre-card-icon::after {
  opacity: 1;
  transform: rotate(360deg);
}

@media (min-width: 768px) {
  .trending-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .trending-title {
    font-size: 36px;
    text-align: left;
    margin-bottom: 0;
    justify-content: flex-start;
  }
  
  .trending-title::after {
    display: none;
  }
  
  .trending-description {
    text-align: left;
  }
  
  .trending-layout-switcher {
    margin-top: 0;
  }
  
  .trending-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .trending-factors {
    flex-direction: row;
  }
  
  .genre-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .trending-title {
    font-size: 38px;
  }
  
  .trending-card-content {
    padding: 28px 28px 28px 0;
  }
  
  .genre-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .trending-title {
    font-size: 40px;
  }
  
  .genre-cards {
    grid-template-columns: repeat(5, 1fr);
  }
}

.how-trending-works-mobile {
  display: block;
}

.how-trending-works-desktop {
  display: none;
}

@media (min-width: 768px) {
  .how-trending-works-mobile {
    display: none;
  }
  
  .how-trending-works-desktop {
    display: block;
  }
}
svg {
  overflow: visible;
  display: inline-block;
  vertical-align: middle;
  box-shadow: none;
  border: none;
  background: none;
  filter: none;
}

.trending-title svg,
.trending-card-rating svg,
.view-all-link svg,
.trending-factor-icon svg,
.rating-circle,
.rating-circle-bg,
.rating-circle-value {
  overflow: visible;
  box-shadow: none;
  border: none;
  background: none;
}

.rating-circle-container {
  position: relative;
  width: 46px;
  height: 46px;
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  background: none;
  border: none;
  box-shadow: none;
  vertical-align: middle;
}

.trending-card:hover .rating-circle-container {
  transform: scale(1.05);
}

.rating-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(90deg);
  transform-origin: center;
  transition: transform 0.5s ease;
  background: none;
  border: none;
  box-shadow: none;
}

.trending-card:hover .rating-circle {
  transform: rotate(450deg);
}

.rating-circle-bg {
  stroke: rgba(255, 204, 0, 0.15);
  fill: rgba(32, 32, 32, 0.6);
  stroke-width: 2px;
  filter: none;
  box-shadow: none;
  border: none;
}

.rating-circle-value {
  stroke: var(--rating-color);
  stroke-linecap: round;
  fill: none;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
  transition: stroke-dasharray 1.5s ease;
  box-shadow: none;
  border: none;
}

.rating-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  background: none;
  box-shadow: none;
  border: none;
  display: block;
  width: auto;
  height: auto;
  pointer-events: none;
  z-index: 2;
}

.tabs-container {
  text-align: center;
  margin-bottom: 35px;
  position: relative;
  overflow: visible;
}

.tabs-list {
  display: inline-flex;
  list-style: none;
  gap: 18px;
  margin: 0 auto;
  white-space: nowrap;
  overflow-x: auto;
  padding-bottom: 12px;
  padding-top: 5px;
  position: relative;
  box-shadow: none;
  border: none;
  background: none;
}

@media (max-width: 767px) {
  .trending-layout-switcher {
      display: none !important;
  }
}