/* Custom Lightbox Gallery - Mobile Friendly */

.custom-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Loader */
.lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 203, 48, 0.2);
  border-top-color: #ffcb30;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Close Button */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lightbox-close:hover {
  background: #ffcb30;
  border-color: #ffcb30;
  color: #000;
  transform: rotate(90deg);
}

/* Navigation Buttons */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: #ffcb30;
  border-color: #ffcb30;
  color: #000;
}

.lightbox-prev:active,
.lightbox-next:active {
  transform: translateY(-50%) scale(0.95);
}

/* Counter */
.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .lightbox-content {
    padding: 15px;
  }

  .lightbox-image {
    max-height: calc(100vh - 120px);
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    font-size: 28px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 45px;
    height: 45px;
    font-size: 36px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-counter {
    bottom: 20px;
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .lightbox-content {
    padding: 10px;
  }

  .lightbox-image {
    max-height: calc(100vh - 100px);
  }

  .lightbox-close {
    top: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 32px;
    background: rgba(0, 0, 0, 0.6);
  }

  .lightbox-prev {
    left: 5px;
  }

  .lightbox-next {
    right: 5px;
  }

  .lightbox-counter {
    bottom: 15px;
    padding: 6px 14px;
    font-size: 13px;
  }
}

/* Touch feedback for mobile */
@media (hover: none) and (pointer: coarse) {
  .lightbox-close:active,
  .lightbox-prev:active,
  .lightbox-next:active {
    background: #ffcb30;
    border-color: #ffcb30;
    color: #000;
  }
}

/* Prevent scrolling when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}
