/* public/css/gallery/lightbox.css */

/* ============================================
   LIGHTBOX OVERLAY
   ============================================ */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  flex-direction: column;
}

.lb-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Dark mode overlay */
.dark .lb-overlay {
  background: rgba(15, 23, 42, 0.98);
}

/* ============================================
   TOOLBAR
   ============================================ */
.lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  z-index: 10;
}

.dark .lb-toolbar {
  background: rgba(15, 23, 42, 0.95);
}

.lb-toolbar-left,
.lb-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lb-counter {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  padding: 0 12px;
  white-space: nowrap;
}

/* ============================================
   TOOLBAR BUTTONS
   ============================================ */
.lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.lb-btn:active {
  transform: scale(0.95);
}

.lb-btn svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.lb-btn.active {
  color: #10b981;
}

.lb-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 100;
}

.lb-btn:hover[title]::after {
  opacity: 1;
  visibility: visible;
}

/* Quote button in cart state */
.lb-btn-quote.in-cart {
  color: #10b981;
}

/* ============================================
   SLIDESHOW PROGRESS BAR
   ============================================ */
.lb-slideshow-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #3b82f6;
  width: 0;
  transition: width linear;
  opacity: 0;
}

.lb-btn-slideshow.playing .lb-slideshow-progress {
  opacity: 1;
}

/* ============================================
   MAIN IMAGE CONTAINER
   ============================================ */
.lb-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.lb-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.lb-image {
  max-width: 90%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-image.loaded {
  opacity: 1;
}

.lb-image.zoomed {
  cursor: move;
  max-width: none;
  max-height: none;
}

/* Image loading spinner */
.lb-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: lb-spin 0.8s linear infinite;
}

@keyframes lb-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   NAVIGATION ARROWS
   ============================================ */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e2e8f0;
  z-index: 10;
}

.lb-nav:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.lb-nav-prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.lb-nav-next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.lb-nav svg {
  width: 32px;
  height: 32px;
}

/* Hide nav arrows on mobile */
@media (max-width: 768px) {
  .lb-nav {
    display: none;
  }
}

/* ============================================
   CAPTION AREA
   ============================================ */
.lb-caption {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  flex-shrink: 0;
}

.dark .lb-caption {
  background: rgba(15, 23, 42, 0.95);
}

.lb-caption-title {
  color: #f1f5f9;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 4px 0;
}

.lb-caption-text {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   THUMBNAIL STRIP
   ============================================ */
.lb-thumbs-container {
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 0;
  flex-shrink: 0;
}

.dark .lb-thumbs-container {
  background: rgba(15, 23, 42, 0.95);
}

.lb-thumbs-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lb-thumbs-wrapper::-webkit-scrollbar {
  height: 6px;
}

.lb-thumbs-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.lb-thumbs-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.lb-thumbs {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  width: max-content;
}

.lb-thumb {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.lb-thumb:hover {
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.3);
}

.lb-thumb.active {
  opacity: 1;
  border-color: #3b82f6;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.lb-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: lb-toast-in 0.3s ease;
}

.lb-toast.success {
  background: #10b981;
  color: white;
}

.lb-toast.info {
  background: #3b82f6;
  color: white;
}

.lb-toast.warning {
  background: #f59e0b;
  color: white;
}

@keyframes lb-toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */
.lb-overlay.fullscreen .lb-toolbar,
.lb-overlay.fullscreen .lb-caption,
.lb-overlay.fullscreen .lb-thumbs-container {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lb-overlay.fullscreen:hover .lb-toolbar,
.lb-overlay.fullscreen:hover .lb-caption,
.lb-overlay.fullscreen:hover .lb-thumbs-container {
  opacity: 1;
  pointer-events: auto;
}

.lb-overlay.fullscreen .lb-image {
  max-width: 100%;
  max-height: 100%;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .lb-toolbar {
    padding: 8px 12px;
  }
  
  .lb-btn {
    width: 40px;
    height: 40px;
  }
  
  .lb-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .lb-counter {
    font-size: 12px;
    padding: 0 8px;
  }
  
  .lb-caption {
    padding: 12px 16px;
  }
  
  .lb-caption-title {
    font-size: 16px;
  }
  
  .lb-caption-text {
    font-size: 13px;
  }
  
  .lb-thumb {
    width: 60px;
    height: 45px;
  }
  
  .lb-image {
    max-width: 100%;
  }
  
  /* Hide zoom button on mobile */
  .lb-btn-zoom {
    display: none;
  }
}