/* Lesson page styling */


.lesson-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background-color: #FFF;
  padding:60px;
  overflow: hidden;
  margin-top: 0; /* Remove top margin to allow overlay */
  border-radius: 20px;
}





/* Make header overlay the video */
.mainheader {

  z-index: 1100;
}

/* Custom Plyr controls styling to match the image */
.plyr {
  height: 100vh;
  position: relative;
  z-index: 5; /* Lower than overlay */
  border-radius: 20px;
  overflow: hidden;
}

.lesson-player,
#lesson-player {
  z-index: 5;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.lesson-player {
  width: 100%;
}

.plyr__video-wrapper {
  z-index: 5;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.plyr__controls {
  z-index: 1050 !important;
  position: relative;
}

.plyr__control--overlaid {
  z-index: 1050;
}

.plyr--video {
  height: 100%;
}

video
{
  object-fit: cover;
}

.plyr__control--overlaid {
  background: rgba(255, 255, 255, 0.8);
}

.plyr--full-ui.plyr--video .plyr__control--overlaid {
  display: flex;
}

/* Customize the control bar */
.plyr__controls {
  padding: 15px 15px !important;
  width:95%;
  position:absolute;
  height:100%;
  top:0;
  bottom:auto;
  margin:0 auto 25px auto;
  background: transparent !important;
}

/* Video title */
.video-title {
  position: absolute;
  bottom: 150px;
  pointer-events: none;
  padding-left:60px;
  color: white;
  font-size: 28px;
  font-weight: 500;
  z-index: 1000;
  font-family: var(--font-inter, sans-serif);
  transition: opacity 0.2s ease;
}

.lesson-slide-content .video-title {
  bottom: 25px;
  font-size: 18px;
  display: block;
  width: calc(100% - 160px);
}

.video-subtitle {
  position: absolute;
  bottom: 190px;
  pointer-events: none;
  padding-left:60px;
  color: white;
  z-index: 1000;
  transition: opacity 0.2s ease;
}

.lesson-slide-content .video-subtitle {
  bottom: 55px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .lesson-slide-content .video-title {
    bottom: 98px;
    text-align: center;
    left: 0;
    padding: 0;
    right: 0;
  }
  .lesson-slide-content .video-subtitle {
    bottom: 130px;
    text-align: center;
    left: 0;
    padding: 0;
    right: 0;
  }
}

/* Custom time display */
.plyr__time {
  font-weight: normal;
  color: rgba(255, 255, 255, 0.8);
  padding: 0;
  display: inline-block !important;
}

.plyr__time--current {
  margin: 0;
  padding: 0 !important;
  display: inline-block !important;
  position: absolute;
  bottom: 20px;
  left: 2.5%;
}

.plyr__time--duration {
  margin: 0;
  padding: 0 !important;
  display: inline-block !important;
  position: absolute;
  bottom: 20px;
  right: 2.5%;
}

/* Space between controls */
.plyr__controls .plyr__control {
  margin-right: 5px;
}

/* Make progress bar thicker */
.plyr--full-ui input[type=range] {
  height: 6px;
}

/* Customize progress bar color */
.plyr--full-ui input[type=range]::-webkit-slider-runnable-track {
  background-color: rgba(255, 255, 255, 0.25);
}

.plyr--full-ui input[type=range]::-moz-range-track {
  background-color: rgba(255, 255, 255, 0.25);
}

.plyr--full-ui input[type=range]::-ms-track {
  background-color: rgba(255, 255, 255, 0.25);
}

.plyr--full-ui input[type=range]::-webkit-slider-thumb {
  background: #fff;
}

.plyr--full-ui input[type=range]::-moz-range-thumb {
  background: #fff;
}

.plyr--full-ui input[type=range]::-ms-thumb {
  background: #fff;
}

/* Played progress color */
.plyr__progress input[type=range]::-webkit-slider-runnable-track {
  background-image: linear-gradient(to right, white var(--value, 0%), transparent var(--value, 0%));
}

.plyr__progress input[type=range]::-moz-range-track {
  background-image: linear-gradient(to right, white var(--value, 0%), transparent var(--value, 0%));
}

.plyr__progress input[type=range]::-ms-track {
  background-image: linear-gradient(to right, white var(--value, 0%), transparent var(--value, 0%));
}

/* Fullscreen button positioning */
.plyr__control[data-plyr="fullscreen"] {
  margin-right: 0;
  position:absolute;
  bottom:70px;
  right:2.5%;
}

.plyr__progress__container {
  bottom: 50px;
  position: absolute;
  width: 95%;
  left: 2.5%;
}

/* Progress bar markers */
.plyr__progress__marker {
  -webkit-appearance: none;
  background-color: #fff;
  border: 0;
  height: 4px;
  margin-top: 0px;
  position: absolute;
  top: 50%;
  width: 3px;
  z-index: 3;
}

/* Time separator styling */
.plyr__time-divider {
  display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
  .lesson-hero {
    height: auto;
    padding: 0;
    margin-top: 60px;
    border-radius: 0;
  }

  .plyr__video-wrapper {
    height: auto;
    border-radius: 0;
  }
  
  .plyr--video {
    height: auto;
    border-radius: 0;
  }

  .plyr {
    height: auto;
    border-radius: 0;
  }
  
  .lesson-player,
  #lesson-player {
    border-radius: 0;
  }
  
  .video-title {
    font-size: 18px;
    bottom: 100px;
    width:90%;
    padding-left:15px;
    margin:0 auto;
    display:none;
  }
  .plyr__controls {
    width:95%;
    margin-bottom:0px;
  }
}

