.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease-in-out;
  margin-bottom: 20px;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lightbox-img.loaded,
.lightbox.active .lightbox-img {
  opacity: 1;
}

.lightbox-caption {
  color: #ffffff;
  font-size: 1.2rem;
  text-align: center;
  margin-top: 20px;
  max-width: 80%;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease-in-out;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  transform: translateY(-50%);
  z-index: 10;
}

.lightbox-nav-btn {
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease-in-out;
}

.lightbox-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Handle scrolling */
body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
  }
  
  .lightbox-caption {
    font-size: 1rem;
  }
}