/* FlixMirror — Premium Cinema OTT Stylesheet */
:root {
  --bg-dark: #05070B;
  --bg-surface: #0C1019;
  --bg-card: #111624;
  --bg-glass: rgba(12, 16, 25, 0.88);
  --border-glass: rgba(255, 255, 255, 0.08);
  --primary-red: #E50914;
  --primary-red-hover: #b20710;
  --primary-red-glow: rgba(229, 9, 20, 0.45);
  --accent-gold: #F59E0B;
  --text-white: #FFFFFF;
  --text-muted: #8E9BAE;
  --text-dim: #546074;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
  min-height: 100vh;
  padding-bottom: calc(66px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

/* Ambient Top Glow */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 380px;
  background: radial-gradient(circle at 50% -10%, rgba(229, 9, 20, 0.22) 0%, rgba(12, 16, 25, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.98) 0%, rgba(5, 7, 11, 0.88) 75%, rgba(5, 7, 11, 0) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: calc(10px + var(--safe-top)) 18px 8px 18px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-group {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  height: 38px;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.header-icon-btn:active {
  transform: scale(0.92);
  background: rgba(229, 9, 20, 0.2);
}

/* Tab Views */
.tab-content-view {
  display: none;
  position: relative;
  z-index: 1;
}

.tab-content-view.active {
  display: block;
}

/* Hero Billboard */
.hero-billboard {
  position: relative;
  width: 100%;
  height: clamp(160px, calc(100vh - 400px), 480px);
  min-height: 155px;
  max-height: 480px;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 20px;
  margin-bottom: 6px;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  transition: background-image 0.4s ease-in-out;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, rgba(5, 7, 11, 0.15) 0%, rgba(5, 7, 11, 0) 25%, rgba(5, 7, 11, 0.25) 50%, rgba(5, 7, 11, 0.88) 85%, var(--bg-dark) 100%),
    linear-gradient(90deg, rgba(5, 7, 11, 0.88) 0%, rgba(5, 7, 11, 0.45) 45%, transparent 75%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 580px;
}

.hero-badge {
  align-self: flex-start;
  background: rgba(229, 9, 20, 0.25);
  border: 1px solid var(--primary-red);
  color: var(--primary-red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 2px 7px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  letter-spacing: -0.3px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

.meta-tag {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.meta-tag.gold {
  background: rgba(245, 158, 11, 0.25);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.btn-play-hero {
  flex: 0 0 auto;
  min-width: 110px;
  padding: 0 16px;
  background: var(--primary-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 14px var(--primary-red-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-play-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

.btn-play-hero:active {
  transform: scale(0.97);
}

.btn-info-hero {
  flex: 0 0 auto;
  min-width: 85px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-info-hero:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-info-hero:active {
  transform: scale(0.97);
}

/* Horizontal Rails */
.rail-section {
  margin-bottom: 20px;
}

.rail-header {
  padding: 0 18px 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-all-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-red);
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: -0.2px;
}

.view-all-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.rail-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.rail-title .highlight {
  color: var(--primary-red);
  font-weight: 800;
}

.rail-scroll-wrap {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 18px 12px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.rail-scroll-wrap::-webkit-scrollbar {
  display: none;
}

/* Movie Card */
.movie-card {
  flex: 0 0 120px;
  scroll-snap-align: start;
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.2s ease;
}

.movie-card:active {
  transform: scale(0.96);
}

.poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  background-color: #1a2233;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-quality-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 4px 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  font-size: 9px;
  color: var(--text-muted);
  padding: 0 4px 4px 4px;
}

/* 3D Top 10 Rank Card */
.top10-card-wrap {
  flex: 0 0 152px;
  display: flex;
  align-items: flex-end;
  position: relative;
  scroll-snap-align: start;
  cursor: pointer;
}

.rank-number-3d {
  font-family: 'Impact', 'Syne', sans-serif;
  font-size: 86px;
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: -2px;
  width: 44px;
  text-align: center;
  margin-bottom: 22px;
  color: #2D3748;
  -webkit-text-stroke: 3px #FFFFFF;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.95);
  position: relative;
  left: 4px;
  z-index: 1;
  user-select: none;
  flex-shrink: 0;
}

.top10-card-wrap .movie-card {
  flex: 0 0 106px;
  margin-left: -8px;
  z-index: 2;
}

/* Dedicated In-App Player Overlay */
.player-fullscreen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

#inAppVideoPlayer,
#inAppIframePlayer,
.video-container {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.player-fullscreen-overlay.active {
  display: block;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#inAppVideoPlayer {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.iframe-player-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border: none;
}

/* Player Overlay Controls */
.player-controls-container {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 75%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px calc(14px + var(--safe-bottom)) 16px;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.player-controls-container.hidden {
  opacity: 0;
  pointer-events: none;
}

.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.player-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pt-main {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.top-action-group {
  display: flex;
  gap: 8px;
}

.player-pill-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.player-center-tap-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-controls-row {
  display: flex;
  align-items: center;
  gap: 40px;
}

.btn-center-round {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.btn-center-play-main {
  background: var(--primary-red);
  color: #fff;
  border: none;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 24px var(--primary-red-glow);
}

/* Scrub Bar */
.scrub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.slider-track-wrap {
  flex: 1;
}

#playerScrubSlider {
  width: 100%;
  accent-color: var(--primary-red);
  cursor: pointer;
}

.time-label {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.bottom-tools-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-tool-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Ripple Double Tap */
.seek-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.3) 0%, transparent 70%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.seek-ripple.left { left: 0; }
.seek-ripple.right { right: 0; }
.seek-ripple.active { opacity: 1; }

/* Spinner */
.player-spinner-wrap {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.cinema-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Details Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  background: #0D111A;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 40px rgba(229, 9, 20, 0.15);
  overflow-y: auto;
  position: relative;
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #E50914;
  border-color: #E50914;
  transform: scale(1.08);
}

/* Modal Hero Section */
.modal-hero-wrap {
  position: relative;
  overflow: hidden;
  background: #080B11;
  padding: 24px 24px 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-ambient-blur {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.25);
  opacity: 0.85;
  pointer-events: none;
}

.modal-backdrop-img {
  display: none;
}

.modal-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.modal-poster-box {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 175px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85), 0 0 1px rgba(255, 255, 255, 0.3);
  background: #151A24;
}

.modal-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-quality-tag {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.modal-header-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-network-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.5);
  color: #FF4D58;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.m-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: #FFF;
  line-height: 1.25;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.m-badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.modal-actions-row {
  margin-top: 6px;
}

.btn-modal-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #E50914 0%, #B20710 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.45);
  transition: all 0.2s ease;
}

.btn-modal-watch:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(229, 9, 20, 0.65);
}

.btn-modal-watch:active {
  transform: scale(0.97);
}

.modal-body-wrap {
  padding: 20px 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.m-synopsis {
  font-size: 13.5px;
  color: #CBD5E1;
  line-height: 1.65;
  margin: 0;
}

.m-section-label {
  font-size: 11px;
  font-weight: 800;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.langs-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.genre-chip {
  background: rgba(229, 9, 20, 0.14);
  border: 1px solid rgba(229, 9, 20, 0.35);
  color: #FFA2A8;
  padding: 4px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.cast-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F8FAFC;
  padding: 4px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.meta-tag.imdb {
  background: #F5C518;
  color: #000;
  font-weight: 800;
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .hero-billboard {
    height: 290px;
    min-height: 250px;
    padding: 16px 14px;
    background-position: center 20%;
    margin-bottom: 10px;
  }
  .hero-title {
    font-size: 20px;
  }
  .hero-buttons {
    width: 100%;
  }
  .btn-play-hero {
    flex: 1;
    min-width: 0;
    height: 38px;
    font-size: 13px;
  }
  .btn-info-hero {
    flex: 0 0 auto;
    min-width: 90px;
    padding: 0 14px;
    height: 38px;
    font-size: 12px;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-card {
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }
  .modal-hero-content {
    flex-direction: row;
    gap: 14px;
  }
  .modal-poster-box {
    width: 95px;
    height: 140px;
  }
  .m-title {
    font-size: 19px;
  }
  .btn-modal-watch {
    width: 100%;
    padding: 12px 16px;
  }
}

/* Desktop Single-Row Cinema Layout & Fold Optimization */
@media (min-width: 601px) {
  #adBannerTopSlot {
    padding: 0 18px 6px 18px;
  }
  .ott-platform-bar {
    padding: 0 18px 6px 18px;
  }
  .rail-header {
    padding: 0 18px 4px 18px;
  }
  .rail-scroll-wrap {
    padding: 2px 18px 6px 18px;
  }
  #tabHome > .rail-section:first-of-type {
    margin-bottom: max(55px, calc(100vh - 490px));
  }
}

@media (min-width: 769px) {
  .bottom-nav-dock {
    display: none !important;
  }
}

/* Bottom Floating OTT Navigation Dock */
.bottom-nav-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(58px + var(--safe-bottom));
  background: rgba(5, 7, 11, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
}

.nav-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-tab-btn span {
  font-size: 10px;
  font-weight: 700;
}

.nav-tab-btn.active {
  color: var(--primary-red);
}

.nav-tab-btn.active svg {
  stroke: var(--primary-red);
}

/* Search View Wrap */
.search-view-wrap, .categories-view-wrap, .settings-view-wrap {
  padding: 16px 18px;
}

.search-bar-card {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 14px;
  gap: 10px;
  margin-bottom: 14px;
}

.search-bar-card input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.btn-clear-search {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.trending-chips-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 18px;
  padding-bottom: 4px;
}

.trend-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.grid-results-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
}

/* Category Tiles */
.category-tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.cat-tile-card {
  position: relative;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glass);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cat-tile-card[data-cat="all"] {
  grid-column: 1 / -1;
  height: 100px;
}

.cat-tile-card.active {
  border-color: var(--primary-red);
  box-shadow: 0 0 18px rgba(229, 9, 20, 0.45);
}

.cat-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.5);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.cat-tile-card:hover .cat-bg,
.cat-tile-card:active .cat-bg {
  transform: scale(1.04);
  filter: brightness(0.65);
}

.cat-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.8);
}

/* Settings View */
.view-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  overflow: hidden;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.set-row:last-child {
  border-bottom: none;
}

.badge-ver {
  background: rgba(229, 9, 20, 0.2);
  color: var(--primary-red);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* OTT Platform Network Pills Bar */
.ott-platform-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 18px 12px 18px;
  scrollbar-width: none;
}
.ott-platform-bar::-webkit-scrollbar { display: none; }

.ott-pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ott-pill-btn.active {
  background: #FFF;
  color: #000;
  border-color: #FFF;
}

.ott-pill-btn.netflix.active { background: #E50914; color: #FFF; border-color: #E50914; }
.ott-pill-btn.prime.active { background: #00A8E1; color: #FFF; border-color: #00A8E1; }
.ott-pill-btn.hotstar.active { background: #F59E0B; color: #000; border-color: #F59E0B; }
.ott-pill-btn.sonyliv.active { background: #8B5CF6; color: #FFF; border-color: #8B5CF6; }

/* OTT Card Badge */
.ott-badge-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.ott-badge-tag.netflix { background: #E50914; color: #FFF; }
.ott-badge-tag.prime { background: #00A8E1; color: #FFF; }
.ott-badge-tag.hotstar { background: #F59E0B; color: #000; }
.ott-badge-tag.sonyliv { background: #8B5CF6; color: #FFF; }
.ott-badge-tag.apple { background: #FFF; color: #000; }

/* 5-Second Video Pre-Roll Ad Box (Step 11) */
.player-preroll-ad-box {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ad-notice-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.ad-media-wrap {
  max-width: 90%;
  max-height: 65vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.ad-media-wrap img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.ad-skip-bar {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ad-timer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-skip-ad {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skip-ad:not(:disabled) {
  background: var(--primary-red);
  border-color: var(--primary-red);
  box-shadow: 0 4px 16px var(--primary-red-glow);
}



/* ========================================================
   FlixMirror Native Model: Sheets & Episodes
   ======================================================== */

/* Audio & Quality Slide-Up Sheets */
.player-sheet-modal {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0E121C;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(24px + var(--safe-bottom, 16px)) 20px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.95);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999999;
  max-height: 70vh;
  overflow-y: auto;
}

.player-sheet-modal.is-open {
  transform: translateY(0);
}

.player-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-sheet-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFF;
  margin: 0;
}

.player-sheet-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-option-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sheet-option-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.sheet-option-btn.is-selected {
  background: rgba(229, 9, 20, 0.15);
  border-color: #E50914;
  color: #FFF;
}

/* Series Episodes & Seasons Picker */
.episodes-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.episodes-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.season-select-box {
  background: #181E2B;
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.episodes-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.ep-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ep-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
}

.ep-card-still {
  position: relative;
  width: 100px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #181E2B;
}

.ep-card-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ep-title-line {
  font-size: 13px;
  font-weight: 700;
  color: #FFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-sub-line {
  font-size: 11px;
  color: var(--text-muted, #94A3B8);
}

/* Embed Player Mode Overrides */
.player-fullscreen-overlay.is-embed .player-center-tap-area,
.player-fullscreen-overlay.is-embed .player-bottom-bar,
.player-fullscreen-overlay.is-embed #btnPlayerAudioTop,
.player-fullscreen-overlay.is-embed #btnPlayerQualityTop,
.player-fullscreen-overlay.is-embed .player-titles {
  display: none !important;
}

.player-fullscreen-overlay.is-embed .player-controls-container {
  pointer-events: none;
  background: transparent !important;
  z-index: 5;
}

.player-fullscreen-overlay.is-embed .player-top-bar {
  pointer-events: none;
}

.player-fullscreen-overlay.is-embed #btnPlayerClose {
  pointer-events: auto;
  position: absolute;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.player-fullscreen-overlay.is-embed #btnPlayerClose:hover {
  background: #E50914;
  border-color: #E50914;
  transform: scale(1.1);
}

.player-fullscreen-overlay.is-embed .iframe-player-fallback {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

#btnPlayerServerTop {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #34D399;
  font-weight: 700;
}