@media (max-width: 576px) {
  .plyr__time--current,
  .plyr__time--duration {
    display: inline-block !important;
  }
  
  .video-title {
    font-size: 16px;
    bottom: 60px;
  }
} 

/* Volume control in top right corner */
.plyr__volume {
  position: absolute !important;
  top: 20px !important;
  right: 0px !important;
  background: #333 !important;
  border-radius: 8px !important;
  padding: 8px 15px !important;
  z-index: 1100 !important;
  pointer-events: auto !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

.plyr__volume input[data-plyr="volume"] {
  display: block !important;
  width: 100px;
  height: 8px;
  margin: 0;
  transform: none;
  position: relative;
  top: 0;
  right: 0;
}

/* Responsive styles for volume control */
@media (max-width: 768px) {
  .plyr__volume {
    top: 10px !important;
    right: 10px !important;
    padding: 6px 10px !important;
  }
  
  .plyr__volume input[data-plyr="volume"] {
    width: 70px;
  }
}


/* iOS specific video fixes */
@supports (-webkit-touch-callout: none) {
  .lesson-player,
  #lesson-player {
    object-fit: contain !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100vh !important;
    position: relative !important;
  }
  
  .plyr--video {
    width: 100% !important;
    height: auto !important;
  }
  
  .plyr__video-wrapper {
    width: 100% !important;
    height: auto !important;
  }
  
  /* Ensure video is visible on iOS and displays full width */
  .lesson-hero {
    height: auto !important;
    min-height: 50vh !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  /* Fix for iOS play button positioning */
  .plyr__control--overlaid {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
  }
  
  /* Overlay for iOS tapping */
  #ios-video-tap {
    background-color: rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #ios-video-tap:after {
    content: "Tap to play";
    color: white;
    font-size: 20px;
    padding: 10px 20px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 5px;
  }
  
  /* iOS specific fixes for video title and subtitle visibility */
  .lesson-slide-content .video-title {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1001 !important;
  }
  
  .lesson-slide-content .video-subtitle {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1001 !important;
  }
  
  /* Ensure video title and subtitle are visible on iOS before video plays */
  .lesson-slide .lesson-player-wrapper .video-title,
  .lesson-slide .lesson-player-wrapper .video-subtitle {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1001 !important;
  }
  
  /* Allow hiding during playback - remove !important for opacity */
  .lesson-slide .lesson-player-wrapper .video-title[style*="opacity: 0"],
  .lesson-slide .lesson-player-wrapper .video-subtitle[style*="opacity: 0"] {
    opacity: 0 !important;
  }
  
  .lesson-slide-content .video-title[style*="opacity: 0"],
  .lesson-slide-content .video-subtitle[style*="opacity: 0"] {
    opacity: 0 !important;
  }
  
  /* iOS specific classes for visibility control */
  .ios-visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1001 !important;
  }
  
  .ios-hidden {
    opacity: 0 !important;
  }
}

