/*
 * Custom CSS for Gallery Lightbox System
 * This file contains all styles for the reusable gallery component
 */

/* Gallery Lightbox Modal */
.gallery-lightbox {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 99999 !important;
  background-color: rgba(0, 0, 0, 0.95) !important;
  display: none; /* Hidden by default */
}

.gallery-lightbox.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Gallery Thumbnails */
.gallery-thumb {
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Lightbox Image */
.lightbox-image {
  max-width: min(1800px, 95vw) !important;
  max-height: min(1200px, 90vh) !important;
  width: auto !important;
  height: auto !important;
  border: 8px solid white !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
}

/* Mobile adjustments for lightbox */
@media (max-width: 768px) {
  .lightbox-image {
    border: 4px solid white !important;
  }

  .gallery-lightbox {
    padding: 0.5rem !important;
  }

  .lightbox-close,
  .lightbox-prev,
  .lightbox-next {
    font-size: 1.5rem !important;
  }
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 100000; /* Above lightbox */
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: #ccc;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Image Counter */
.image-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

/* Simple Lightbox Styles for Residential Page */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.show {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: 4px solid white;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: #ccc;
}

.btn-lightbox {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.btn-lightbox:hover {
  background: rgba(0, 0, 0, 0.8);
}

.btn-lightbox.prev {
  left: 20px;
}

.btn-lightbox.next {
  right: 20px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .lightbox-close {
    font-size: 30px;
    top: 15px;
    right: 20px;
  }

  .btn-lightbox {
    font-size: 18px;
    padding: 8px 12px;
  }

  .btn-lightbox.prev {
    left: 10px;
  }

  .btn-lightbox.next {
    right: 10px;
  }

  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
    border: 2px solid white;
  }
}