/* Custom YouTube Video Player Overlay */

.custom-yt-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
  overflow: hidden;
}

.custom-yt-player .yt-player-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.custom-yt-player .yt-player-iframe iframe {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* When controls are not hovered, allow click on the video area for play/pause */
.custom-yt-player .yt-click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 48px);
  z-index: 2;
  cursor: pointer;
}

/* Big centered play button for initial state */
.custom-yt-player .yt-big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 68px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.custom-yt-player .yt-big-play:hover {
  background: rgba(200, 0, 0, 0.85);
}

.custom-yt-player .yt-big-play i {
  color: #fff;
  font-size: 22px;
  margin-left: 3px;
}

.custom-yt-player.yt-playing .yt-big-play {
  display: none;
}

/* Controls bar */
.yt-custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  padding: 0 10px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-yt-player:hover .yt-custom-controls,
.custom-yt-player.yt-paused .yt-custom-controls {
  opacity: 1;
}

/* Buttons */
.yt-custom-controls button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  outline: none;
  flex-shrink: 0;
  line-height: 1;
}

.yt-custom-controls button:hover {
  color: #e0e0e0;
}

/* Time display */
.yt-ctrl-time {
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  padding: 0 8px;
  flex-shrink: 0;
  font-family: monospace;
}

/* Seek bar */
.yt-ctrl-seek-wrapper {
  flex: 1;
  padding: 0 6px;
  display: flex;
  align-items: center;
}

.yt-ctrl-seek {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: height 0.15s;
}

.yt-ctrl-seek:hover {
  height: 6px;
}

.yt-ctrl-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

.yt-ctrl-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

/* Volume */
.yt-ctrl-volume-wrapper {
  width: 70px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.yt-ctrl-volume {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.yt-ctrl-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

.yt-ctrl-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

/* Fullscreen */
.custom-yt-player.yt-fullscreen,
.custom-yt-player:fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding-bottom: 0;
  z-index: 99999;
  overflow: visible;
}

.custom-yt-player.yt-fullscreen .yt-custom-controls,
.custom-yt-player:fullscreen .yt-custom-controls {
  opacity: 1;
}

/* Lesson locked placeholder */
.lesson-locked-placeholder {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 20px;
}

.locked-overlay i {
  margin-bottom: 15px;
  opacity: 0.8;
}

.locked-overlay p {
  font-size: 16px;
  margin-bottom: 20px;
  max-width: 400px;
  opacity: 0.9;
}

.locked-overlay .btn-theme {
  display: inline-block;
  padding: 10px 30px;
  background: #e74c3c;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.locked-overlay .btn-theme:hover {
  background: #c0392b;
  color: #fff;
}

/* Lesson lock badge in teaser/course listing */
.lesson-lock-badge {
  display: inline-block;
  color: #e74c3c;
  font-size: 13px;
  margin-left: 6px;
  vertical-align: middle;
}

.lesson-lock-badge i {
  vertical-align: middle;
}

.lesson-block.lesson-restricted {
  opacity: 0.85;
}

/* Lesson navigation sidebar */
.course-back-link {
  display: block;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 0;
  color: #374F99;
  border-bottom: 2px solid #374F99;
  margin-bottom: 8px;
}

.course-back-link i {
  margin-right: 4px;
}

.lesson-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-nav-item {
  border-bottom: 1px solid #eee;
}

.lesson-nav-item a {
  display: block;
  padding: 8px 4px 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  text-decoration: none;
  transition: background 0.15s;
}

.lesson-nav-item a:hover {
  background: #f5f5f5;
  color: #374F99;
}

.lesson-nav-item.is-active a {
  background: #e8edf7;
  color: #374F99;
  font-weight: 600;
  border-left: 3px solid #374F99;
  padding-left: 9px;
}

/* Related lessons carousel: hide arrows when 4 or fewer items */
.related-lessons-block .jcarousel-control-prev,
.related-lessons-block .jcarousel-control-next {
  display: none !important;
}

.related-lessons-block:has(li:nth-child(5)) .jcarousel-control-prev,
.related-lessons-block:has(li:nth-child(5)) .jcarousel-control-next {
  display: block !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .yt-ctrl-volume-wrapper {
    display: none;
  }

  .yt-ctrl-time {
    font-size: 11px;
  }

  .yt-custom-controls {
    padding: 0 5px;
  }
}
