/* Edit Styles */
.upload-section {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  margin-bottom: 20px;
  background-color: #f9f9f9;
}

input#file-upload-button {
  background: none;
}


.selected-images, .saved-images {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.selected-images .card {
  width: 30%;
}

.saved-images .card {
  width: 24%;
}

/* View Styles */
.image-gallery-container-wrapper button svg {
  pointer-events: none;
}

.image-gallery-container-wrapper .controls {
  gap: .8rem;
}

.image-gallery-container-wrapper .controls button {
  padding: 12px 24px;
  background-color: #333;
  color: #fff;
  font-weight: 700;
}

.image-gallery-container-wrapper button:not(:disabled):hover,
.image-gallery-container-wrapper button:not(:disabled):focus-visible {
  outline: 4px solid #4079BA;
  outline-offset: -4px;
}


.image-gallery-container-wrapper .controls button:disabled {
  background-color: #ccc;
  color: #111;
  cursor: not-allowed;
}

.image-gallery-container-wrapper .controls button:disabled svg {
  transform: none;
}

.image-gallery-container {
  position: relative;
  max-width: 1000px;
  display: flex;
  gap: .5rem;
  margin: 0;
  margin-inline: auto;
  background: none;
  border-radius: 15px;
  overflow: hidden;
  scroll-behavior: smooth;
}

.image-gallery-container button {
  max-width: 270px;
  aspect-ratio: 1;
  display: block;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: linear-gradient(45deg,rgba(239, 239, 239, 1) 60%, rgba(245, 245, 244, 1) 91%);
  border-radius: 15px;
  position: relative;
  
  /* Force each slide to GPU */
  transform: translateZ(0); 
}

.image-gallery-container button span {
  position: absolute;
  bottom: 1rem;
  right: 10px;
  background-color: #333;
  padding: .2rem .5rem;
  border-radius: 5px;
  color: #fff;
  opacity: 0;
  transition: all .3s ease-in-out;
}

.image-gallery-container button:not(:disabled):hover span,
.image-gallery-container button:not(:disabled):focus-visible span {
  opacity: 1;
  transition: all .3s ease-in-out;
}

.image-gallery-container button img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-gallery-container.expand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
  grid-column-gap: .5rem;
  box-shadow: none;
}

.image-gallery-container.expand button {
  width: 100%;
}

.image-gallery-container-wrapper dialog {
  border-radius: 15px;
}

.image-gallery-container-wrapper dialog::backdrop {
  background-color: hsla(0 0% 15% / 0.6);
}

.image-gallery-container-wrapper dialog img {
  width: 70rem;
  aspect-ratio: 16/9;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .image-gallery-container button:not(:disabled) span,
  .image-gallery-container button:not(:disabled) span,
  .image-gallery-container button:not(:disabled):focus span,
  .image-gallery-container button:not(:disabled):hover span {
    transition: none;
  }

  .image-gallery-container button:not(:disabled) span,
  .image-gallery-container button:not(:disabled) span {
    opacity: 1;
  }
}