/* Watch Page rebuilt from the approved FlixIT player/detail reference */
[data-testid="watch-page"] {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 100vh !important;
  padding: 0 !important;
  overflow: visible !important;
  z-index: auto !important;
  background: #050505 !important;
}

[data-testid="watch-page"] [data-testid="custom-video-player"] {
  width: 100vw !important;
  max-width: none !important;
  height: clamp(520px, 61vh, 760px) !important;
  min-height: 520px !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  overflow: hidden !important;
}

[data-testid="watch-page"] [data-testid="native-video"] {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  border-radius: 0 !important;
}

[data-testid="watch-page"] [data-testid="custom-video-player"]::after { display: none !important; }

[data-testid="watch-page"] [data-testid="player-controls"] {
  left: clamp(26px, 3.8vw, 72px) !important;
  right: clamp(26px, 3.8vw, 72px) !important;
  bottom: 22px !important;
  width: auto !important;
  padding: 12px 20px !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(18,18,18,.70), rgba(7,7,7,.86)) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.42) !important;
  backdrop-filter: blur(20px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(125%) !important;
}

[data-testid="watch-page"] [data-testid="back-button"] {
  top: 28px !important;
  left: clamp(28px, 4vw, 76px) !important;
}

[data-testid="watch-page"] [data-testid="player-title"] {
  top: 31px !important;
  left: clamp(82px, 7vw, 132px) !important;
  font-size: clamp(18px, 1.45vw, 24px) !important;
}

[data-testid="watch-page"] [data-testid="player-episode"] {
  top: 59px !important;
  left: clamp(82px, 7vw, 132px) !important;
}

[data-testid="watch-page"] [data-testid="player-quality"] {
  top: 30px !important;
  right: clamp(28px, 4vw, 76px) !important;
}

.flixit-watch-details {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 370px;
  margin: 0;
  padding: 24px clamp(28px, 4.5vw, 78px) 46px;
  box-sizing: border-box;
  overflow: hidden;
  color: #fff;
  background: #070707;
  font-family: "Netflix Sans Local", "Netflix Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
}

.flixit-watch-details.is-ready {
  opacity: 1;
  transform: translateY(0);
}

.flixit-watch-details__ambient {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center 34%;
  opacity: .22;
  filter: blur(28px) saturate(.8) brightness(.6);
  transform: scale(1.09);
}

.flixit-watch-details::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 59% 4%, rgba(143,84,54,.24), transparent 33%),
    linear-gradient(90deg, rgba(5,5,7,.96) 0%, rgba(7,7,9,.92) 55%, rgba(7,7,9,.86) 100%);
  pointer-events: none;
}

.flixit-watch-details__inner {
  display: grid;
  grid-template-columns: clamp(160px, 13vw, 220px) minmax(0, 1fr) minmax(360px, 30vw);
  gap: clamp(28px, 3vw, 54px);
  align-items: start;
  max-width: 1540px;
  margin: 0 auto;
}

.flixit-watch-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
}

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

.flixit-watch-main {
  min-width: 0;
  padding-top: 6px;
}

.flixit-watch-details__title {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 3.3vw, 64px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.035em;
}

.flixit-watch-title-line {
  width: 68px;
  height: 4px;
  margin-top: 18px;
  border-radius: 999px;
  background: #e50914;
}

.flixit-watch-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 14px;
  margin-top: 20px;
  color: rgba(255,255,255,.68);
  font-size: 15px;
}

.flixit-watch-meta__dot { color: rgba(255,255,255,.24); }

.flixit-watch-description {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 16px;
  line-height: 1.52;
}

.flixit-watch-actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.flixit-watch-action {
  min-width: 210px;
  height: 56px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.12);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.flixit-watch-action:hover { transform: translateY(-1px); }

.flixit-watch-action--primary {
  color: #fff;
  background: linear-gradient(90deg, #f20d20 0%, #930913 100%);
  border-color: rgba(255,36,55,.42);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 8px 22px rgba(229,9,20,.12);
}

.flixit-watch-action--primary::before {
  content: "▶";
  margin-right: 14px;
  font-size: 18px;
}

.flixit-watch-action--secondary {
  color: #fff;
  background: rgba(255,255,255,.035);
}

.flixit-watch-action--secondary::before {
  content: "☷";
  margin-right: 14px;
  font-size: 22px;
}

.flixit-watch-episodes-panel {
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(9,9,11,.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.flixit-watch-episodes-panel__head {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  color: #fff;
  font-size: 15px;
}

.flixit-watch-episodes-panel__chevron {
  font-size: 24px;
  line-height: 1;
  color: rgba(255,255,255,.72);
}

.flixit-watch-episode-row {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 30px 125px minmax(0,1fr) 38px;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.flixit-watch-episode-row:last-child { border-bottom: 0; }
.flixit-watch-episode-row:hover { background: rgba(255,255,255,.035); }
.flixit-watch-episode-row.is-current { background: rgba(229,9,20,.055); }

.flixit-watch-episode-row__number {
  font-size: 17px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  text-align: center;
}

.flixit-watch-episode-row__thumb {
  width: 125px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255,255,255,.05);
}

.flixit-watch-episode-row__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.flixit-watch-episode-row__copy { min-width: 0; }
.flixit-watch-episode-row__name,
.flixit-watch-episode-row__runtime { display: block; }

.flixit-watch-episode-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.flixit-watch-episode-row__runtime {
  margin-top: 4px;
  color: rgba(255,255,255,.60);
  font-size: 12px;
}

.flixit-watch-episode-row__play {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.72);
  color: #fff;
  font-size: 12px;
  padding-left: 2px;
}

@media (max-width: 1100px) {
  .flixit-watch-details__inner {
    grid-template-columns: 155px minmax(0,1fr);
  }
  .flixit-watch-episodes-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  [data-testid="watch-page"] {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    background: #000 !important;
  }

  [data-testid="watch-page"] [data-testid="custom-video-player"] {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

  [data-testid="watch-page"] [data-testid="native-video"] {
    object-fit: contain !important;
    object-position: center center !important;
    background: #000 !important;
  }

  [data-testid="watch-page"] [data-testid="player-controls"] {
    left: 10px !important;
    right: 10px !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  .flixit-watch-details { display: none !important; }
}
