/* FilmyBazaar — shared enhancements for all satellite pages + utilities */
:root {
  --fb-safe-top: env(safe-area-inset-top, 0px);
  --fb-safe-right: env(safe-area-inset-right, 0px);
  --fb-safe-bottom: env(safe-area-inset-bottom, 0px);
  --fb-safe-left: env(safe-area-inset-left, 0px);
  --fb-primary: #ff3d3d;
  --fb-primary-soft: #ff8e8e;
  --fb-focus: rgba(255, 142, 142, 0.95);
  --fb-bg-deep: #03050a;
}

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

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

body {
  padding-top: var(--fb-safe-top);
  padding-right: var(--fb-safe-right);
  padding-bottom: var(--fb-safe-bottom);
  padding-left: var(--fb-safe-left);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(255, 61, 61, 0.38);
  color: #fff;
}

/* Keyboard focus — visible rings without cluttering mouse clicks */
:where(
  a,
  button,
  input,
  textarea,
  select,
  summary,
  [role="button"],
  .close-btn,
  .btn,
  .submit-btn,
  .job-apply,
  .tab-btn,
  .scroll-top,
  .modal-close,
  .fb-share-toggle,
  .fb-share-link,
  .fb-splash-skip,
  .fb-load-retry-btn,
  .mobile-search-trigger,
  .hamburger-menu,
  .search-clear,
  .section-link,
  .hamburger-link,
  .hamburger-social-link,
  .hamburger-close,
  .fb-nav-apk,
  .fb-hb-apk,
  .fb-pdl,
  .fb-pc,
  .remove-wishlist,
  #fb-wa
):focus {
  outline: none;
}

:where(
  a,
  button,
  input,
  textarea,
  select,
  summary,
  [role="button"],
  .close-btn,
  .btn,
  .submit-btn,
  .job-apply,
  .tab-btn,
  .scroll-top,
  .modal-close,
  .fb-share-toggle,
  .fb-share-link,
  .fb-splash-skip,
  .fb-load-retry-btn,
  .mobile-search-trigger,
  .hamburger-menu,
  .search-clear,
  .section-link,
  .hamburger-link,
  .hamburger-social-link,
  .hamburger-close,
  .fb-nav-apk,
  .fb-hb-apk,
  .fb-pdl,
  .fb-pc,
  .remove-wishlist,
  #fb-wa
):focus-visible {
  outline: 2px solid var(--fb-focus);
  outline-offset: 3px;
}

/* Legal / marketing copy: comfortable measure */
:where(.privacy-section, .cookie-section, .terms-section) p {
  max-width: 65ch;
}

:where(.privacy-section, .cookie-section, .terms-section) code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.88em;
  padding: 0.12em 0.45em;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 107, 107, 0.28);
  color: #ffe8e8;
  word-break: break-word;
}

.legal-footer a {
  text-underline-offset: 3px;
}

.legal-footer a:hover {
  text-decoration: underline;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

/* Minimum tap targets on small screens */
@media (max-width: 768px) {
  a.close-btn,
  button:not(.password-submit):not(.toggle-password),
  .job-apply,
  .submit-btn,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .close-btn {
    top: max(16px, var(--fb-safe-top)) !important;
    right: max(16px, var(--fb-safe-right)) !important;
  }
}

/* Tables / wide legal blocks */
.fb-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

/* Mini intro overlay (non-home pages) */
.fb-mini-splash {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1a0a12 0%, #06060c 55%, #030308 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.fb-mini-splash.fb-mini-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fb-mini-splash.fb-mini-hide {
  opacity: 0 !important;
  filter: blur(8px);
  transform: scale(1.02);
  transition: opacity 0.55s ease, filter 0.55s ease, transform 0.6s ease;
}

.fb-mini-inner {
  text-align: center;
  padding: 2rem;
}

.fb-mini-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff3d3d, #ff8e8e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 0 40px rgba(255, 61, 61, 0.55);
  animation: fbMiniPulse 1.2s ease-in-out infinite alternate;
}

/* Sub-page splash: crisp mark instead of emoji (loads on every satellite page) */
.fb-mini-logo.fb-mini-logo--mark {
  font-size: 0;
  line-height: 0;
  position: relative;
}

.fb-mini-logo--mark::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #ffffff 0%, #ffc9c9 38%, #ff3d3d 100%);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.22) inset,
    0 0 0 2px rgba(255, 255, 255, 0.22);
}

@keyframes fbMiniPulse {
  from {
    transform: scale(1);
    box-shadow: 0 0 35px rgba(255, 61, 61, 0.45);
  }
  to {
    transform: scale(1.04);
    box-shadow: 0 0 55px rgba(255, 61, 61, 0.65);
  }
}

.fb-mini-title {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, #ff9e9e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.fb-mini-tag {
  margin-top: 0.35rem;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

/* Click ripple */
.fb-click-ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2147483000;
  background: radial-gradient(circle, rgba(255, 61, 61, 0.42) 0%, rgba(255, 142, 142, 0.12) 42%, transparent 68%);
  transform: translate(-50%, -50%) scale(0);
  animation: fbRippleExpand 0.68s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fbRippleExpand {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* Sub-page subtle reveal when mini splash completes */
.fb-sub-ready main,
.fb-sub-ready .content,
.fb-sub-ready .wrapper,
.fb-sub-ready .main,
.fb-sub-ready .container {
  animation: fbPgLift 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fbPgLift {
  from {
    opacity: 0.88;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fb-mini-logo {
    animation: none !important;
  }

  .fb-click-ripple {
    display: none !important;
  }

  .fb-mini-splash.fb-mini-hide {
    filter: none !important;
    transform: none !important;
  }

  .fb-sub-ready main,
  .fb-sub-ready .content,
  .fb-sub-ready .wrapper,
  .fb-sub-ready .main,
  .fb-sub-ready .container {
    animation: none !important;
  }

  .floating,
  .floating-dust,
  .hero-backdrop {
    animation: none !important;
  }

  .privacy-section:hover,
  .cookie-section:hover,
  .terms-section:hover,
  .form-card:hover {
    transform: none !important;
  }

  .feature-card:hover,
  .creator-card:hover,
  .poster-item:hover,
  .stat-item:hover {
    transform: none !important;
  }
}

/* Legal / cookie tables — stack on narrow phones */
@media (max-width: 640px) {
  .storage-table {
    grid-template-columns: 1fr !important;
    gap: 0.5rem 0 !important;
  }
}

/* Prevent horizontal bleed on very small devices */
@media (max-width: 380px) {
  .wrapper,
  .main {
    padding-left: max(1rem, var(--fb-safe-left)) !important;
    padding-right: max(1rem, var(--fb-safe-right)) !important;
  }
}
