/* FLIXBABA HIGH-PERFORMANCE NETFLIX ENGINE STYLES */
/* System font stack with zero FOIT/FOUT shift for instant First Contentful Paint */
:root {
  --netflix-red: #e50914;
  --netflix-red-hover: #b80710;
  --netflix-black: #141414;
  --netflix-dark: #000000;
  --netflix-card: #181818;
  --netflix-gray: #2d2d2d;
  --netflix-gray-hover: #414141;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background-color: var(--netflix-black);
  color: #ffffff;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Zero CLS Typography */
.brand-title {
  font-family: Impact, "Arial Black", -apple-system, sans-serif;
  letter-spacing: 2px;
  font-weight: 900;
}

/* GPU Accelerated Vignette Overlays */
.hero-vignette {
  background: linear-gradient(
    77deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    transparent 85%
  );
  transform: translateZ(0);
  will-change: opacity;
}

.hero-bottom-fade {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(20, 20, 20, 0.6) 60%,
    #141414 100%
  );
  transform: translateZ(0);
}

/* Performance: Content Visibility for Below-the-fold Sections */
.cv-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

/* Netflix Top 10 Number Typography & Responsive 7-Card Grid */
.netflix-number {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(4rem, 6.2vw, 7.2rem);
  line-height: 0.78;
  font-weight: 900;
  color: #000000;
  -webkit-text-stroke: 3.5px #595959;
  letter-spacing: -4px;
  position: absolute;
  bottom: -4px;
  left: 0;
  z-index: 10;
  pointer-events: none;
  user-select: none;
  transition: -webkit-text-stroke 0.2s ease, color 0.2s ease;
}

.netflix-number.double-digit {
  letter-spacing: -8px;
  font-size: clamp(3.2rem, 5.2vw, 6.2rem);
}

.group:hover .netflix-number {
  -webkit-text-stroke: 3.5px #ffffff;
  color: rgba(229, 9, 20, 0.35);
}

/* Responsive Top 10 Card Sizing (Exactly 7 cards fit on desktop like Netflix) */
.top10-item {
  position: relative;
  flex: 0 0 auto;
  user-select: none;
  display: block;
}

/* Large Desktop (>= 1350px): Exactly 7 items fit without clipping */
@media (min-width: 1350px) {
  .top10-item {
    width: calc((100% - 6 * 1rem) / 7);
    margin-right: 1rem;
  }
}

/* Standard Desktop / Laptop (1100px - 1349px): 6 items */
@media (min-width: 1100px) and (max-width: 1349px) {
  .top10-item {
    width: calc((100% - 5 * 1rem) / 6);
    margin-right: 1rem;
  }
}

/* Tablet Landscape (850px - 1099px): 5 items */
@media (min-width: 850px) and (max-width: 1099px) {
  .top10-item {
    width: calc((100% - 4 * 0.75rem) / 5);
    margin-right: 0.75rem;
  }
}

/* Tablet (640px - 849px): 4 items */
@media (min-width: 640px) and (max-width: 849px) {
  .top10-item {
    width: calc((100% - 3 * 0.75rem) / 4);
    margin-right: 0.75rem;
  }
}

/* Mobile (< 640px): 2.35 items for peek */
@media (max-width: 639px) {
  .top10-item {
    width: calc((100% - 1.5 * 0.5rem) / 2.35);
    margin-right: 0.5rem;
  }
}

.top10-item:last-child {
  margin-right: 0 !important;
}

/* Horizontal Scroll Rails (Hardware accelerated) */
.netflix-row-rail {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1rem 4px 1.75rem 4px;
  transform: translateZ(0);
}

.netflix-row-rail::-webkit-scrollbar {
  display: none;
}

/* Card Hover Optimizations */
.netflix-card {
  transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s ease;
  transform-origin: center center;
  transform: translateZ(0);
  contain: layout style paint;
}

.netflix-card:hover {
  transform: scale(1.06) translateY(-4px) translateZ(0);
  z-index: 30;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(229, 9, 20, 0.25);
}

/* Netflix Style FAQ Bar */
.netflix-faq-bar {
  background-color: var(--netflix-gray);
  transition: background-color 0.15s ease;
}

.netflix-faq-bar:hover {
  background-color: var(--netflix-gray-hover);
}

.netflix-faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.5, 0, 0.1, 1), padding 0.2s ease;
  contain: paint;
}

.netflix-faq-content.open {
  max-height: 400px;
}

/* Row Scroll Buttons */
.row-nav-btn {
  background: rgba(0, 0, 0, 0.65);
  transition: background 0.15s ease, opacity 0.2s ease, transform 0.15s ease;
}

.row-nav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Mobile & Touch Devices: Keep slider arrows visible, perfectly styled like flixbaba.zip */
@media (max-width: 768px) {
  .row-nav-btn {
    opacity: 0.85 !important;
    width: 32px !important;
    height: 48px !important;
    background: rgba(15, 15, 15, 0.85) !important;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    z-index: 35 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  }

  .row-nav-btn:active {
    transform: translateY(-50%) scale(0.92);
    background: rgba(229, 9, 20, 0.9) !important;
  }

  .row-nav-btn.left-0 {
    left: 4px !important;
  }

  .row-nav-btn.right-0 {
    right: 4px !important;
  }

  .row-nav-btn svg {
    width: 20px !important;
    height: 20px !important;
  }

  /* Smooth momentum touch scrolling for rails */
  .netflix-row-rail {
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0 16px;
  }

  /* Compact header on mobile to prevent overcrowding */
  .brand-title {
    font-size: 1.5rem !important;
  }
}

/* Sleek Minimal Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #141414;
}
::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #e50914;
}

/* Mobile Slide-Out Drawer Smooth Transitions */
#mobile-drawer {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
#mobile-drawer.open {
  transform: translateX(0);
}
#mobile-drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
