/* ==========================================================================
   ANISHIFT - TRENDING PAGE STYLES (trending.css)
   Exact match to user mockup image with complete responsiveness
   ========================================================================== */

/* 1. Header Bar with Seasons & Year Filter */
.trending-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.trending-title-area {
  display: flex;
  flex-direction: column;
}

.trending-main-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 0;
}

.trending-sub-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 5px;
}

.trending-controls {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

/* Season Navigation Tabs: WINTER, SPRING, SUMMER, FALL */
.season-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

.season-tab-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 2px;
  position: relative;
  transition: color 0.18s ease;
  cursor: pointer;
  background: none;
  border: none;
}

.season-tab-btn:hover {
  color: var(--text-main);
}

.season-tab-btn.active {
  color: var(--text-main);
}

.season-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--text-main);
  border-radius: 2px;
}

/* Year Dropdown Selector: e.g. [Calendar] 2026 */
.year-select-wrap {
  position: relative;
}

.year-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.year-select-btn:hover {
  border-color: var(--text-main);
  background: var(--bg-hover);
}

.year-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 110px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 50;
  display: none;
  flex-direction: column;
  padding: 4px;
  gap: 2px;
}

.year-dropdown-menu.show {
  display: flex;
}

.year-dropdown-item {
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  width: 100%;
  transition: all 0.12s;
}

.year-dropdown-item:hover,
.year-dropdown-item.active {
  background: var(--bg-hover);
  color: var(--text-main);
  font-weight: 600;
}

/* 2. Main 3-Column Grid */
.trending-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

/* 3. Horizontal Trending Card (Exact match to Mockup Image) */
.trending-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}

.trending-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .trending-card:hover {
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Faint Anime Banner Background Layer (Subtler than home.html as requested) */
.trending-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  filter: grayscale(100%) contrast(1.06);
  opacity: 0.08; /* Slightly fainter than home's 0.16 */
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

[data-theme="dark"] .trending-card-bg,
[data-theme="oled"] .trending-card-bg,
[data-theme="navy"] .trending-card-bg {
  opacity: 0.12; /* Slightly fainter than home's 0.22 */
  filter: grayscale(100%) contrast(1.15) brightness(0.85);
}

.trending-card:hover .trending-card-bg {
  opacity: 0.17;
  transform: scale(1.04);
}

/* Poster */
.trending-card-poster {
  width: 105px;
  min-width: 105px;
  height: 146px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-hover);
  position: relative;
  z-index: 1;
}

.trending-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.trending-card:hover .trending-card-poster img {
  transform: scale(1.05);
}

/* Body */
.trending-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-right: 28px;
  position: relative;
  z-index: 1;
}

.trending-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.trending-card:hover .trending-card-title {
  color: var(--accent-primary);
}

/* Meta badges */
.trending-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 11px;
}

.trending-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-badge);
  color: var(--text-muted);
  line-height: 1.2;
}

.trending-meta-badge i {
  font-size: 8.5px;
  color: var(--text-muted);
}

.trending-meta-badge.sub-badge {
  color: var(--text-main);
}

.trending-meta-badge.dub-badge {
  color: var(--text-muted);
}

.trending-meta-badge.format-badge {
  text-transform: uppercase;
  color: var(--text-main);
}

.trending-meta-badge.year-badge {
  color: var(--text-dim);
}

/* Description Clamped to 3 lines */
.trending-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: auto;
}

/* Bottom Right Square Plus Button */
.trending-card-add-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}

.trending-card-add-btn:hover {
  background: var(--text-main);
  color: var(--bg-surface);
  transform: scale(1.1);
}

.trending-card-add-btn.bookmarked {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* 4. Pagination */
.trending-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  margin-bottom: 48px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--text-main);
  background: var(--bg-hover);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.trending-page-indicator {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 10px;
}

/* 5. Responsive Design */
@media (max-width: 1100px) {
  .trending-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .trending-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .trending-controls {
    width: 100%;
    justify-content: space-between;
  }
  .season-tabs {
    gap: 12px;
  }
  .season-tab-btn {
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .trending-cards-grid {
    grid-template-columns: 1fr;
  }
  .trending-card {
    padding: 10px;
    gap: 12px;
  }
  .trending-card-poster {
    width: 90px;
    min-width: 90px;
    height: 128px;
  }
  .trending-card-title {
    font-size: 13px;
  }
}
