@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

html, body {
  height: 100%;
}
body {
  background-color: #002333;
  min-height: 100vh;
  height: 100%;
}

/* Switch SBS style */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

#video_player {
  min-height: 100%;
  height: 100vh !important;
  max-height: 100vh;
  box-sizing: border-box;
}
video::cue {
  opacity: 0;
}

.caption_text {
  position: absolute;
  left: 50%;
  bottom: 3%;
  width: 90%;
  max-width: 90%;
  transform: translate(-50%, 0);
  text-align: center;
  user-select: none;
  transition: bottom 0.1s;
  color: yellow;
  font-weight: bold;
  font-size: 1.2em;
}

.caption_text.active {
  bottom: 0%;
}

.caption_text mark {
  background-color: #0000008f !important;
  color: #fff;
}

/* Styles pour les sous-titres en mode SBS */
.sbs-caption {
  position: absolute;
  bottom: 3%;
  width: 45%;
  max-width: 45%;
  text-align: center;
  user-select: none;
  transition: bottom 0.1s;
  color: yellow;
  font-weight: bold;
  font-size: 1.2em;
  z-index: 10;
}

.sbs-caption-left {
  left: 2.5%;
  transform: translate(0, 0);
}

.sbs-caption-right {
  right: 2.5%;
  transform: translate(0, 0);
}

.sbs-caption mark {
  background-color: #0000008f !important;
  color: #fff;
}


.material-icons {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

/* Video player Styling */
#video_player {
  position: relative !important;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  /* Player main color. This can be changed dynamically via JS (see settings.php) */
  --pColor: #8b5cf6;
  --cColor: #fff;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

/* S'assurer qu'aucun élément du player n'a de bords arrondis */
#video_player,
#video_player video,
#video_player canvas {
  border-radius: 0 !important;
}

/* Suppression des bords arrondis pour les éléments principaux mais PAS les contrôles d'interface */
#video_player .progress-area,
#video_player .progress-bar,
#video_player .controls-list {
  border-radius: 0 !important;
}

/* Exceptions explicites pour les éléments d'interface qui DOIVENT garder leurs bords arrondis */
.switch .slider,
.switch .slider.round,
.switch .slider:before,
.slider,
.slider.round,
.slider:before,
#video_player #settings,
#video_player #captions,
#video_player #sbs-controls button {
  border-radius: initial !important;
}

/* Règles spécifiques pour le switch SBS pour s'assurer qu'il garde ses bords arrondis */
#video_player .switch .slider,
#video_player .switch .slider.round {
  border-radius: 24px !important;
}

#video_player .switch .slider:before {
  border-radius: 50% !important;
}

#sbs-canvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16/9;
  background: #000;
  margin: 0;
  padding: 0;
  border: none;
  object-fit: contain;
  border-radius: 0 !important;
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  will-change: contents;
  /* Empêche l'interpolation GPU susceptible de faire clignoter une moitié */
  backface-visibility: hidden;
}
#video_player .loader{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 60px;
  height: 60px;
  border: 4px solid var(--pColor);  
  border-bottom-color: transparent;
  border-radius: 50% !important;
  z-index: 1;
  animation: animate 0.6s linear infinite;
  display: none;
}
@keyframes animate{
  0%{
    transform: translate(-50%,-50%) rotate(0deg);
  }
  100%{
    transform: translate(-50%,-50%) rotate(360deg);
  }
}
#video_player .thumbnail{
  position: absolute;
  bottom: 60px;
  left: calc(var(--x) + 11px);
  transform: translateX(-50%);
  width: 165px;
  height: 90px;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 3px;
  display: none;
}
#video_player #main-video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none;
  display: block;
  border-radius: inherit;
}


#video_player .progressAreaTime {
  position: absolute;
  left: calc(var(--x) + 11px);
  transform: translateX(-50%);
  bottom: 60px;
  min-width: 60px;
  background: var(--pColor);
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  padding: 5px 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  z-index: 2;
  display: none;
}
#video_player .progressAreaTime::before{
  position: absolute;
  content: '';
  bottom: -50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(45deg);
  width: 20px;
  height: 20px;
  background: var(--pColor);
  z-index: -1;
}
/* Contrôles masqués par défaut, affichés seulement avec .active */
#video_player .controls {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50px;
  background: rgb(0 0 0 / 29%);
  box-shadow: 0 0 40px 10px rgb(0 0 0 / 25%);
  z-index: 3;
  transform: translateY(100%);
  transition: 0.3s;
  padding: 0px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
}

