/* ==========================================================================
   shorts-cards.css — For You section: Rich shorts cards (9/16 portrait)
   ========================================================================== */

/* Override aspect ratio for short cards */
.for-you-short .for-you-thumb {
  aspect-ratio: 9/13;
}

/* Cinematic inset ring */
.for-you-short::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
  pointer-events: none;
  z-index: 3;
}
.for-you-short { position: relative; }

/* Taller gradient for text readability, bottom padding for duration/views badges */
.for-you-short .for-you-info {
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding-top: 30px;
}
/* Remove play icon prefix — no longer needed */
.for-you-short .for-you-info::before { display: none; }

/* Duration badge — bottom right, above overlay */
.short-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 5;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #eee;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* Views badge — top right */
.short-views {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #eee;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ── Badges (New / Hot) — matched to .thumb-badge system ── */
.short-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
  height: 18px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.short-badge-new { background: var(--accent, #e84393); }
.short-badge-hot { background: linear-gradient(135deg, #ff6b35, #ff4500); }

/* ── Trailer playback — border fill then rainbow spin (single ::after, JS-driven phase switch) ── */
@property --bp {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: true;
}
@property --br {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: true;
}

/* Loading — pulsing accent border while waiting for trailer */
.for-you-short.trailer-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 3px solid rgba(255,255,255,0.7);
  z-index: 10;
  pointer-events: none;
  animation: shortBorderPulse 1s ease-in-out infinite;
}
@keyframes shortBorderPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Phase 1 — white fill tracks actual trailer playback */
.for-you-short.trailer-playing::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: conic-gradient(
    from 180deg,
    rgba(255,255,255,0.7) 0deg,
    rgba(255,255,255,0.7) var(--bp),
    transparent var(--bp),
    transparent calc(360deg - var(--bp)),
    rgba(255,255,255,0.7) calc(360deg - var(--bp))
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 10;
  pointer-events: none;
  /* --bp driven by JS: video.currentTime / video.duration * 180 */
}

/* Phase 2 — rainbow border overlay (real DOM element, fades in over white) */
.short-rainbow-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: conic-gradient(
    from var(--br),
    #e84393, #ff6b35, #ffd700, #4caf50, #2196f3, #9c27b0, #e84393
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: opacity;
}
.for-you-short.border-rainbow .short-rainbow-border {
  opacity: 1;
  animation: shortBorderSpin 3s linear infinite;
}

/* Play CTA — appears with rainbow phase */
.for-you-short .short-play-cta {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  color: #111;
  font-size: 16px;
  line-height: 40px;
  text-align: center;
  padding-left: 3px;
  z-index: 8;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  animation: shortPlayCtaIn 0.35s ease forwards;
}
@keyframes shortPlayCtaIn {
  to { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
}

/* Seen state — thumb + badge dim after rainbow phase */
.for-you-short .for-you-thumb img,
.for-you-short .short-badge {
  transition: filter 1s ease;
}
.for-you-short.short-seen .for-you-thumb img,
.for-you-short.short-seen .short-badge {
  filter: brightness(0.5) saturate(0.4);
}
@keyframes shortBorderSpin {
  to { --br: 360deg; }
}

/* ── Trailer preview on hover ── */
.for-you-short .video-preview {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
}
.for-you-short .video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.for-you-short.trailer-playing .video-preview { opacity: 1; }
/* Contain repaint scope — always active to prevent layout shift on hover */
.for-you-short { contain: layout paint; }
.for-you-short.trailer-playing .short-duration,
.for-you-short.trailer-playing .short-views,
.for-you-short.trailer-playing .short-badge,
.for-you-short.trailer-playing .for-you-info { opacity: 0; transition: opacity 0.2s; }
.for-you-short .hot-card-link {
  position: absolute;
  inset: 0;
  z-index: 6;
}

/* ── Actor row ── */
.for-you-actor {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}
.for-you-actor-initial {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent, #e84393);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 2px 0 0 0;
}
.for-you-actor-name {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Desktop — slightly larger shorts cards */
.for-you-short { flex: 0 0 150px; }

/* ── Responsive — compact on mobile ── */
@media (max-width: 767.98px) {
  .for-you-short { flex: 0 0 115px; }
}
@media (max-width: 440px) {
  .for-you-short { flex: 0 0 115px; }
}
@media (max-width: 359px) {
  .for-you-short { flex: 0 0 100px; }
}
