/**
 * Native <dialog> based image viewer
 * Replaces PhotoSwipe with zero dependencies
 */

.image-viewer {
  --viewer-bg: rgba(0, 0, 0, 0.95);
  --viewer-btn-bg: rgba(255, 255, 255, 0.1);
  --viewer-btn-hover: rgba(255, 255, 255, 0.2);

  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: var(--viewer-bg);
  color: white;
  z-index: 9999;
  cursor: default;
}

.image-viewer::backdrop {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.image-viewer-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 60px 20px 20px;
}

.image-viewer img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-in;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  border-radius: 50%;
  background: var(--viewer-btn-bg);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.image-viewer-close:hover {
  background: var(--viewer-btn-hover);
  transform: scale(1.1);
}

.image-viewer-close:active {
  transform: scale(0.95);
}

.image-viewer-close svg {
  width: 24px;
  height: 24px;
}

/* Animation */
@keyframes viewer-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes viewer-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.image-viewer[open] {
  animation: viewer-fade-in 0.2s ease;
}

.image-viewer[open] img {
  animation: viewer-zoom-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .image-viewer-content {
    padding: 60px 10px 10px;
  }

  .image-viewer img {
    max-width: 100%;
    max-height: 100%;
  }

  .image-viewer-close {
    top: 10px;
    right: 10px;
  }
}