/* Image lightbox preview styles */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  visibility: hidden;
  transition: background 200ms ease, opacity 200ms ease, visibility 0s linear 200ms;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.7);
  transition: background 200ms ease, opacity 200ms ease, visibility 0s linear 0s;
}

/* Glass container around image */
.lightbox-container {
  position: relative;
  max-width: 88vw;
  max-height: 88vh;
  padding: 1.2vw;
  border-radius: 0.6vw;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 0.5vw 3vw rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  transform: scale(0.96);
  transition: transform 200ms ease;
}

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

/* Top bar with close button and filename */
.lightbox-topbar {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  margin-bottom: 1vw;
}

.lightbox-close {
  width: 2vw;
  height: 1vw;
  min-width: 28px;
  min-height: 14px;
  border: none;
  border-radius: 0.5vw;
  background: radial-gradient(ellipse at 30% 25%, rgba(255, 120, 110, 0.3), rgba(200, 40, 30, 0.25) 50%, rgba(130, 15, 10, 0.35));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -1px 3px rgba(80, 0, 0, 0.2),
    0 1px 4px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: transparent;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
  flex-shrink: 0;
}

.lightbox-close:hover {
  transform: scale(1.12);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.3),
    inset 0 -1px 3px rgba(80, 0, 0, 0.25),
    0 2px 8px rgba(180, 30, 20, 0.3);
}

.lightbox-filename {
  font-family: 'LunchType Light', system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
  font-size: 1.05vw;
  margin-left: 0.4vw;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

/* Image wrapper — handles overflow when zoomed */
.lightbox-image-wrap {
  overflow: hidden;
  border-radius: 0.3vw;
  cursor: zoom-in;
  position: relative;
  max-height: calc(88vh - 4vw);
}

.lightbox-image-wrap.zoomed {
  cursor: zoom-out;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lightbox-image-wrap.zoomed::-webkit-scrollbar {
  display: none;
}

.lightbox-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 4vw);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: none;
}

.lightbox-image-wrap.zoomed img {
  max-width: none;
  max-height: none;
  width: 200%;
  cursor: zoom-out;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .lightbox-container {
    max-width: 96vw;
    max-height: 94vh;
    padding: 2.5vw;
    border-radius: 1.5vw;
  }

  .lightbox-close {
    width: 7vw;
    height: 3.5vw;
    font-size: 0;
    border-radius: 1.75vw;
  }

  .lightbox-filename {
    font-size: 2.5vw;
  }

  .lightbox-topbar {
    gap: 2vw;
    margin-bottom: 1.5vw;
  }

  .lightbox-image-wrap {
    max-height: calc(94vh - 14vw);
  }

  .lightbox-image-wrap img {
    max-height: calc(94vh - 14vw);
  }
}
