/* ANCHOR: image_viewer_styles */
/* FSD: shared/ui/image-viewer → Fullscreen image viewer styling */
/* SCALED FOR: Smooth animations and responsive design */
/* UPDATED COMMENTS: Dark overlay with centered image at 95% screen size */

.image-viewer {
  /* CRITICAL: Fullscreen overlay positioning */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  
  /* UPDATED COMMENTS: Hidden by default, shown with --visible class */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ANCHOR: visible_state */
.image-viewer--visible {
  opacity: 1;
  visibility: visible;
}

/* ANCHOR: overlay */
.image-viewer__overlay {
  /* CRITICAL: Dark background overlay */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

/* ANCHOR: container */
.image-viewer__container {
  /* CRITICAL: Centered container for image */
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5vh 2.5vw;
  pointer-events: none;
}

/* ANCHOR: image */
.image-viewer__image {
  /* CRITICAL: Image at 95% of screen size */
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  
  /* UPDATED COMMENTS: Smooth rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  
  /* SCALED FOR: Smooth fade-in */
  animation: imageViewerFadeIn 0.3s ease;
  pointer-events: auto;
}

/* ANCHOR: close_button */
.image-viewer__close {
  /* REUSED: Same styling as page-close from modal-system.css */
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  
  /* UPDATED COMMENTS: Button styling matching page-close */
  width: var(--button-size, 72px);
  height: var(--button-size, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* REUSED: Same background as page-close */
  background: var(--button-bg-dark, rgba(0, 0, 0, 0.5));
  backdrop-filter: var(--button-blur, blur(2px));
  -webkit-backdrop-filter: var(--button-blur, blur(2px));
  
  border: none;
  border-radius: 999px;
  cursor: pointer;
  
  /* SCALED FOR: Smooth transitions */
  transition: opacity 0.3s ease-out, background 0.2s ease;
  pointer-events: auto;
  
  /* CRITICAL: Above overlay */
  z-index: 1;
  
  /* UPDATED COMMENTS: Hidden by default, shown with --visible class */
  opacity: 0;
}

/* UPDATED COMMENTS: Visible state - simple fade-in */
.image-viewer__close--visible {
  opacity: 1;
}

.image-viewer__close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.image-viewer__close:active {
  transform: translateY(-50%) scale(0.95);
}

.image-viewer__close:focus {
  outline: none;
}

.image-viewer__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.image-viewer__close img {
  width: var(--button-icon-size, 40px);
  height: var(--button-icon-size, 40px);
  color: #FFFFFF;
  fill: #FFFFFF;
  flex: none;
}

/* ANCHOR: animations */
@keyframes imageViewerFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ANCHOR: responsive */
/* UPDATED COMMENTS: Mobile adjustments */
@media (max-width: 768px) {
  .image-viewer__close {
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .image-viewer__close svg {
    width: var(--button-icon-size-mobile, 22px);
    height: var(--button-icon-size-mobile, 22px);
  }
  
  .image-viewer__container {
    padding: 5vh 5vw;
  }
  
  .image-viewer__image {
    max-width: 90vw;
    max-height: 90vh;
  }
}
