/* Core Overlay */

/* Placeholder Skeleton */
.thumb-luxe {
    background-color: #1a1a1a;
    position: relative;
    width: 100%;
    /* This prevents jumpiness */
}

.lazy-thumb {
    opacity: 0;
    transition: opacity 0.6s ease-out;
    width: 100%;
    height: auto;
    display: block;
}

.lazy-thumb.loaded {
    opacity: 1;
}

/* Optional: Subtle pulse for the placeholder */
.thumb-luxe:not(:has(.loaded))::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: skeleton-shimmer 2s infinite;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.lb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* Higher than Bootstrap navbar */
  overflow: hidden;
  
  /* State for transitions */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none; /* Prevents clicking when hidden */
}

/* Class to show overlay */
.lb-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lb-overlay img.lb-img {
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  
  /* Hardware acceleration hints */
  will-change: transform;
  transition: transform 0.1s linear; /* Fast response for drag */
}

.lb-overlay img.lb-img.zoomed {
  cursor: grab;
  max-width: none;
  max-height: none;
}

.lb-overlay img.lb-img.grabbing {
  cursor: grabbing; 
}

.lb-video-btn {
    position: absolute;
    top: 20px;
    left: 20px; /* Opposite of the close button */
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 5%;
    width: 150px;
    height: 50px;
    cursor: pointer;
    z-index: 1100;
    display: flex;
	gap: 12px !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lb-video-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lb-video-btn i {
    font-size: 1.8rem; /* Adjust to match your UI size */
    color: white;
    vertical-align: middle;
}

.lb-video-btn:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.lb-video {
    max-width: 95vw;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    background: #000;
    position: relative;
    z-index: 1005; /* High enough to be above the overlay but below your close button */
}

/* Fix for Webkit/Chrome: sometimes controls get hidden by layout overflows */
video::-webkit-media-controls-panel {
    display: flex !important;
    opacity: 1 !important;
}

video::-webkit-media-controls {
    display: flex !important;
}

/* Ensure your overlay doesn't have "pointer-events: none" on the video */
.lb-overlay.show {
    pointer-events: auto;
}

/* Loader */
.lb-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2001;
  display: none; /* Controlled via JS */
}

.lb-loader.active {
  display: block;
}

/* Controls */
.lb-prev, .lb-next, .lb-close {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2002;
  transition: opacity 0.2s;
  padding: 10px; /* Increase hit area for mobile */
}

.lb-prev:hover, .lb-next:hover, .lb-close:hover { opacity: 0.7; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { bottom: 30px; left: 20px; }
.lb-next { bottom: 30px; right: 20px; }

/* Caption */
.lb-caption {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 2002;
  pointer-events: none; /* Allow clicks to pass through to image/overlay */
  opacity: 0;
  transition: opacity 0.3s;
}

.lb-caption.visible {
  opacity: 1;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
  .lb-prev img, .lb-next img, .lb-close img { width: 24px; height: 24px; }
  .lb-caption { font-size: 0.8rem; bottom: 60px; width: 90%; }
  /* Move buttons up slightly on mobile to avoid bottom bezel gesture conflict */
  .lb-prev, .lb-next { bottom: 15px; } 
}