/* TOIAF Player Enhanced Protection v3.2.1 */

/* Base OceanWP-friendly TOIAF player styling */
.toiaf-player-wrap {
  position: relative;
  max-width: 100%;
  margin: 0 0 24px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(142,43,255,.25);
  
  /* Protection: Disable selection and interaction */
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Single VOD shell integration */
.toiaf-vod-player-shell .toiaf-player-wrap,
.toiaf-player-wrap.toiaf-in-vod-shell {
  margin: 0 !important;
  max-width: 100% !important;
}


/* Video.js player styling */
.vjs-toiaf-skin.video-js {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 16px;
  
  /* Protection: Prevent context menu and selection */
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  pointer-events: auto; /* Allow controls */
}


/* Watch pages: ensure Video.js canvas fills the 16:9 shell */
body.single-toiaf_vod .vjs-toiaf-skin.video-js {
  height: 100% !important;
  max-height: 100% !important;
}

/* Ensure portrait videos stay letterboxed inside a 16:9 canvas */
.vjs-toiaf-skin.video-js .vjs-tech {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000;
}


/* COMPREHENSIVE BROWSER CONTROL HIDING */
/* Webkit/Chrome Shadow DOM controls */
.toiaf-player-wrap video::-webkit-media-controls { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-enclosure { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-panel { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-play-button { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-timeline { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-current-time-display { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-time-remaining-display { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-mute-button { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-volume-slider { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-fullscreen-button { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-overlay-enclosure { display: none !important; }

/* CRITICAL: Download button removal */
.toiaf-player-wrap video::-internal-media-controls-download-button { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-overflow-button { display: none !important; }
.toiaf-player-wrap video::-webkit-media-controls-overflow-menu-button { display: none !important; }

/* Firefox Shadow DOM controls */
.toiaf-player-wrap video::-moz-media-controls { display: none !important; }

/* Disable native fullscreen controls */
.toiaf-player-wrap video:fullscreen::-webkit-media-controls { display: none !important; }
.toiaf-player-wrap video:-webkit-full-screen::-webkit-media-controls { display: none !important; }
.toiaf-player-wrap video:-moz-full-screen::-webkit-media-controls { display: none !important; }

/* Video.js download button removal (multiple selectors for safety) */
.vjs-download-button,
.vjs-download,
.download-button,
.vjs-control-bar .vjs-download-button,
.vjs-menu-button[aria-label*="download" i],
.vjs-menu-item[aria-label*="download" i],
.vjs-button[title*="download" i],
[download],
[href$=".mp4"][download],
[href$=".webm"][download],
[href$=".ogv"][download] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Remove any dynamically added download elements */
.toiaf-player-wrap [download] { display: none !important; }
.toiaf-player-wrap a[href*="download"] { display: none !important; }

/* Center watermark */
.toiaf-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 40%;
  pointer-events: none !important;
  user-select: none !important;
  filter: drop-shadow(0 0 16px rgba(0,0,0,.4));
  z-index: 100;
}

/* Title overlay (top-left) */
.toiaf-title {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  font-family: "Orbitron", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.2;
  color: #0ff; /* ice-blue */
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(110,255,0,.5); /* lime edge */
  border-radius: 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  z-index: 101;
  pointer-events: none !important;
  user-select: none !important;
}

/* Author signature (left-center) */
.toiaf-signature {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff00cc; /* neon pink */
  font-family: "Orbitron", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.1;
  background: rgba(0,0,0,.35);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(142,43,255,.6);
  text-shadow: 0 2px 4px rgba(0,0,0,.6);
  z-index: 101;
  pointer-events: none !important;
  user-select: none !important;
}

/* Video.js control bar with protection */
.vjs-toiaf-skin .vjs-control-bar {
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.75));
  border-top: 1px solid rgba(142,43,255,.4);
  backdrop-filter: blur(3px);
  z-index: 102;
}

/* Remove problematic Video.js controls */
.vjs-toiaf-skin .vjs-picture-in-picture-control,
.vjs-toiaf-skin .vjs-picture-in-picture-control button,
.vjs-toiaf-skin .vjs-pip-control { 
  display: none !important; 
}

/* Protection states */
.toiaf-player-wrap.protected {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
}

/* Access denied overlay - ENHANCED VISIBILITY */
.toiaf-access-denied {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(30, 10, 62, 0.98), rgba(61, 26, 120, 0.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ff00cc;
  font-family: "Orbitron", monospace;
  text-align: center;
  z-index: 999;
  border: 3px solid #ff00cc;
  border-radius: 16px;
  animation: pulse-border 2s infinite;
}

.toiaf-access-denied::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, #ff00cc, #8e2bff, #00ffff, #6eff00);
  border-radius: 18px;
  z-index: -1;
  animation: rotate-gradient 3s linear infinite;
  opacity: 0.5;
}

@keyframes pulse-border {
  0%, 100% { border-color: #ff00cc; box-shadow: 0 0 20px rgba(255, 0, 204, 0.5); }
  50% { border-color: #00ffff; box-shadow: 0 0 40px rgba(0, 255, 255, 0.5); }
}

@keyframes rotate-gradient {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.toiaf-access-denied h3 {
  font-size: 32px;
  margin: 0 0 20px;
  color: #ff00cc;
  text-shadow: 0 0 20px rgba(255, 0, 204, 0.8),
               0 0 40px rgba(255, 0, 204, 0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
}

.toiaf-access-denied p {
  font-size: 16px;
  color: #00ffff;
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 30px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.toiaf-access-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.toiaf-access-actions .button {
  padding: 15px 30px !important;
  font-size: 16px !important;
  font-weight: bold !important;
  font-family: "Orbitron", monospace !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  background: linear-gradient(135deg, #ff00cc, #8e2bff) !important;
  border: 2px solid #00ffff !important;
  border-radius: 8px !important;
  color: white !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(255, 0, 204, 0.4) !important;
}

.toiaf-access-actions .button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(255, 0, 204, 0.6) !important;
  border-color: #6eff00 !important;
}

/* Lock icon animation */
.toiaf-access-denied h3::before {
  content: "🔒 ";
  display: inline-block;
  animation: lock-shake 0.5s ease-in-out infinite;
}

@keyframes lock-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* DevTools warning overlay */
.toiaf-warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.toiaf-warning-content {
  background: linear-gradient(135deg, #1a0033, #330066);
  border: 2px solid #ff00cc;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 0 30px rgba(255, 0, 204, 0.5);
}

.toiaf-warning-content h3 {
  color: #ff00cc;
  font-family: "Orbitron", monospace;
  font-size: 24px;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 0, 204, 0.5);
}

.toiaf-warning-content p {
  color: #00ffff;
  font-family: "Orbitron", monospace;
  font-size: 16px;
  line-height: 1.4;
}

/* OceanWP container compatibility */
.owp-container .toiaf-player-wrap img {
  display: block;
}

/* Responsive design */
@media (max-width: 768px) {
  .toiaf-player-wrap {
    margin: 0 auto 16px;
    border-radius: 12px;
  }
  
  .toiaf-title {
    font-size: 14px;
    padding: 4px 8px;
    top: 8px;
    left: 8px;
  }
  
  .toiaf-signature {
    left: 10px;
    font-size: 22px;
    padding: 3px 8px;
  }
  
  .toiaf-watermark {
    max-width: 50%;
  }
  
  .toiaf-warning-content {
    margin: 20px;
    padding: 20px;
  }
  
  .toiaf-warning-content h3 {
    font-size: 20px;
  }
  
  .toiaf-warning-content p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .toiaf-title {
    font-size: 12px;
    padding: 3px 6px;
  }
  
  .toiaf-signature {
    font-size: 18px;
  }
  
  .toiaf-watermark {
    max-width: 60%;
  }
}

/* High contrast mode accessibility (maintains protection) */
@media (prefers-contrast: high) {
  .toiaf-title {
    background: rgba(0,0,0,.8);
    border-color: #fff;
  }
  
  .toiaf-signature {
    background: rgba(0,0,0,.8);
    border-color: #fff;
  }
}

/* Reduced motion accessibility (maintains protection) */
@media (prefers-reduced-motion: reduce) {
  .toiaf-player-wrap.devtools-blur {
    transition: none;
  }
}

/* Print protection - hide videos in print */
@media print {
  .toiaf-player-wrap {
    display: none !important;
  }
}

/* Additional protection: Hide when screenshot tools detected */
.toiaf-player-wrap {
  -webkit-app-region: no-drag;
}

/* Force hardware acceleration for smoother protection (disabled during fullscreen to avoid sizing bugs) */
html:not(.toiaf-fs-active) .toiaf-player-wrap,
html:not(.toiaf-fs-active) .vjs-toiaf-skin {
  will-change: filter, transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
html.toiaf-fs-active .toiaf-player-wrap,
html.toiaf-fs-active .vjs-toiaf-skin {
  will-change: auto;
}

/* ========= TOIAF: Force correct VOD player size (stable YouTube-style 16:9) ========= */
/* Scope to the actual watch page so library cards/home/archive aren’t affected */
body.single-toiaf_vod .toiaf-vod-player-shell {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  background: #000 !important;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

/* Prevent the “double player” flash on first paint.
   - Hide any legacy/theme player markup in the shell.
   - Hide the shortcode player until JS moves it into the shell. */
body.single-toiaf_vod .toiaf-vod-player-shell > :not(.toiaf-player-wrap) {
  display: none !important;
}
body.single-toiaf_vod .toiaf-player-wrap:not(.toiaf-in-vod-shell) {
  display: none !important;
}

/* Lightweight placeholder while JS relocates the player into the shell */
body.single-toiaf_vod .toiaf-vod-player-shell:not(.toiaf-shell-ready)::before {
  content: "Loading video…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Orbitron", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  color: #24f0ff;
  background: rgba(0,0,0,.80);
  z-index: 1;
}

/* If the shortcode player-wrap is moved inside the shell, make it fill the 16:9 frame */
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap,
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap.toiaf-in-vod-shell {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  aspect-ratio: 16 / 9;
  background: #000 !important;
  overflow: hidden;
}

/* When Video.js is used (single watch pages), make the player truly fill the 16:9 shell.
   We intentionally do NOT use vjs-fluid here (it causes fullscreen sizing bugs in some themes). */
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .video-js:not(.vjs-fullscreen):not(.vjs-full-window),
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .vjs-toiaf-skin.video-js:not(.vjs-fullscreen):not(.vjs-full-window) {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
}

/* Keep the actual video contained inside the 16:9 canvas (portrait vids show side bars) */
body.single-toiaf_vod .toiaf-vod-player-shell video,
body.single-toiaf_vod .toiaf-vod-player-shell .vjs-tech {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Safety: hide any legacy overlay element if present */
#toiaf-devtools-warning {
  display: none !important;
}

/* ========= TOIAF: Library card player sizing fix ========= */
/* Some cards render TOIAF player markup as a “background video”. Make it behave like a background layer
   so it does NOT change the card’s layout/height and does NOT steal clicks. */

.toiaf-library-card,
.toiaf-netflix-card {
  position: relative;
}

.toiaf-library-card > .toiaf-player-wrap,
.toiaf-netflix-card > .toiaf-player-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  max-width: none !important;
  border: 0 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  background: #000 !important;
  overflow: hidden !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.toiaf-library-card > .toiaf-player-wrap *,
.toiaf-netflix-card > .toiaf-player-wrap * {
  pointer-events: none !important;
}

/* Make the card video cover the card area */
.toiaf-library-card > .toiaf-player-wrap video,
.toiaf-netflix-card > .toiaf-player-wrap video,
.toiaf-library-card > .toiaf-player-wrap .video-js,
.toiaf-netflix-card > .toiaf-player-wrap .video-js,
.toiaf-library-card > .toiaf-player-wrap .vjs-tech,
.toiaf-netflix-card > .toiaf-player-wrap .vjs-tech {
  width: 100% !important;
  height: 100% !important;
}

.toiaf-library-card > .toiaf-player-wrap video,
.toiaf-netflix-card > .toiaf-player-wrap video,
.toiaf-library-card > .toiaf-player-wrap .vjs-tech,
.toiaf-netflix-card > .toiaf-player-wrap .vjs-tech {
  object-fit: cover !important;
}

/* Hide controls + UI when used as a background */
.toiaf-library-card > .toiaf-player-wrap .vjs-control-bar,
.toiaf-netflix-card > .toiaf-player-wrap .vjs-control-bar,
.toiaf-library-card > .toiaf-player-wrap .vjs-big-play-button,
.toiaf-netflix-card > .toiaf-player-wrap .vjs-big-play-button,
.toiaf-library-card > .toiaf-player-wrap .vjs-loading-spinner,
.toiaf-netflix-card > .toiaf-player-wrap .vjs-loading-spinner,
.toiaf-library-card > .toiaf-player-wrap .vjs-text-track-display,
.toiaf-netflix-card > .toiaf-player-wrap .vjs-text-track-display,
.toiaf-library-card > .toiaf-player-wrap .toiaf-title,
.toiaf-netflix-card > .toiaf-player-wrap .toiaf-title,
.toiaf-library-card > .toiaf-player-wrap .toiaf-signature,
.toiaf-netflix-card > .toiaf-player-wrap .toiaf-signature {
  display: none !important;
}

/* Hide native HTML5 controls (Chrome/Safari) */
.toiaf-library-card > .toiaf-player-wrap video::-webkit-media-controls,
.toiaf-netflix-card > .toiaf-player-wrap video::-webkit-media-controls {
  display: none !important;
}
.toiaf-library-card > .toiaf-player-wrap video::-webkit-media-controls-enclosure,
.toiaf-netflix-card > .toiaf-player-wrap video::-webkit-media-controls-enclosure {
  display: none !important;
}



/* ========== TOIAF: Fullscreen sizing (Video.js + native Fullscreen API) ========== */
/*
  Key bug this fixes:
  - Video.js "fluid" mode uses height:0 + padding-top for aspect ratio.
  - In some environments, that fluid sizing can persist into fullscreen/full-window,
    resulting in a tiny video centered in a large black area.
*/

/* Video.js native fullscreen: force a true viewport-sized canvas.
   Some themes (and some Video.js sizing states) can leave a leftover aspect-ratio/padding-top
   that makes the tech video appear tiny in fullscreen.
*/
.video-js.vjs-fullscreen,
.vjs-toiaf-skin.video-js.vjs-fullscreen,
body.vjs-fullscreen .video-js,
body.vjs-fullscreen .vjs-toiaf-skin.video-js,
.video-js:fullscreen,
.video-js:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding-top: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  z-index: 2147483647 !important;
}

/* Ensure fullscreen overrides the watch-page absolute fill rule */
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .video-js.vjs-fullscreen,
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .video-js.vjs-full-window {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* Force the tech video to truly fill the fullscreen canvas */
.video-js.vjs-fullscreen .vjs-tech,
.video-js.vjs-full-window .vjs-tech,
body.vjs-fullscreen .video-js .vjs-tech,
.video-js:fullscreen .vjs-tech,
.video-js:-webkit-full-screen .vjs-tech {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000 !important;
}

.video-js.vjs-fullscreen .vjs-poster,
.video-js.vjs-full-window .vjs-poster,
body.vjs-fullscreen .video-js .vjs-poster {
  width: 100% !important;
  height: 100% !important;
}

/* Video.js "full window" fallback (no native Fullscreen API) */
body.vjs-full-window { overflow: hidden !important; }
.video-js.vjs-full-window,
.vjs-toiaf-skin.video-js.vjs-full-window {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  z-index: 999999 !important;
}

/* Neutralize fluid aspect-ratio padding in fullscreen/full-window */
.video-js.vjs-fullscreen.vjs-fluid,
.vjs-toiaf-skin.video-js.vjs-fullscreen.vjs-fluid,
.video-js.vjs-full-window.vjs-fluid,
.vjs-toiaf-skin.video-js.vjs-full-window.vjs-fluid {
  padding-top: 0 !important;
  height: 100% !important;
}

/* If the wrapper (or the <video>) itself is fullscreen, force fill */
.toiaf-player-wrap:fullscreen,
.toiaf-player-wrap:-webkit-full-screen,
.toiaf-player-wrap:-moz-full-screen,
.toiaf-player-wrap:-ms-fullscreen,
.video-js:fullscreen,
.video-js:-webkit-full-screen,
video:fullscreen,
video:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
}

.video-js.vjs-fullscreen .vjs-tech,
.vjs-toiaf-skin.video-js.vjs-fullscreen .vjs-tech,
.video-js.vjs-full-window .vjs-tech,
.vjs-toiaf-skin.video-js.vjs-full-window .vjs-tech,
.toiaf-player-wrap:fullscreen .vjs-tech,
.toiaf-player-wrap:-webkit-full-screen .vjs-tech,
.video-js:fullscreen .vjs-tech,
.video-js:-webkit-full-screen .vjs-tech,
video:fullscreen,
video:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000 !important;
}

/* When fullscreen/full-window is active, disable the 16:9 shell constraint */
html.toiaf-fs-active body.single-toiaf_vod .toiaf-vod-player-shell,
html.toiaf-fs-active body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap {
  aspect-ratio: auto !important;
  max-width: none !important;
}

/* Disable transforms during fullscreen/full-window to prevent fixed-position containment issues */
html.toiaf-fs-active,
html.toiaf-fs-active body {
  transform: none !important;
  -webkit-transform: none !important;
}


/* TOIAF: Hard fullscreen normalization (beats theme constraints + lingering aspect padding) */
/* Apply unconditionally in fullscreen modes (native :fullscreen + Video.js classes + body flag). */
.video-js.vjs-fullscreen,
.video-js:fullscreen,
body.vjs-full-window .video-js,
.video-js.vjs-full-window {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  padding-top: 0 !important;
  margin: 0 !important;
  display: block !important;
  background: #000 !important;
  z-index: 999999 !important;
}

/* Ensure the internal tech always fills the fullscreen canvas */
.video-js.vjs-fullscreen .vjs-tech,
.video-js:fullscreen .vjs-tech,
body.vjs-full-window .video-js .vjs-tech,
.video-js.vjs-full-window .vjs-tech {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000 !important;
}

/* If any aspect-ratio helper element exists, neutralize it in fullscreen */
.video-js.vjs-fullscreen .vjs-aspect-ratio,
.video-js:fullscreen .vjs-aspect-ratio,
body.vjs-full-window .video-js .vjs-aspect-ratio,
.video-js.vjs-full-window .vjs-aspect-ratio {
  padding-top: 0 !important;
  height: 100% !important;
  width: 100% !important;
}

/* Also remove wrapper rounding/overflow in fullscreen so nothing clips */
html.toiaf-fs-active .toiaf-player-wrap {
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}


/* ========== TOIAF: Fullscreen HARD override (theme-proof) ========== */
/*
  Some themes apply max-height/height:auto and/or keep aspect padding that results in
  a tiny video in fullscreen. These rules force the fullscreen canvas to be true 100vw/100vh
  and force the tech element to absolute-fill.
*/

/* If Video.js enters fullscreen, force viewport fill (do NOT rely on 100%) */
.video-js.vjs-fullscreen,
.video-js:fullscreen,
.video-js:-webkit-full-screen,
.video-js:-moz-full-screen,
.video-js:-ms-fullscreen,
body.vjs-fullscreen .video-js,
body.vjs-full-window .video-js,
.video-js.vjs-full-window {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  padding-top: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  z-index: 2147483646 !important;
}

/* Override our watch-page absolute fill rule when fullscreen is active */
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .video-js.vjs-fullscreen,
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .video-js.vjs-full-window,
body.single-toiaf_vod .toiaf-vod-player-shell .toiaf-player-wrap > .video-js:fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* Force the actual tech video element to fill the fullscreen canvas */
.video-js.vjs-fullscreen video,
.video-js.vjs-fullscreen .vjs-tech,
.video-js.vjs-full-window video,
.video-js.vjs-full-window .vjs-tech,
body.vjs-fullscreen .video-js video,
body.vjs-full-window .video-js video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  background: #000 !important;
}

/* Ensure poster also fills fullscreen */
.video-js.vjs-fullscreen .vjs-poster,
.video-js.vjs-full-window .vjs-poster,
body.vjs-fullscreen .video-js .vjs-poster,
body.vjs-full-window .video-js .vjs-poster {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-size: contain !important;
}

