/**
 * FilmyBazaar Premium Streaming UI
 * OTT-inspired dark theme · glassmorphism · cinematic motion
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@400;500;600;700;800&display=swap');

:root,
body.fb-premium {
  --fb-black: #0a0a0a;
  --fb-gray: #121212;
  --fb-surface: #1a1a1a;
  --fb-surface-hover: #222222;
  --fb-red: #e50914;
  --fb-red-dim: #b20710;
  --fb-red-glow: rgba(229, 9, 20, 0.45);
  --fb-blue: #00c8ff;
  --fb-blue-glow: rgba(0, 200, 255, 0.35);
  --fb-gold: #ffd700;
  --fb-purple: #8a2be2;
  --fb-white: #ffffff;
  --fb-muted: #a3a3a3;
  --fb-muted-dim: #6b6b6b;
  --fb-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fb-ease-out: cubic-bezier(0.34, 1.2, 0.64, 1);
  --fb-dur-fast: 0.2s;
  --fb-dur: 0.3s;
  --fb-dur-slow: 0.4s;
  --fb-radius: 14px;
  --fb-radius-lg: 20px;
  --fb-glass: rgba(18, 18, 18, 0.72);
  --fb-glass-border: rgba(255, 255, 255, 0.08);
  --fb-shadow-card: 0 12px 40px rgba(0, 0, 0, 0.55);
  --fb-shadow-glow: 0 0 32px var(--fb-red-glow);

  /* Legacy aliases — keeps app.js inline styles working */
  --primary: var(--fb-red);
  --primary-dark: var(--fb-red-dim);
  --primary-light: #ff4d4d;
  --secondary: var(--fb-gray);
  --surface: var(--fb-surface);
  --background: var(--fb-black);
  --text: var(--fb-white);
  --text-secondary: #c8c8c8;
  --text-muted: var(--fb-muted-dim);
  --accent: var(--fb-gold);
  --error: #ff4757;
  --success: var(--fb-blue);
  --warning: #ffa502;
  --star: var(--fb-gold);
  --overlay: rgba(0, 0, 0, 0.88);
  --gradient: linear-gradient(135deg, var(--fb-red) 0%, #ff4d4d 50%, #ff6b6b 100%);
  --shadow: var(--fb-shadow-card);
  --shadow-hover: 0 20px 50px rgba(229, 9, 20, 0.25);
  --transition: all var(--fb-dur) var(--fb-ease);
}

body.fb-premium {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--fb-black);
  color: var(--fb-white);
}

body.fb-premium::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(229, 9, 20, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(0, 200, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 70% 20%, rgba(138, 43, 226, 0.06) 0%, transparent 45%);
}

body.fb-premium .fb-site-chrome {
  position: relative;
  z-index: 1000;
}

body.fb-premium main.main,
body.fb-premium .footer,
body.fb-premium .fb-traffic-hub {
  position: relative;
  z-index: 1;
}

/* Typography */
body.fb-premium h1,
body.fb-premium h2,
body.fb-premium .section-title,
body.fb-premium .hero-title,
body.fb-premium .fb-traffic-hub h1 {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.fb-premium .movie-title,
body.fb-premium .modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* Ambient particles */
.fb-premium-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fb-premium-ambient span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--fb-red);
  opacity: 0;
  animation: fbAmbientFloat 12s ease-in-out infinite;
  box-shadow: 0 0 12px var(--fb-red-glow);
}

.fb-premium-ambient span:nth-child(odd) {
  background: var(--fb-blue);
  box-shadow: 0 0 10px var(--fb-blue-glow);
}

@keyframes fbAmbientFloat {
  0%, 100% { opacity: 0; transform: translateY(100vh) scale(0); }
  8% { opacity: 0.7; }
  50% { opacity: 0.35; transform: translateY(40vh) scale(1); }
  92% { opacity: 0; }
}

