/**
 * FilmyBazaar Desktop Pages — detail, server, player, loading (768px+)
 */
@media (min-width: 768px) {
  /* ─── Page scroll progress (top bar) ─── */
  html.fb-desktop-ott #fbPageScrollProgress {
    position: fixed;
    top: 64px;
    left: 72px;
    right: 0;
    height: 3px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
  }

  html.fb-desktop-ott #fbPageScrollProgress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #e50914, #ff6b6b);
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
    transition: width 0.08s linear;
  }

  html.fb-sidebar-collapsed.fb-desktop-ott #fbPageScrollProgress,
  html.fb-mockup-ui.fb-desktop-ott #fbPageScrollProgress {
    left: 72px;
  }

  /* ─── Desktop splash — minimal cinema black ─── */
  html.fb-desktop-ott #loadingScreen.fb-splash-minimal {
    background: #020202 !important;
  }

  html.fb-desktop-ott #loadingScreen.fb-splash-minimal .fb-splash-bg {
    background: radial-gradient(ellipse at 50% 40%, #0a0a0a 0%, #020202 70%) !important;
  }

  html.fb-desktop-ott #loadingScreen.fb-splash-minimal .fb-splash-bg::after {
    background: radial-gradient(ellipse at 50% 50%, rgba(229, 9, 20, 0.12) 0%, transparent 65%) !important;
  }

  html.fb-desktop-ott #loadingScreen .fb-splash-film,
  html.fb-desktop-ott #loadingScreen .fb-splash-scanlines,
  html.fb-desktop-ott #loadingScreen .fb-splash-vignette {
    display: none !important;
  }

  html.fb-desktop-ott #loadingScreen .fb-splash-icon {
    background: #e50914 !important;
    box-shadow: 0 0 40px rgba(229, 9, 20, 0.45) !important;
    border-radius: 12px !important;
  }

  html.fb-desktop-ott #loadingScreen .fb-splash-progress {
    background: linear-gradient(90deg, #e50914, #b8070f) !important;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5) !important;
  }

  html.fb-desktop-ott #loadingScreen .fb-splash-title .fb-brand-filmy {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
  }

  html.fb-desktop-ott #loadingScreen .fb-splash-title .fb-brand-bazaar {
    color: #e50914 !important;
    -webkit-text-fill-color: #e50914 !important;
    background: none !important;
  }

  /* ─── Detail modal — cinematic ─── */
  html.fb-desktop-ott #movieModal {
    z-index: 3000;
  }

  html.fb-desktop-ott #movieModal.show {
    display: block;
  }

  html.fb-desktop-ott #movieModal .modal-overlay {
    background: rgba(2, 2, 2, 0.88) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  html.fb-desktop-ott #movieModal.fb-dm-fullpage:not(.fb-dm-open) .modal-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html.fb-desktop-ott #movieModal:not(.fb-dm-open) .modal-container {
    max-width: min(1100px, 94vw) !important;
    width: 94% !important;
    margin: 2vh auto !important;
    max-height: 94vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #050505 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.9) !important;
  }

  html.fb-desktop-ott #movieModal .modal-close {
    top: 1rem !important;
    right: 1rem !important;
    width: 42px !important;
    height: 42px !important;
    z-index: 30 !important;
    background: rgba(0, 0, 0, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    color: #fff !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  html.fb-desktop-ott #movieModal .modal-close:hover {
    background: rgba(229, 9, 20, 0.85) !important;
    transform: scale(1.06);
  }

  html.fb-desktop-ott #movieModal:not(.fb-dm-open) .modal-content {
    padding: 0 !important;
    max-height: 94vh;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  html.fb-desktop-ott #movieModal .fb-detail-cinematic {
    display: flex;
    flex-direction: column;
  }

  html.fb-desktop-ott #movieModal .fb-detail-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
  }

  html.fb-desktop-ott #movieModal .fb-detail-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    filter: brightness(0.42) saturate(1.1);
  }

  html.fb-desktop-ott #movieModal .fb-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(0deg, #050505 0%, rgba(5, 5, 5, 0.4) 50%, transparent 100%),
      linear-gradient(90deg, rgba(5, 5, 5, 0.95) 0%, rgba(5, 5, 5, 0.5) 45%, transparent 100%);
  }

  html.fb-desktop-ott #movieModal .fb-detail-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 1.5rem;
    padding: 2rem clamp(1.5rem, 3vw, 2.5rem) 2rem;
    width: 100%;
    align-items: end;
  }

  html.fb-desktop-ott #movieModal .fb-detail-poster-wrap img,
  html.fb-desktop-ott #movieModal .movie-detail-poster {
    width: 100% !important;
    height: auto !important;
    max-height: 252px !important;
    border-radius: 10px !important;
    object-fit: cover !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
    margin: 0 !important;
  }

  html.fb-desktop-ott #movieModal .fb-detail-hero-copy h2,
  html.fb-desktop-ott #movieModal .movie-detail-info > h2 {
    font-family: 'Bebas Neue', Impact, sans-serif !important;
    font-size: clamp(2rem, 4vw, 3.25rem) !important;
    font-weight: 400 !important;
    letter-spacing: 0.03em !important;
    line-height: 1 !important;
    text-transform: uppercase;
    color: #fff !important;
    margin: 0 0 0.65rem !important;
  }

  html.fb-desktop-ott #movieModal .movie-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem 1rem !important;
    color: #b3b3b3 !important;
    font-size: 0.875rem !important;
    margin: 0.5rem 0 !important;
  }

  html.fb-desktop-ott #movieModal .movie-meta span:has(.fa-star) {
    color: #46d369 !important;
    font-weight: 700;
  }

  html.fb-desktop-ott #movieModal .movie-genres {
    margin: 0.65rem 0 !important;
  }

  html.fb-desktop-ott #movieModal .genre-tag {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    font-size: 0.78rem !important;
    padding: 0.25rem 0.65rem !important;
  }

  html.fb-desktop-ott #movieModal .fb-detail-body {
    padding: 0 clamp(1.5rem, 3vw, 2.5rem) 2rem;
  }

  html.fb-desktop-ott #movieModal .movie-description {
    color: #b3b3b3 !important;
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    margin: 0 0 1.25rem !important;
  }

  html.fb-desktop-ott #movieModal .fb-detail-actions-row,
  html.fb-desktop-ott #movieModal .movie-detail-info > div[style*="display: flex"] {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.65rem !important;
    margin: 1rem 0 1.25rem !important;
  }

  html.fb-desktop-ott #movieModal #watchNowDetailBtn {
    background: #e50914 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.7rem 1.5rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
  }

  html.fb-desktop-ott #movieModal #wishlistDetailBtn,
  html.fb-desktop-ott #movieModal #trailerDetailBtn {
    background: rgba(109, 109, 110, 0.7) !important;
    border: none !important;
    border-radius: 6px !important;
    color: #fff !important;
  }

  html.fb-desktop-ott #movieModal .cast-section {
    padding: 0 clamp(1.5rem, 3vw, 2.5rem) 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
  }

  html.fb-desktop-ott #movieModal .cast-section h3 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    color: #fff !important;
  }

  html.fb-desktop-ott #movieModal .cast-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 1rem !important;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  html.fb-desktop-ott #movieModal .cast-item {
    flex: 0 0 100px;
    text-align: center;
  }

  html.fb-desktop-ott #movieModal .cast-image {
    width: 88px !important;
    height: 88px !important;
    border: 2px solid rgba(255, 255, 255, 0.12) !important;
  }

  html.fb-desktop-ott #movieModal .fb-detail-episode {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  html.fb-desktop-ott #movieModal .fb-detail-episode select {
    background: #141414 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    color: #fff !important;
    padding: 0.65rem !important;
  }

  html.fb-desktop-ott #movieModal .fb-detail-skeleton {
    padding: 2rem;
  }

  html.fb-desktop-ott #movieModal .fb-detail-skeleton .fb-sk-hero {
    height: 280px;
    border-radius: 0;
    margin: -2rem -2rem 1.5rem;
    background: linear-gradient(90deg, #111 0%, #1a1a1a 50%, #111 100%);
    background-size: 1000px 100%;
    animation: fbDesktopShimmer 1.8s infinite linear;
  }

  html.fb-desktop-ott #movieModal .fb-detail-skeleton .fb-sk-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #111 0%, #1a1a1a 50%, #111 100%);
    background-size: 1000px 100%;
    animation: fbDesktopShimmer 1.8s infinite linear;
  }

  @keyframes fbDesktopShimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
  }

  /* ─── Server selection modal ─── */
  html.fb-desktop-ott #serverSelectionModal.fb-server-modal-open {
    display: block !important;
    z-index: 3100;
  }

  html.fb-desktop-ott #serverSelectionModal .modal-overlay {
    background: rgba(2, 2, 2, 0.92) !important;
    backdrop-filter: blur(16px);
  }

  html.fb-desktop-ott #serverSelectionModal .modal-container,
  html.fb-desktop-ott #serverSelectionModal > .modal-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 85vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  html.fb-desktop-ott #serverSelectionModal.fb-server-clean .modal-container,
  html.fb-desktop-ott #serverSelectionModal.fb-server-clean > .modal-container {
    width: min(340px, 92vw) !important;
    max-width: 340px !important;
    background: rgba(22, 22, 24, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 24px 64px rgba(0, 0, 0, 0.55) !important;
  }

  html.fb-desktop-ott #serverSelectionModal.fb-server-clean #serverSelectionContent {
    padding: 1.35rem 1.1rem 1.1rem !important;
  }

  html.fb-desktop-ott #serverSelectionModal.fb-server-clean .modal-overlay {
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(14px);
  }

  html.fb-desktop-ott #serverSelectionModal .fb-server-head {
    padding: 1.5rem 1.5rem 1rem !important;
    text-align: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
  }

  html.fb-desktop-ott #serverSelectionModal .fb-server-head h2 {
    color: #fff !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
  }

  html.fb-desktop-ott #serverSelectionModal .fb-server-head p {
    color: #808080 !important;
    font-size: 0.875rem !important;
    margin: 0.4rem 0 0 !important;
  }

  html.fb-desktop-ott #serverSelectionModal #serverSelectionContent {
    padding: 1.25rem 1.5rem !important;
    overflow-y: auto !important;
    flex: 1 !important;
  }

  html.fb-desktop-ott #serverSelectionModal .server-option {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease !important;
  }

  html.fb-desktop-ott #serverSelectionModal .server-option:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(229, 9, 20, 0.5) !important;
    background: rgba(229, 9, 20, 0.08) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
  }

  html.fb-desktop-ott #serverSelectionModal .fb-server-foot {
    padding: 1rem 1.5rem 1.25rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    text-align: center !important;
    background: transparent !important;
  }

  html.fb-desktop-ott #serverSelectionModal #closeServerModal {
    padding: 0.65rem 1.75rem !important;
    background: transparent !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    min-width: 120px !important;
  }

  html.fb-desktop-ott #serverSelectionModal #closeServerModal:hover {
    border-color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }

  /* ─── Video player modal (fallback / mobile resize) ─── */
  html.fb-desktop-ott #videoPlayerModal.show,
  #videoPlayerModal.show {
    z-index: 3200 !important;
  }

  html.fb-desktop-ott #videoPlayerModal.show .modal-overlay,
  #videoPlayerModal.show .modal-overlay {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(12px);
  }

  html.fb-desktop-ott #videoPlayerModal.show .modal-container,
  #videoPlayerModal.show .modal-container {
    max-width: min(1400px, 96vw) !important;
    width: 96% !important;
    background: #0a0a0a !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8) !important;
    overflow: hidden !important;
  }

  html.fb-desktop-ott #videoPlayerModal #videoContainer,
  #videoPlayerModal #videoContainer {
    padding: 0 !important;
    background: #000;
  }

  html.fb-desktop-ott #videoPlayerModal.show.fb-player-booting .modal-container,
  #videoPlayerModal.show.fb-player-booting .modal-container {
    background: #000 !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
  }

  html.fb-desktop-ott #videoPlayerModal #videoContainer .custom-video-player,
  #videoPlayerModal #videoContainer .custom-video-player {
    border-radius: 0 0 14px 14px;
  }

  html.fb-desktop-ott #videoPlayerModal .modal-close,
  #videoPlayerModal .modal-close {
    z-index: 20 !important;
    background: rgba(0, 0, 0, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }

  body.fb-dm-video-active #movieModal.fb-dm-open .modal-content {
    overflow: hidden;
  }

  /* ─── Wishlist modal ─── */
  html.fb-desktop-ott #wishlistModal.show .modal-container {
    max-width: min(900px, 94vw) !important;
    background: #0a0a0a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
  }

  html.fb-desktop-ott #wishlistModal .modal-title {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
    font-size: 1.5rem !important;
  }

  html.fb-desktop-ott body.fb-modal-open {
    overflow: hidden;
  }

  html.fb-desktop-ott body.fb-modal-open .fb-page-shell {
    filter: none;
  }

  /* ─── Trailer modal — above detail (2800), server picker (3100), video (3200) ─── */
  html.fb-desktop-ott #trailerModal.show,
  #trailerModal.show {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 3600 !important;
  }

  html.fb-desktop-ott #trailerModal.show .modal-overlay,
  #trailerModal.show .modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: rgba(0, 0, 0, 0.92) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  html.fb-desktop-ott #trailerModal.show .modal-container,
  #trailerModal.show .modal-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2 !important;
    width: min(960px, 94vw) !important;
    max-width: min(960px, 94vw) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    overflow: hidden !important;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.85) !important;
  }

  html.fb-desktop-ott #trailerModal.show .modal-close,
  #trailerModal.show .modal-close {
    z-index: 4 !important;
    background: rgba(0, 0, 0, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }

  html.fb-desktop-ott #trailerModal #trailerContainer,
  #trailerModal #trailerContainer {
    position: relative !important;
    z-index: 3 !important;
    padding: 0 !important;
    background: #000 !important;
  }

  html.fb-desktop-ott #trailerModal #trailerContainer iframe,
  #trailerModal #trailerContainer iframe {
    display: block !important;
    width: 100% !important;
    height: min(80vh, 540px) !important;
    min-height: min(56vw, 420px) !important;
    border: 0 !important;
  }

  body.fb-trailer-modal-open {
    overflow: hidden !important;
  }
}