#video_player .controls.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#video_player .controls img.logo{
  position: absolute;
  bottom: 95px;
  width: 70px;
  height: 70px;
  opacity: 0.6;
  right: 10px;
  user-select: none;
  cursor: pointer;
  transition: 0.3s;
}
#video_player .controls.active img.logo{
  bottom: 66px;
}

#video_player .controls img.logo:hover{
  opacity: 1;
}
#video_player .controls .progress-area {
  width: 100%;
  height: 5px;
  margin: auto;
  background: #f0f0f063;
  cursor: pointer;
  position: relative;
}

.controls .progress-area .progress-bar {
  position: relative;
  width: 0%;
  background: var(--pColor);
  height: inherit;
  border-radius: inherit;
  cursor: pointer;
}

.controls .progress-area .progress-bar::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--pColor);
}

.controls .progress-area .bufferedBar{
  position: absolute;
  top: 0%;
  right: 0%;
  width: 100%;
  height: inherit;
}

.controls .controls-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  width: 97%;
  height: 46px;
  margin: 0 auto;
}

.controls .controls-list .controls-left,
.controls .controls-list .controls-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.controls .controls-left .timer {
  display: inline-block;
  font-size: 14px;
  white-space: nowrap;
  color: var(--cColor);
  margin-left: 5px;
  text-align: center;
}

.controls .icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--cColor);
  margin-left: 8px;
  margin-right: 5px;
}

.controls .icon .material-icons {
  font-size: 26px;
  color: var(--cColor);
  cursor: pointer;
}

#cast-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#cast-button .material-icons {
  font-size: 26px;
  color: var(--cColor);
}

.controls .icon .material-icons.fast-rewind:active {
  transition: 0.2s;
  transform: rotate(-45deg);
}

.controls .icon .material-icons.fast-forward:active {
  transition: 0.2s;
  transform: rotate(45deg);
}

.controls .icon .volume_range {
  -webkit-appearance: none;
  appearance: none;
  width: 0px;
  height: 3px;
  background: #fff;
  color: #fff;
  cursor: pointer;
  outline: none;
  border: none;
  transition: 0.4s;
}

.controls .icon .volume_range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50% !important;
  border: none;
  outline: none;
  background: #fff;
  color: #fff;
  opacity: 0;
  transition: 0.3s;
}

.controls .icon:hover .volume_range {
  display: inline-block;
  width: 60px;
}

.controls .icon:hover .volume_range::-webkit-slider-thumb {
  opacity: 1;
  pointer-events: auto;
  transition: 0.5s;
}

.controls-right .icon .auto-play {
  width: 30px;
  height: 10px;
  border-radius: 20px !important;
  position: relative;
  margin-right: 8px !important;
  background: #b6b6b6;
}

.controls-right .icon .auto-play::before {
  content: "\e034";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  line-height: 17px;
  font-size: 14px;
  background: #727272;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 50% !important;
  font-family: "Material Icons";
}

.controls-right .icon .auto-play.active::before {
  content: "\e037";
  left: 15px;
  font-family: "Material Icons";
}

.controls-right .icon .material-icons.settingsBtn {
  transition: 0.3s;
}

.controls-right .icon .settingsBtn.active {
  transform: rotate(45deg);
}
 
#video_player #captions,
#video_player #settings {
  position: absolute;
  right: 25px;
  bottom: 62px;
  background: rgb(28 28 28 / 90%);
  width: 200px;
  max-height: 250px;
  height: auto;
  color: #fff;
  overflow-y: auto;
  z-index: 20;
  display: none;
  border-radius: 5px;
}
 
#video_player #captions.active,
#video_player #settings.active {
  display: block;
}
 
#video_player #captions .caption span,
#video_player #settings > div > span {
  font-size: 14px;
  font-weight: 300;
  padding: 15px 30px;
  border-bottom: 1px solid rgb(83, 83, 83);
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
}
#video_player #settings > div .icon{
  font-size: 14px;
  margin: 0 5px;
  cursor: pointer;
}
#video_player #settings > div ul li span{
 pointer-events: none;
}

#video_player #captions .caption ul,
#video_player #settings > div ul {
  position: relative;
}

#video_player #captions .caption ul li,
#video_player #settings > div ul li {
  position: relative;
  width: 100%;
  cursor: pointer;
  text-align: left;
  padding: 12px 33px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

 #video_player #captions .caption ul li:hover,
 #video_player #settings > div ul li:hover {
  background: rgba(28, 28, 28, 0.9);
}

#video_player #captions .caption ul li.active::before,
#video_player #settings > div ul li.active::before {
  content: "\e876";
  font-family: "Material Icons";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  padding-right: 10px;
  font-size: 18px;
}

#video_player #captions::-webkit-scrollbar,
#video_player #settings::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}