/* Sticky glass navbar */
body.fb-premium .header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: transparent;
  transition: background var(--fb-dur) var(--fb-ease), box-shadow var(--fb-dur) var(--fb-ease);
}

body.fb-premium .header.fb-nav-scrolled {
  background: var(--fb-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--fb-glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

body.fb-premium .header-container {
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
}

body.fb-premium .nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  transition: transform var(--fb-dur-fast) var(--fb-ease), background var(--fb-dur) var(--fb-ease), color var(--fb-dur) var(--fb-ease);
}

body.fb-premium .nav-link:hover {
  background: rgba(229, 9, 20, 0.12);
}

body.fb-premium .nav-link.active {
  background: var(--gradient);
  box-shadow: 0 4px 20px var(--fb-red-glow);
}

body.fb-premium .fb-nav-apk {
  display: none !important;
}

body.fb-premium .fb-header-apk-btn,
body.fb-premium #fbHeaderApkBtn {
  background: linear-gradient(135deg, #ffe066, #ffc107 48%, #ffb300) !important;
  background-size: 200% 200% !important;
  color: #1a1400 !important;
  border: 1px solid rgba(255, 215, 0, 0.55) !important;
  animation: fbApkBtnPulse 2s ease-in-out infinite, fbApkBtnGrad 3.5s ease infinite !important;
  box-shadow: 0 4px 18px rgba(255, 193, 7, 0.45) !important;
}

body.fb-premium .search-container input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--fb-glass-border);
  font-family: 'Inter', sans-serif;
}

body.fb-premium .search-container input:focus {
  border-color: rgba(0, 200, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.12);
}

body.fb-premium .search-results,
body.fb-premium .search-suggestions {
  background: var(--fb-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--fb-glass-border);
}

/* Filter stack glass */
body.fb-premium .fb-filter-stack,
body.fb-premium .region-filter,
body.fb-premium .fb-mood-filter {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--fb-glass-border);
}

body.fb-premium .region-item.active,
body.fb-premium .genre-item.active,
body.fb-premium .fb-mood-chip.active {
  background: var(--gradient);
  box-shadow: 0 4px 16px var(--fb-red-glow);
}

/* Hero — see premium-hero.css (fb-hero-pro) */

body.fb-premium .btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  transition: transform var(--fb-dur-fast) var(--fb-ease-out), box-shadow var(--fb-dur) var(--fb-ease), background var(--fb-dur) var(--fb-ease);
  position: relative;
  overflow: hidden;
}

body.fb-premium .btn-primary {
  background: var(--gradient);
  box-shadow: 0 8px 28px var(--fb-red-glow);
}

body.fb-premium .btn-primary::after,
body.fb-premium .fb-btn-download::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.2) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--fb-ease);
}

body.fb-premium .btn-primary:hover::after,
body.fb-premium .fb-btn-download:hover::after {
  transform: translateX(120%);
}

body.fb-premium .fb-btn-download {
  background: linear-gradient(135deg, var(--fb-blue), #0077aa);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px var(--fb-blue-glow);
}

body.fb-premium .btn-secondary {
  background: var(--fb-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--fb-glass-border);
}

body.fb-premium .btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
}


/* Section rails */
body.fb-premium .section {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem);
}

body.fb-premium .section-title i {
  color: var(--fb-red);
  filter: drop-shadow(0 0 8px var(--fb-red-glow));
}

body.fb-premium .section-link:hover {
  color: var(--fb-blue);
}

body.fb-premium .fb-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--fb-red), var(--fb-purple));
  color: #fff;
  vertical-align: middle;
}

body.fb-premium .slider {
  grid-auto-columns: min(200px, 42vw);
  gap: 1.15rem;
  scroll-snap-type: x mandatory;
  padding-bottom: 1.75rem;
}

body.fb-premium .slider > .movie-card {
  scroll-snap-align: start;
}

body.fb-premium .slider.fb-slider-auto {
  scroll-behavior: smooth;
}

