/* =====================================================================
   POINT OF VIEW — Poster marquee background
   ---------------------------------------------------------------------
   Rows of poster cards slowly scrolling sideways behind every user page
   (Netflix-login style). Markup: resources/views/partials/background-posters.blade.php
   Data:   resources/data/background-posters.json
   Images: public/images/posters/<slug>.jpg (optional; gradient fallback otherwise)

   Self-contained: works on the user layout AND on the shared login page,
   which does not load pov.css.
   ===================================================================== */

/* ---------------------------------------------------------------------
   CONTROLS — change these four values to tune the background
   --------------------------------------------------------------------- */
.pov-bgm {
  --bg-speed: 1;                /* loop-time multiplier for every row. 1 = 60–110 s per loop, 1.5 = slower, 0.6 = faster */
  --bg-overlay-opacity: 0.88;   /* navy #0B132B layer over the posters. 0 = posters fully visible, 1 = fully hidden */
  --bg-poster-brightness: 0.7;  /* poster brightness before the overlay. 1 = original */
  --bg-tilt: 0deg;              /* rotation of the whole poster wall. 0deg = straight; try -4deg for a slight angle */
}

/* Login / Register pages (body class "pov-auth"): lighter overlay so the posters show more */
.pov-auth .pov-bgm { --bg-overlay-opacity: 0.72; }

/* ---------------------------------------------------------------------
   Structure
   --------------------------------------------------------------------- */
.pov-bgm {
  --bg-gap: 14px;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0b132b;
}

/* Oversized so a tilt never reveals empty corners */
.pov-bgm__wall {
  position: absolute;
  inset: -12vh -12vw;
  display: flex;
  flex-direction: column;
  gap: var(--bg-gap);
  transform: rotate(var(--bg-tilt));
}

.pov-bgm__row {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
}

/* Each track holds the same set of cards twice; sliding by -50% loops seamlessly.
   Cards use margin (not flex gap) so both halves are exactly equal in width. */
.pov-bgm__track {
  display: flex;
  height: 100%;
  width: max-content;
  animation: pov-bgm-scroll calc(var(--row-dur, 80s) * var(--bg-speed)) linear infinite;
  animation-delay: var(--row-delay, 0s);
  will-change: transform;
}
.pov-bgm__row:nth-child(even) .pov-bgm__track { animation-direction: reverse; } /* left → right */

.pov-bgm.is-paused .pov-bgm__track { animation-play-state: paused; } /* tab hidden */

@keyframes pov-bgm-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ---------------------------------------------------------------------
   Poster card (portrait 2:3, 14px radius)
   --------------------------------------------------------------------- */
.pov-bgm__card {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 2 / 3;
  margin-right: var(--bg-gap);
  overflow: hidden;
  border-radius: 14px;
  container-type: inline-size;
  filter: blur(1px) brightness(var(--bg-poster-brightness));
}
.pov-bgm__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gradient fallbacks: navy / orange variants */
.pov-bgm__card--v1 { background: radial-gradient(90% 60% at 80% 10%, rgba(255, 107, 53, 0.55), transparent 60%), linear-gradient(165deg, #243052 0%, #1c2541 45%, #0b132b 100%); }
.pov-bgm__card--v2 { background: linear-gradient(165deg, #ff9a62 0%, #ff6b35 38%, #a63a17 75%, #3a1a10 100%); }
.pov-bgm__card--v3 { background: radial-gradient(80% 50% at 20% 90%, rgba(255, 107, 53, 0.35), transparent 65%), linear-gradient(165deg, #3a506b 0%, #1c2541 60%, #0b132b 100%); }
.pov-bgm__card--v4 { background: linear-gradient(165deg, #1c2541 0%, #2d3a61 40%, #ff6b35 130%); }

.pov-bgm__type {
  position: absolute;
  top: 7%;
  left: 8%;
  padding: 0.2em 0.65em;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(11, 19, 43, 0.35);
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: max(8px, 6.5cqw);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pov-bgm__title {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  color: #fff;
  font-family: "Sora", "Inter", system-ui, sans-serif;
  font-size: max(11px, 11cqw);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------------
   Overlay + vignette (keep text readable)
   --------------------------------------------------------------------- */
.pov-bgm__overlay {
  position: absolute;
  inset: 0;
  background: rgb(11 19 43 / var(--bg-overlay-opacity));
}
.pov-bgm__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 115% 90% at 50% 45%, transparent 45%, rgba(11, 19, 43, 0.85) 100%),
    linear-gradient(180deg, rgba(11, 19, 43, 0.55) 0%, transparent 16%, transparent 82%, rgba(11, 19, 43, 0.8) 100%);
}

/* ---------------------------------------------------------------------
   Responsive + accessibility
   --------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .pov-bgm__row:nth-child(n + 4) { display: none; } /* 3 rows on mobile */
  .pov-bgm__wall { inset: -6vh -8vw; }
}

@media (prefers-reduced-motion: reduce) {
  .pov-bgm__track { animation: none !important; } /* static poster wall */
}
