/* Gallery container styling */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: #000;
  border: 1px solid rgba(241, 195, 109, 0.15);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: #f1c36d;
  box-shadow: 0 8px 25px rgba(241, 195, 109, 0.25);
}

.gallery-img-wrapper {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
  border-radius: 7px;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.08);
}

/* Lightbox overlay styling */
.dex-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 11000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.dex-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content-wrapper {
  position: relative;
  max-width: 85%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 2px solid rgba(241, 195, 109, 0.3);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.lightbox-img.loaded {
  opacity: 1;
}

.lightbox-caption {
  color: #ffffffd0;
  margin-top: 15px;
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Control buttons styling */
.lightbox-btn {
  position: absolute;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(241, 195, 109, 0.3);
  color: #f1c36d;
  font-size: 1.8rem;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  z-index: 11010;
}

.lightbox-btn:hover {
  background: #f1c36d;
  color: #141414;
  border-color: #f1c36d;
  box-shadow: 0 0 15px rgba(241, 195, 109, 0.5);
}

.lightbox-close {
  top: 30px;
  right: 30px;
}

.lightbox-prev {
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
}

/* Responsive styles for lightbox buttons on smaller screens */
@media (max-width: 768px) {
  .lightbox-btn {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  .lightbox-prev {
    left: 15px;
  }
  .lightbox-next {
    right: 15px;
  }
  .lightbox-close {
    top: 15px;
    right: 15px;
  }
  .gallery-img-wrapper {
    height: 200px;
  }
}

/* Smooth loading indicator */
.lightbox-loader {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(241, 195, 109, 0.2);
  border-radius: 50%;
  border-top-color: #f1c36d;
  animation: spin 1s ease-in-out infinite;
  z-index: 11005;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
