/**
 * FilmyBazaar — Advanced cinematic hero (all devices)
 */

body.fb-premium .hero.fb-hero-pro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
  grid-template-rows: 1fr;
  align-items: stretch;
  width: calc(100% - clamp(1rem, 4vw, 2.5rem));
  max-width: 1760px;
  min-height: clamp(380px, 52vh, 580px);
  height: auto;
  margin: clamp(0.5rem, 2vw, 1rem) auto clamp(0.75rem, 2vw, 1.25rem);
  border-radius: clamp(16px, 2.5vw, 24px);
  overflow: hidden;
  isolation: isolate;
  background: #060608;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 80px rgba(229, 9, 20, 0.08);
  transition: opacity 0.45s var(--fb-ease, ease), filter 0.45s ease;
}

body.fb-premium .hero.fb-hero-pro.fade-out {
  opacity: 0.35;
  filter: blur(4px) saturate(0.85);
}

/* Ambient layers */
.fb-hero-aurora {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 12% 20%, rgba(229, 9, 20, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 88% 75%, rgba(0, 200, 255, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 60% 10%, rgba(138, 43, 226, 0.1) 0%, transparent 45%);
  animation: fbHeroAurora 14s ease-in-out infinite alternate;
}

.fb-hero-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.fb-hero-edge-glow {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.35);
}

@keyframes fbHeroAurora {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.03); }
}

/* Backdrop — cover + Ken Burns */
body.fb-premium .hero.fb-hero-pro .hero-backdrop {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  min-height: clamp(320px, 48vh, 560px);
  overflow: hidden;
  background: #0a0a0c;
}

.fb-hero-backdrop-img {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: cover;
  object-position: center 25%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.65s var(--fb-ease, ease), transform 1.2s var(--fb-ease, ease);
  will-change: transform, opacity;
}

.fb-hero-backdrop-img.is-visible {
  opacity: 1;
  animation: fbHeroKenBurns 18s var(--fb-ease, ease) forwards;
}

@keyframes fbHeroKenBurns {
  0% { transform: scale(1.06) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}

body.fb-premium .hero.fb-hero-pro .hero-backdrop.fade-out .fb-hero-backdrop-img.is-visible {
  opacity: 0;
  animation: none;
}

body.fb-premium .hero.fb-hero-pro:hover .fb-hero-backdrop-img.is-visible {
  filter: brightness(1.06) saturate(1.08);
}

body.fb-premium .hero.fb-hero-pro.fb-hero-trailer-hint .fb-hero-backdrop-img.is-visible {
  filter: brightness(1.1) saturate(1.15);
}

/* Vignette overlay */
body.fb-premium .hero.fb-hero-pro .hero-overlay,
body.fb-premium .hero.fb-hero-pro .fb-hero-vignette {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 6, 8, 0.98) 0%, rgba(8, 8, 12, 0.88) 32%, rgba(10, 10, 14, 0.25) 52%, transparent 68%),
    linear-gradient(0deg, rgba(6, 6, 8, 0.85) 0%, transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 28%);
}

/* Content panel */
body.fb-premium .hero.fb-hero-pro .hero-content {
  grid-column: 1;
  grid-row: 1;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  margin: 0;
  max-width: none;
  padding: clamp(1.15rem, 3vw, 2rem) clamp(1rem, 2.5vw, 1.75rem);
  background: linear-gradient(135deg, rgba(8, 8, 10, 0.94) 0%, rgba(14, 12, 20, 0.78) 100%);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
}

.fb-hero-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

body.fb-premium .hero.fb-hero-pro .hero-badge {
  margin: 0;
  padding: 0.32rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, var(--fb-red, #e50914), #ff4d4d 50%, var(--fb-purple, #8a2be2));
  box-shadow: 0 4px 18px rgba(229, 9, 20, 0.4);
}

.fb-hero-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.fb-hero-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4757;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.8);
  animation: fbHeroLivePulse 1.8s ease-in-out infinite;
}

@keyframes fbHeroLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.fb-hero-main {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.fb-hero-copy {
  flex: 1;
  min-width: 0;
}

body.fb-premium .hero.fb-hero-pro .hero-title {
  font-size: clamp(1.45rem, 3.2vw, 2.35rem) !important;
  line-height: 1.1 !important;
  margin-bottom: 0.55rem !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.75);
  transition: opacity 0.35s ease, transform 0.45s var(--fb-ease, ease);
}

body.fb-premium .hero.fb-hero-pro .hero-title.fade-out {
  opacity: 0;
  transform: translateY(12px);
}

.fb-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  transition: opacity 0.35s ease;
}

.fb-hero-meta.fade-out {
  opacity: 0;
}

.fb-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fb-hero-meta-rating {
  background: rgba(245, 197, 24, 0.2) !important;
  border-color: rgba(245, 197, 24, 0.35) !important;
  color: #ffd700 !important;
}

.fb-hero-meta-rating i {
  font-size: 0.65rem;
}

.fb-hero-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
  transition: opacity 0.35s ease;
}

.fb-hero-genres.fade-out {
  opacity: 0;
}

.fb-hero-genre-chip {
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.28);
}

body.fb-premium .hero.fb-hero-pro .hero-description {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(0.82rem, 1.6vw, 0.95rem) !important;
  line-height: 1.55 !important;
  color: rgba(220, 220, 225, 0.92) !important;
  max-width: 48ch;
  margin-bottom: 1rem !important;
  -webkit-line-clamp: 3;
  transition: opacity 0.35s ease, transform 0.45s ease;
}