#video_player #captions::-webkit-scrollbar-thumb,
#video_player #settings::-webkit-scrollbar-thumb {
  height: 20px;
  border: 2px solid transparent;
  background: rgba(83, 83, 83, 0.9);
  border-radius: 20px;
}


@media (max-width: 430px) {
  #video_player #captions, #video_player #settings {
    top: 0;
    bottom: 60px;
  }
  
  #video_player #captions .caption ul li, #video_player #settings > div ul li {
    padding: 9px 33px;
    font-size: 12px;
  }
  
  #cast-button {
    padding: 0;
    margin: 0;
  }
  
  #cast-button .material-icons {
    font-size: 18px !important;
  }
  
  #video_player .controls .progress-area {
    height: 3px;
  }  
  .controls .progress-area .progress-bar::before {
    width: 10px;
    height: 10px;
  }
  .controls img.logo {
    width: 50px !important;
    height: 50px !important;
  }
  .controls .controls-left .timer {
    font-size: 12px;
  }
  .controls .icon {
    margin-left: 5px;
    margin-right: 5px;
    font-size: 18px;
  }
  
  .controls .icon .material-icons {
    font-size: 18px;
    cursor: pointer;
  }

  .volume,
  .volume_range,
  .auto-play,
  .fast-forward,
  .picture_in_picutre  
   {
    display: none;
  }
}

#video_player:fullscreen {
  border-radius: 0 !important;
}

#video_player:fullscreen #sbs-canvas {
  border-radius: 0 !important;
}

#video_player:fullscreen video,
#video_player:fullscreen canvas {
  border-radius: 0 !important;
  overflow: hidden !important;
}

/* Règles pour les différents navigateurs */
#video_player:-webkit-full-screen,
#video_player:-webkit-full-screen *,
#video_player:-webkit-full-screen canvas,
#video_player:-moz-full-screen,
#video_player:-moz-full-screen *,
#video_player:-moz-full-screen canvas,
#video_player:-ms-fullscreen,
#video_player:-ms-fullscreen *,
#video_player:-ms-fullscreen canvas {
  border-radius: 0 !important;
  overflow: hidden !important;
}

iframe:fullscreen,
iframe:-webkit-full-screen,
iframe:-moz-full-screen,
iframe:-ms-fullscreen {
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

iframe:fullscreen video,
iframe:-webkit-full-screen video,
iframe:-moz-full-screen video,
iframe:-ms-fullscreen video,
iframe:fullscreen canvas,
iframe:-webkit-full-screen canvas,
iframe:-moz-full-screen canvas,
iframe:-ms-fullscreen canvas {
  border-radius: 0 !important;
}

.parent-div-selector:fullscreen,
.parent-div-selector:-webkit-full-screen,
.parent-div-selector:-moz-full-screen,
.parent-div-selector:-ms-fullscreen {
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

/* S'assurer que quand le container parent (iframe) est en fullscreen, 
   tous les éléments à l'intérieur n'ont pas de border-radius */
:fullscreen #sbs-canvas,
:-webkit-full-screen #sbs-canvas,
:-moz-full-screen #sbs-canvas,
:-ms-fullscreen #sbs-canvas {
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: crisp-edges !important;
}

/* Force aussi le conteneur video_player en fullscreen */
:fullscreen #video_player,
:-webkit-full-screen #video_player,
:-moz-full-screen #video_player,
:-ms-fullscreen #video_player {
  border-radius: 0 !important;
  overflow: hidden !important;
}

:fullscreen,
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen {
  border-radius: 0 !important;
}

:fullscreen video,
:-webkit-full-screen video,
:-moz-full-screen video,
:-ms-fullscreen video,
:fullscreen canvas,
:-webkit-full-screen canvas,
:-moz-full-screen canvas,
:-ms-fullscreen canvas {
  border-radius: 0 !important;
}

#settings {
  min-height: 200px;
  height: auto;
  max-height: 80vh;
  overflow-y: auto;
}

/* Styles pour les boutons SBS actifs */
#sbs-controls button.primary,
#sbs-controls button.active {
  background: var(--pColor, #f39c12) !important;
  border-color: var(--pColor, #f39c12) !important;
  color: #fff !important;
}

#sbs-controls button:hover {
  background: #444 !important;
  border-color: #666 !important;
}

/* Bouton Play centré */
.center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  width: 90px;
  height: 90px;
}
.center-play-btn:focus {
  outline: 2px solid var(--pColor, #ffae00);
}
.center-play-btn:hover {
  background: rgba(0,0,0,0.7);
}
.center-play-icon {
  font-size: 80px;
  color: var(--pColor);
  pointer-events: none;
}