/* Series Detail Page */

.single-series {
  padding-top: 16px;
}

/* Hero */
.series-hero {
  position: relative;
  height: 400px;
  border-radius: var(--xreel-radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
}

.series-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(8px);
  transform: scale(1.1);
}

.series-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--xreel-bg) 0%, rgba(10,10,20,0.6) 40%, transparent 80%),
              linear-gradient(to right, rgba(10,10,20,0.5) 0%, transparent 50%);
}

.series-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 24px;
  padding: 24px;
  align-items: flex-end;
}

.series-poster {
  width: 160px;
  height: 240px;
  border-radius: var(--xreel-radius);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  border: 2px solid rgba(255,255,255,0.1);
  background: var(--xreel-bg-card);
}

.series-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-info {
  flex: 1;
  min-width: 0;
}

.series-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.series-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.series-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--xreel-text-secondary);
  margin-bottom: 16px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.series-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Description */
.series-description {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--xreel-bg-card);
  border-radius: var(--xreel-radius);
}

.description-text {
  color: var(--xreel-text-secondary);
  line-height: 1.8;
  font-size: 14px;
}

.no-description {
  color: var(--xreel-text-muted);
  font-style: italic;
}

/* Episodes section */
.series-episodes {
  margin-bottom: 40px;
}

.episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.episodes-header .section-title {
  margin-bottom: 0;
}

.episodes-pagination {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.episodes-pagination::-webkit-scrollbar { display: none; }

.ep-page-btn {
  flex-shrink: 0;
  background: var(--xreel-bg-card);
  border: 1px solid var(--xreel-border);
  color: var(--xreel-text);
  padding: 6px 14px;
  border-radius: var(--xreel-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--xreel-transition);
}

.ep-page-btn:hover:not(.active) {
  border-color: var(--xreel-primary);
}

.ep-page-btn.active {
  background: var(--xreel-primary);
  border-color: var(--xreel-primary);
  color: white;
  box-shadow: 0 2px 12px var(--xreel-primary-glow);
}

/* Episode grid */
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.ep-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--xreel-bg-card);
  border: 1px solid var(--xreel-border);
  border-radius: var(--xreel-radius-sm);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: var(--xreel-transition);
  position: relative;
  color: var(--xreel-text);
}

.ep-card:hover {
  background: var(--xreel-bg-hover);
  border-color: var(--xreel-primary);
  transform: scale(1.05);
}

.ep-card.active {
  background: var(--xreel-primary);
  border-color: var(--xreel-primary);
  color: white;
  box-shadow: 0 4px 16px var(--xreel-primary-glow);
}

.ep-card.watched::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--xreel-success);
}

.ep-card.locked::before {
  content: '🔒';
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  opacity: 0.7;
}

/* Related series */
.related-series {
  margin-bottom: 40px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.related-card {
  display: block;
  transition: var(--xreel-transition);
}

.related-card:hover {
  transform: translateY(-4px);
}

.related-card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--xreel-radius-sm);
  overflow: hidden;
  background: var(--xreel-bg-card);
}

.related-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-title {
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-card-meta {
  font-size: 11px;
  color: var(--xreel-text-muted);
  margin-top: 2px;
}