/* Premium movie cards — 3D hover */
body.fb-premium .movie-card {
  background: var(--fb-surface);
  border-radius: var(--fb-radius);
  border: 1px solid var(--fb-glass-border);
  box-shadow: var(--fb-shadow-card);
  transform-style: preserve-3d;
  perspective: 800px;
  transition:
    transform var(--fb-dur) var(--fb-ease-out),
    box-shadow var(--fb-dur) var(--fb-ease),
    border-color var(--fb-dur) var(--fb-ease);
}

body.fb-premium .movie-card:hover {
  transform: translateY(-8px) scale(1.05) rotateX(2deg);
  border-color: rgba(229, 9, 20, 0.55);
  box-shadow: var(--fb-shadow-glow), var(--fb-shadow-card);
  z-index: 12;
}

body.fb-premium .movie-poster {
  height: 280px;
  border-radius: var(--fb-radius) var(--fb-radius) 0 0;
}

body.fb-premium .movie-card:hover .movie-poster {
  transform: scale(1.08);
}

body.fb-premium .movie-info {
  transform: translateY(0);
  background: linear-gradient(to top, rgba(10, 10, 10, 0.98) 0%, rgba(10, 10, 10, 0.4) 70%, transparent);
  padding: 2.5rem 0.85rem 0.85rem;
}

body.fb-premium .movie-rating {
  top: auto;
  bottom: 10px;
  right: 10px;
  background: rgba(10, 10, 10, 0.85);
  border-color: rgba(255, 215, 0, 0.4);
  color: var(--fb-gold);
}

body.fb-premium .movie-rating i {
  color: var(--fb-gold) !important;
}

/* Instant play overlay */
body.fb-premium .fb-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.45);
  opacity: 0;
  transition: opacity var(--fb-dur) var(--fb-ease);
  z-index: 6;
  pointer-events: none;
  border: none;
  cursor: pointer;
}

body.fb-premium .fb-card-play i {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.1rem;
  padding-left: 4px;
  box-shadow: 0 8px 28px var(--fb-red-glow);
  transform: scale(0.85);
  transition: transform var(--fb-dur) var(--fb-ease-out);
}

body.fb-premium .movie-card:hover .fb-card-play {
  opacity: 1;
}

body.fb-premium .movie-card:hover .fb-card-play i {
  transform: scale(1);
}

body.fb-premium .fb-quality-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  z-index: 15;
  padding: 0.2rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--fb-blue), #0066aa);
  color: #fff;
  box-shadow: 0 2px 10px var(--fb-blue-glow);
  pointer-events: none;
}

body.fb-premium .fb-quality-badge.is-4k {
  background: linear-gradient(135deg, var(--fb-gold), #cc9900);
  color: #111;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

/* Continue watching progress */
body.fb-premium .continue-card .movie-info {
  transform: translateY(0);
}

body.fb-premium .continue-card .fb-continue-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  margin-top: 0.5rem;
  overflow: hidden;
}

body.fb-premium .continue-card .fb-continue-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 4px;
  transition: width var(--fb-dur-slow) var(--fb-ease);
}

/* Skeleton loading */
body.fb-premium .fb-skeleton-card {
  border-radius: var(--fb-radius);
  background: linear-gradient(
    90deg,
    var(--fb-surface) 0%,
    #2a2a2a 50%,
    var(--fb-surface) 100%
  );
  background-size: 200% 100%;
  animation: fbSkeletonShimmer 1.2s ease-in-out infinite;
  min-height: 280px;
}

@keyframes fbSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Top rated IMDb style */
body.fb-premium .fb-imdb-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: #f5c518;
  color: #111;
  font-weight: 800;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
}

body.fb-premium .fb-imdb-rating span {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
}

/* AI section glass panel */
body.fb-premium .fb-ai-panel {
  background: var(--fb-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--fb-glass-border);
  border-radius: var(--fb-radius-lg);
}

