.youtube-video.video-custom.video-with-play {
  position: relative;
  width: 100%;
  aspect-ratio: var(--dynamic-aspect-ratio, 16/9);
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  margin: 0 auto;
  /* Adding light border effect */
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 2px; /* Creates space for the inner border */
}

/* Additional inner border effect */
.youtube-video.video-custom.video-with-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 19px; /* 1px less than container */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 2;
}

.youtube-video.video-custom iframe {
  width: 100%;
  height: 100%;
  display: none; /* hidden until played */
  border-radius: 18px; /* Slightly smaller to account for border */
}

.youtube-video .video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 18px; /* Slightly smaller to account for border */
  background-color: #1a0a2e; /* Dark background for contain mode */
}

/* Default background size is cover */
.youtube-video .video-thumb {
  background-size: 100% 100%;
}

.youtube-video .custom-play-btn {
  cursor: pointer;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20; /* Higher than the inner border */
  width: 120px;
  height: 120px;
  transition: transform 0.3s ease;
}

.youtube-video .custom-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video loader styles */
.youtube-video .video-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 15;
  border-radius: 18px;
}

.youtube-video.loading .video-loader {
  opacity: 1;
  visibility: visible;
}

.youtube-video .loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #B3F13C;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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