/* Lightbox styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  height: 100vh;
  max-height: 100vh;
  width: auto;
  max-width: min(90vw, 100%);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #f1f1f1;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10000;
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #f1f1f1;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 10000;
}

@media (max-width: 768px) {
  .lightbox-close {
    top: 10px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 30px;
  }

  .lightbox-nav {
    width: 50px;
    height: 50px;
    font-size: 24px;
    padding: 12px;
  }

  .lightbox-prev {
    left: 15px;
  }

  .lightbox-next {
    right: 15px;
  }

  .lightbox-counter {
    bottom: 10px;
    font-size: 14px;
    padding: 6px 12px;
  }

  .lightbox-controls {
    top: 10px;
    right: 80px;
    gap: 6px;
  }

  .lightbox-zoom-in,
  .lightbox-zoom-out,
  .lightbox-reset {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* Lightbox zoom controls */
.lightbox-controls {
  position: absolute;
  top: 20px;
  right: 120px;
  display: flex;
  gap: 8px;
  z-index: 1002;
}

.lightbox-zoom-in,
.lightbox-zoom-out,
.lightbox-reset {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.lightbox-zoom-in:hover,
.lightbox-zoom-out:hover,
.lightbox-reset:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.lightbox-zoom-in:active,
.lightbox-zoom-out:active,
.lightbox-reset:active {
  transform: scale(0.95);
}

/* Enhanced lightbox image with zoom support */
.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  transition: transform 0.3s ease;
  cursor: grab;
}

.lightbox-image:active {
  cursor: grabbing;
}

/* Dark mode styles for zoom controls */
[data-theme="dark"] .lightbox-zoom-in,
[data-theme="dark"] .lightbox-zoom-out,
[data-theme="dark"] .lightbox-reset {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

[data-theme="dark"] .lightbox-zoom-in:hover,
[data-theme="dark"] .lightbox-zoom-out:hover,
[data-theme="dark"] .lightbox-reset:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Optimize image loading */
img[loading="lazy"] {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