/* Load more — cleaner premium */
body.fb-premium .fb-loadmore-btn {
  animation: fbLoadMoreFloat 3s ease-in-out infinite !important;
  background: var(--gradient) !important;
  box-shadow: 0 12px 40px var(--fb-red-glow) !important;
}

body.fb-premium .fb-loadmore-aurora {
  background: radial-gradient(ellipse at center, rgba(229, 9, 20, 0.3) 0%, transparent 68%) !important;
}

/* Premium footer */
body.fb-premium .footer.fb-premium-footer {
  background: linear-gradient(180deg, transparent 0%, var(--fb-gray) 24%, var(--fb-black) 100%);
  padding: 3.5rem clamp(1rem, 4vw, 2.5rem) 1.5rem;
  text-align: left;
}

body.fb-premium .fb-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem 2.5rem;
  max-width: 1200px;
  margin: 0 auto 2.5rem;
}

body.fb-premium .fb-footer-col h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fb-muted);
  margin-bottom: 1rem;
}

body.fb-premium .fb-footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  transition: color var(--fb-dur-fast) var(--fb-ease), transform var(--fb-dur-fast) var(--fb-ease);
}

body.fb-premium .fb-footer-col a:hover {
  color: var(--fb-white);
  transform: translateX(4px);
}

body.fb-premium .fb-footer-col a.fb-footer-tg i {
  color: var(--fb-blue);
  margin-right: 0.4rem;
}

body.fb-premium .fb-footer-social {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

body.fb-premium .fb-footer-social a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--fb-glass);
  border: 1px solid var(--fb-glass-border);
  padding: 0;
  transform: none;
}

body.fb-premium .fb-footer-social a:hover {
  background: var(--fb-red);
  border-color: var(--fb-red);
  transform: translateY(-3px);
}

body.fb-premium .footer-bottom {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--fb-glass-border);
}

/* Brand logo premium colors */
body.fb-premium .fb-brand-logo > i,
body.fb-premium .logo > i.fa-film {
  color: var(--fb-red) !important;
  filter: drop-shadow(0 0 10px var(--fb-red-glow));
}

body.fb-premium .fb-brand-bazaar {
  background: linear-gradient(
    120deg,
    var(--fb-red) 0%,
    #ff4d4d 25%,
    var(--fb-gold) 50%,
    var(--fb-blue) 75%,
    var(--fb-red) 100%
  ) !important;
  background-size: 220% auto !important;
}

/* Hamburger glass */
body.fb-premium .hamburger-panel {
  background: linear-gradient(165deg, rgba(26, 26, 26, 0.98), rgba(10, 10, 10, 0.99));
  border-left-color: rgba(229, 9, 20, 0.35);
}

body.fb-premium .hamburger-menu {
  background: var(--gradient);
}

/* Modals glass */
body.fb-premium .modal-container {
  background: var(--fb-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--fb-glass-border);
}

/* Traffic / SEO blocks */
body.fb-premium .fb-traffic-card {
  background: var(--fb-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--fb-glass-border);
  border-radius: var(--fb-radius);
}

body.fb-premium .scroll-top {
  background: var(--gradient);
  box-shadow: 0 8px 24px var(--fb-red-glow);
}

/* APK popup aligned */
body.fb-premium #fb-apk-popup .fb-pdl {
  background: linear-gradient(135deg, var(--fb-blue), #0077aa) !important;
}

@media (max-width: 768px) {
  body.fb-premium .movie-poster {
    height: 220px;
  }
}

/* Hero meta chips (runtime / rating) */
body.fb-premium .fb-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

body.fb-premium .fb-hero-meta span {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--fb-glass-border);
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  body.fb-premium .fb-premium-ambient,
  body.fb-premium .fb-premium-ambient span {
    display: none !important;
  }

  body.fb-premium .movie-card:hover {
    transform: translateY(-4px) scale(1.02);
  }

}
