/* BWHS clone — foreground cards + horizontal info popup with hover effects */
.media-card,
.shelf-card,
.upcoming-card,
.panel-item-card,
.sidebar-rec-card,
.hero-mini-poster {
  transition: transform 0.18s ease, box-shadow 0.18s ease, z-index 0s;
}

.media-card.bwhs-elevated,
.shelf-card.bwhs-elevated,
.upcoming-card.bwhs-elevated,
.panel-item-card.bwhs-elevated,
.sidebar-rec-card.bwhs-elevated,
.hero-mini-poster.bwhs-elevated {
  z-index: 40 !important;
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.08);
  position: relative;
}

/* Horizontal info popup (poster left, info right) */
.synopsis-popup {
  position: fixed;
  z-index: 10001;
  pointer-events: auto;
  width: 360px;
  perspective: 1000px;
  opacity: 0;
  transform: scale(0.92) translateY(10px);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(.18,.89,.32,1.28), box-shadow 0.2s ease, filter 0.2s ease;
  filter: drop-shadow(0 22px 48px rgba(15,23,42,0.32));
  cursor: default;
}

.synopsis-popup.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.synopsis-popup.visible:hover {
  transform: scale(1.035) translateY(-2px);
  filter: drop-shadow(0 28px 56px rgba(15,23,42,0.42));
}

.synopsis-popup .flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
  transform: rotateY(-75deg);
}

.synopsis-popup.visible .flip-inner {
  transform: rotateY(0deg);
}

.synopsis-popup .sp-front {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  min-height: 160px;
  backface-visibility: hidden;
  transition: background 0.2s ease;
}

.synopsis-popup:hover .sp-front {
  background: #fafafa;
}

.synopsis-popup .sp-poster {
  flex: 0 0 110px;
  width: 110px;
  background: #f1f5f9;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.synopsis-popup:hover .sp-poster {
  transform: scale(1.03);
}

.synopsis-popup .sp-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 160px;
  transition: transform 0.3s ease;
}

.synopsis-popup:hover .sp-poster img {
  transform: scale(1.06);
}

.synopsis-popup .sp-info {
  flex: 1;
  padding: 12px 14px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  min-width: 0;
  transition: background 0.2s ease;
}

.synopsis-popup:hover .sp-info {
  background: #f8fafc;
}

.synopsis-popup .sp-synopsis {
  font-size: 0.72rem;
  line-height: 1.4;
  color: #1e293b;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
  transition: color 0.2s ease;
}

.synopsis-popup:hover .sp-synopsis {
  color: #0f172a;
}

.synopsis-popup .sp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.synopsis-popup .sp-rating {
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.synopsis-popup:hover .sp-rating {
  transform: scale(1.08);
}

.synopsis-popup .sp-casts {
  font-size: 0.64rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.3;
}

.synopsis-popup .sp-casts span {
  display: inline-block;
  background: #f8fafc;
  padding: 2px 7px;
  border-radius: 6px;
  margin: 2px 4px 0 0;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.synopsis-popup:hover .sp-casts span {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.synopsis-popup:hover .sp-casts span:hover {
  transform: translateY(-1px) scale(1.04);
  background: #e0e7ff;
}

@media (max-width: 640px) {
  .synopsis-popup { width: 300px; }
  .synopsis-popup .sp-poster { flex: 0 0 90px; width: 90px; }
}