body.fb-premium .hero.fb-hero-pro .hero-description.fade-out {
  opacity: 0;
  transform: translateY(8px);
}

body.fb-premium .hero.fb-hero-pro .hero-actions,
body.fb-premium .hero.fb-hero-pro .hero-buttons {
  gap: 0.5rem;
  transition: opacity 0.35s ease;
}

body.fb-premium .hero.fb-hero-pro .hero-actions.fade-out,
body.fb-premium .hero.fb-hero-pro .hero-buttons.fade-out {
  opacity: 0;
}

body.fb-premium .hero.fb-hero-pro .hero-actions .btn-primary {
  padding: 0.65rem 1.35rem !important;
  font-size: 0.88rem !important;
  box-shadow: 0 10px 32px rgba(229, 9, 20, 0.45);
}

body.fb-premium .hero.fb-hero-pro .fb-hero-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.15rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

/* Floating poster card (desktop / tablet) */
.fb-hero-poster-card {
  flex-shrink: 0;
  position: relative;
  width: clamp(88px, 12vw, 128px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: perspective(600px) rotateY(-6deg) translateY(4px);
  transition: transform 0.4s var(--fb-ease, ease), opacity 0.35s ease;
}

.fb-hero-poster-card.fade-out {
  opacity: 0;
}

.fb-hero-poster-card img {
  display: block;
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}

.fb-hero-poster-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  animation: fbHeroPosterShine 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fbHeroPosterShine {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

/* Controls + progress */
.fb-hero-controls {
  position: absolute;
  bottom: clamp(0.75rem, 2vw, 1.15rem);
  right: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fb-hero-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.fb-hero-nav:hover {
  background: var(--fb-red, #e50914);
  border-color: var(--fb-red, #e50914);
  transform: scale(1.06);
}

.fb-hero-dots {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fb-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.fb-hero-dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fb-red, #e50914), #ff6b6b);
}

.fb-hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9;
  background: rgba(255, 255, 255, 0.08);
}

.fb-hero-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fb-red, #e50914), var(--fb-blue, #00c8ff));
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
  transition: width 0.1s linear;
}

.fb-hero-progress.is-animating > span {
  animation: fbHeroProgressFill var(--fb-hero-interval, 12s) linear forwards;
}

@keyframes fbHeroProgressFill {
  from { width: 0%; }
  to { width: 100%; }
}

/* Tablet */
@media (max-width: 1024px) {
  body.fb-premium .hero.fb-hero-pro {
    grid-template-columns: minmax(240px, 48%) 1fr;
    min-height: clamp(340px, 46vh, 480px);
  }

  .fb-hero-poster-card {
    width: 96px;
  }
}

/* Mobile — stacked cinematic */
@media (max-width: 768px) {
  body.fb-premium .hero.fb-hero-pro {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    width: calc(100% - 1.25rem);
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 18px;
  }

  body.fb-premium .hero.fb-hero-pro .hero-backdrop {
    order: 1;
    grid-column: auto !important;
    width: 100%;
    min-height: clamp(220px, 56vw, 300px) !important;
    flex-shrink: 0;
  }

  .fb-hero-backdrop-img {
    object-position: center center;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  body.fb-premium .hero.fb-hero-pro .hero-overlay,
  body.fb-premium .hero.fb-hero-pro .fb-hero-vignette {
    order: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: clamp(220px, 56vw, 300px);
    grid-column: auto !important;
    background:
      linear-gradient(0deg, rgba(6, 6, 8, 0.95) 0%, rgba(6, 6, 8, 0.2) 45%, transparent 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 35%);
  }

  body.fb-premium .hero.fb-hero-pro .hero-content {
    order: 2;
    grid-column: auto !important;
    text-align: center;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 1rem 3.25rem !important;
    background: linear-gradient(180deg, rgba(8, 8, 10, 0.98) 0%, rgba(6, 6, 8, 1) 100%);
  }

  .fb-hero-topline {
    justify-content: center;
  }

  .fb-hero-main {
    flex-direction: column;
    align-items: center;
  }

  .fb-hero-copy {
    width: 100%;
  }

  body.fb-premium .hero.fb-hero-pro .hero-description {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .fb-hero-meta,
  .fb-hero-genres {
    justify-content: center;
  }

  body.fb-premium .hero.fb-hero-pro .hero-actions,
  body.fb-premium .hero.fb-hero-pro .hero-buttons {
    justify-content: center;
  }

  .fb-hero-poster-card {
    display: none !important;
  }

  .fb-hero-mobile-poster {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .fb-hero-mobile-poster img {
    width: 56px;
    height: 84px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .fb-hero-controls {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 0.65rem;
  }

  .fb-hero-nav {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

@media (min-width: 769px) {
  .fb-hero-mobile-poster {
    display: none !important;
  }
}

/* Small phones */
@media (max-width: 380px) {
  body.fb-premium .hero.fb-hero-pro .hero-actions .btn,
  body.fb-premium .hero.fb-hero-pro .hero-buttons .btn {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
    min-width: calc(50% - 0.25rem);
  }

  body.fb-premium .hero.fb-hero-pro .hero-actions .btn-outline,
  body.fb-premium .hero.fb-hero-pro .hero-buttons .btn-outline {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-hero-aurora,
  .fb-hero-live-dot,
  .fb-hero-poster-shine {
    animation: none !important;
  }

  .fb-hero-backdrop-img.is-visible {
    animation: none !important;
    transform: scale(1) !important;
  }

  .fb-hero-progress.is-animating > span {
    animation: none !important;
    width: 100% !important;
  }
}