/* Position the central controls container */
.plyr__central-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 10px 20px;
  z-index: 1060;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Hide central controls when not hovering over the player */
.plyr:not(.plyr--stopped):not(:hover) .plyr__central-controls {
  opacity: 0;
  pointer-events: none;
}

/* Style the control buttons */
.plyr__central-controls .plyr__control {
  opacity: 1;
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Style the play button larger than rewind/forward */
.plyr__central-controls .plyr__control[data-plyr="play"] {
  transform: scale(1.5);
  margin: 0 20px;
  color: white;
}

/* Style the rewind and fast-forward buttons as circular icons with 10 in the middle */
.plyr__central-controls .plyr__control[data-plyr="rewind"],
.plyr__central-controls .plyr__control[data-plyr="fast-forward"] {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  opacity:.8;
}

.plyr__central-controls .plyr__control[data-plyr="rewind"] {
  background-image: url('../images/icon/rewind.svg');
}

.plyr__central-controls .plyr__control[data-plyr="fast-forward"] {
  background-image: url('../images/icon/ff.svg');
}


/* Hide the original SVG icons */
.plyr__central-controls .plyr__control[data-plyr="rewind"] svg,
.plyr__central-controls .plyr__control[data-plyr="fast-forward"] svg {
  display: none;
}




/* Hover effects for the central controls */
.plyr__central-controls .plyr__control:hover {
}


/* Style the rewind and fast-forward buttons */

/* Make the central controls responsive */
@media (max-width: 768px) {
  .plyr__central-controls {
    padding: 8px 15px;
  }
  
  .plyr__central-controls .plyr__control[data-plyr="play"] {
    margin: 0 15px;
    transform: scale(1.2);
  }
  
  .plyr__central-controls .plyr__control[data-plyr="play"]:hover {
    transform: scale(1.3);
  }

  
  .plyr__central-controls .plyr__control[data-plyr="rewind"],
  .plyr__central-controls .plyr__control[data-plyr="fast-forward"] {
    width: 30px;
    height: 30px;
  }
  
  .plyr__central-controls .plyr__control[data-plyr="rewind"]::after,
  .plyr__central-controls .plyr__control[data-plyr="fast-forward"]::after {
    font-size: 12px;
  }
}

/* Ensure the central controls don't get affected by global hover styles */
.plyr__central-controls .plyr__control:hover {

  color: white !important;
  transform: none;
  box-shadow: none !important;
}

.plyr__central-controls .plyr__control[data-plyr="play"]:hover {
  background: transparent !important;
  color: white !important;
  transform: scale(1.1);
  box-shadow: none !important;
}

.plyr__central-controls .plyr__control[data-plyr="rewind"]:hover,
.plyr__central-controls .plyr__control[data-plyr="fast-forward"]:hover {
  transform: scale(1.1);
  opacity: 1;
  box-shadow: none !important;
}

.plyr__central-controls .plyr__control[data-plyr="rewind"]:hover
{
  background: url('../images/icon/rewind.svg') no-repeat center center;
}

.plyr__central-controls .plyr__control[data-plyr="fast-forward"]:hover
{
  background: url('../images/icon/ff.svg') no-repeat center center;
}

/* Controls visibility on inactivity */
.plyr.controls-hidden .plyr__controls,
.plyr.controls-hidden .plyr__central-controls,
.plyr.controls-hidden .plyr__volume {
  opacity: 0 !important;
  pointer-events: none;
}

.plyr.controls-hidden .plyr__central-controls {
  transform: translateY(20px);
}

/* Ensure smooth transitions for all controls */
.plyr__controls,
.plyr__central-controls,
.plyr__volume {
  transition: opacity 0.2s ease !important;
}

/* Lesson more button with smooth transition */
.lesson-more-btn {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lesson-more-btn:hover {
  transform: scale(1.05);
}

