/* YouTube Video Highlight Link Styles */
.youtube-highlight {
  position: fixed; /* Changed from absolute to fixed to stay in place while scrolling */
  bottom: 30px;
  right: 30px;
  z-index: 100; /* Increased z-index to ensure it stays above all content */
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid #d4af37;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  max-width: 300px;
  text-decoration: none;
}

.youtube-highlight:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  border-color: #e5c158;
}

.highlight-video-container {
  width: 150px;
  height: 100px;
  position: relative;
  overflow: hidden;
}

.highlight-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.highlight-thumbnail {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: none; /* Hidden when video is playing */
}

.highlight-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background-color: rgba(212, 175, 55, 0.8);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.highlight-info {
  padding: 8px 12px;
  color: #fff;
}

.highlight-info h4 {
  font-size: 12px;
  margin: 0 0 5px;
  font-weight: 600;
  color: #d4af37;
}

.highlight-info p {
  font-size: 10px;
  margin: 0;
  opacity: 0.8;
}

/* YouTube button shown on hover */
.youtube-button {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background-color: #ff0000;
  color: white;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 8px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.youtube-button i {
  margin-right: 2px;
}

.highlight-video-container:hover .youtube-button {
  opacity: 1;
}

/* Manual play button for browsers that block autoplay */
.manual-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(212, 175, 55, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  font-size: 14px;
  transition: all 0.2s ease;
}

.manual-play-button:hover {
  background-color: rgba(212, 175, 55, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Fixed position adjustments for different page sections */
.hero + * .youtube-highlight {
  opacity: 0.9; /* Slightly transparent when scrolled past hero */
}

/* Freeze effect when scrolling */
.video-frozen {
  transition: filter 0.1s ease;
  filter: brightness(0.9) contrast(1.1) saturate(1.1);
}

.video-frozen .highlight-video {
  /* Additional filter for the video element */
  filter: brightness(0.95);
}

/* Add a subtle overlay to indicate the video is paused */
.video-frozen .highlight-video-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  pointer-events: none;
  z-index: 1;
}

/* Add a subtle pause icon when frozen */
.video-frozen .highlight-video-container::before {
  content: '❙❙';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  z-index: 2;
  opacity: 0.7;
  pointer-events: none;
}

/* Special animation for initial appearance */
@keyframes videoFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply animation when video is loaded */
.highlight-video.playing {
  animation: none; /* Remove any animations once playing */
}

/* Show youtube-highlight only on door.html page */
body:not(.door-page) .youtube-highlight {
  display: none !important;
}

.youtube-highlight {
  animation: videoFadeIn 1s ease-out 1s forwards;
}

/* Responsive styles */
@media (max-width: 768px) {
  .youtube-highlight {
    bottom: 70px;
    right: 20px;
    max-width: 240px;
  }

  .highlight-video-container {
    width: 120px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .youtube-highlight {
    bottom: auto;
    right: 10px;
    top: 100px;
    max-width: 180px;
  }

  .highlight-video-container {
    width: 90px;
    height: 60px;
  }

  .play-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .highlight-info {
    padding: 5px 8px;
  }

  .highlight-info h4 {
    font-size: 10px;
  }

  .highlight-info p {
    font-size: 8px;
  }
}
