/* ===============================
   UPE Cinematic Motion Cards
   Auto drift + hover speeds up
   =============================== */

/* ===================================================
   OPTION A: Multi-Card Grid (Auto-Drift)
   =================================================== */

.upe-motion-card {
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(35, 31, 32, 0.1);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.1);
  transform: translateZ(0);
  transition:
    transform 0.25s ease,
    box-shadow 0.35s ease;
  position: relative;
}

.upe-motion-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 85px rgba(0, 0, 0, 0.14);
}

.upe-motion-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f6f6f6;
}

/* Base (no hover) still image */
.upe-motion-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
  will-change: transform;
}

/* Auto cinematic drift (slow) */
.upe-motion-card.is-cinematic .upe-motion-img {
  animation: upeCinematicDrift 14s cubic-bezier(0.22, 0.61, 0.36, 1) infinite
    alternate;
  transform: scale(1.06) translate3d(0, 0, 0);
}

/* Hover = speed up + more zoom + different drift */
.upe-motion-card.is-cinematic:hover .upe-motion-img {
  animation-duration: 5s; /* ✅ hover increases speed */
  transform: scale(1.14) translate3d(-2%, -1%, 0);
}

/* Drift keyframes */
@keyframes upeCinematicDrift {
  0% {
    transform: scale(1.06) translate3d(0%, 0%, 0);
  }
  100% {
    transform: scale(1.1) translate3d(-2.5%, -1.5%, 0);
  }
}

/* Warm brand overlay */
.upe-motion-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(252, 177, 86, 0.18),
    rgba(0, 0, 0, 0.18)
  );
  opacity: 0.25;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.upe-motion-card:hover .upe-motion-overlay {
  opacity: 0.55;
}

/* Shine sweep on hover */
.upe-motion-shine {
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 35%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 65%
  );
  transform: translateX(-40%);
  opacity: 0;
  pointer-events: none;
}

.upe-motion-card:hover .upe-motion-shine {
  opacity: 1;
  animation: upeShine 1.05s ease forwards;
}

@keyframes upeShine {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(40%);
  }
}

/* Plus button */
.upe-motion-plus {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  pointer-events: none;
}

.upe-plus-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(35, 31, 32, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: scale(0.96);
  transition:
    transform 0.35s ease,
    background 0.35s ease;
}

.upe-motion-card:hover .upe-plus-btn {
  transform: scale(1);
  background: rgba(255, 255, 255, 0.95);
}

.upe-plus-icon {
  font-size: 22px;
  font-weight: 700;
  color: #231f20;
}

/* ===================================================
   CUSTOMIZATION TIPS
   =================================================== */

/* To adjust auto-drift speed:
   animation: ... 14s ...
   - 18s = slower (more subtle)
   - 12s = faster (more noticeable)
*/

/* To adjust hover speed:
   animation-duration: 5s;
   - 4s = faster (more aggressive)
   - 6s = slower (more subtle)
*/

/* To adjust zoom levels:
   scale(1.06) = starting zoom (no hover)
   scale(1.10) = ending zoom (auto-drift)
   scale(1.14) = hover zoom
*/

/* ===================================================
   RESPONSIVE & ACCESSIBILITY
   =================================================== */

/* Mobile: no hover + disable auto-motion */
@media (hover: none) {
  .upe-motion-card.is-cinematic .upe-motion-img {
    animation: none;
    transform: none;
  }
  .upe-motion-shine {
    display: none;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .upe-motion-card.is-cinematic .upe-motion-img {
    animation: none;
    transform: none;
  }
  .upe-motion-shine {
    display: none;
  }
  .upe-motion-card,
  .upe-plus-btn,
  .upe-motion-overlay {
    transition: none;
  }
}

/* ===================================================
   OPTION B: Single Cinematic Card (Image Slideshow)
   Images change automatically inside ONE card
   More premium / Apple / fashion landing style
   =================================================== */

.upe-cinematic-card {
  display: block;
  width: 100%;
  max-width: 100%; /* Fill parent container */
  min-height: 300px; /* Ensure visibility */
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(35, 31, 32, 0.1);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.12);
  transform: translateZ(0);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.upe-cinematic-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.16);
}

/* Depth motion performance hints (for mouse parallax) */
.upe-cinematic-card[data-depth-card] {
  transform-style: preserve-3d;
  will-change: transform;
}

.upe-cinematic-card[data-depth-card] .upe-cinematic-img.active {
  will-change: transform;
}

/* Optional: make overlay respond better to depth motion */
.upe-cinematic-card[data-depth-card] .upe-cinematic-overlay {
  will-change: transform, opacity;
}

.upe-cinematic-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f6f6f6;
}

/* Stacked images (absolute positioning) */
.upe-cinematic-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  filter: saturate(1.05) contrast(1.05);
  will-change: opacity, transform;
  transition:
    opacity 1.2s ease,
    transform 6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Active image (visible + zooming) */
.upe-cinematic-img.active {
  opacity: 1;
  transform: scale(1.14); /* Ken Burns zoom effect */
}

/* Hover = faster & stronger zoom */
.upe-cinematic-card:hover .upe-cinematic-img.active {
  transform: scale(1.2);
  transition-duration: 3s; /* Faster zoom on hover */
}

/* Warm fashion glow overlay */
.upe-cinematic-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(252, 177, 86, 0.22),
    rgba(0, 0, 0, 0.18)
  );
  opacity: 0.8;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.upe-cinematic-card:hover .upe-cinematic-overlay {
  opacity: 1;
}

/* Plus button (always visible) */
.upe-cinematic-plus {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  pointer-events: none;
}

.upe-cinematic-card .upe-plus-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(35, 31, 32, 0.12);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 0.35s ease,
    background 0.35s ease;
}

.upe-cinematic-card:hover .upe-plus-btn {
  transform: scale(1.1) rotate(90deg);
  background: rgba(255, 255, 255, 0.95);
}

.upe-cinematic-card .upe-plus-icon {
  font-size: 22px;
  font-weight: 700;
  color: #231f20;
}

/* ===================================================
   CUSTOMIZATION TIPS (Single Card)
   =================================================== */

/* To adjust card size:
   max-width: 520px (change to 400px, 600px, 800px, etc.)
   aspect-ratio: 4/3 (change to 16/9, 1/1, etc.)
*/

/* To adjust zoom levels:
   scale(1.08) = starting zoom
   scale(1.14) = active zoom (normal)
   scale(1.20) = hover zoom
*/

/* To adjust transition speeds:
   opacity 1.2s = fade in/out speed
   transform 6s = normal zoom speed
   transition-duration: 3s (hover) = hover zoom speed
*/

/* To adjust auto-switch speed:
   In JS file: setInterval(..., 4500) [3000-6000]
   And hover: setInterval(..., 1800) [1000-2500]
*/

/* ===================================================
   RESPONSIVE & ACCESSIBILITY (Single Card)
   =================================================== */

/* Force visibility on ALL screen sizes including desktop */
.upe-cinematic-card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Desktop (1025px+) - ensure visible */
@media (min-width: 1025px) {
  .upe-cinematic-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .upe-cinematic-card {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .upe-cinematic-img {
    transition: opacity 0.3s ease;
    transform: none !important;
  }
  .upe-cinematic-card,
  .upe-cinematic-card .upe-plus-btn {
    transition: none;
  }
}
