body {
  font-family: sans-serif;
}

.hidden {
  display: none;
}

#openPopup {
  display: inline-block;
  padding: 5px 10px;
  background-color: #0095dd;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
  font-size: 14px;
}

#openPopup:hover {
  background-color: #005a88;
  color: #ffffff;
}

#openPopup:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 95, 220, 0.5);
}

#popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

#popup-content {
  background-color: #ffffff;
  border-radius: 20px;
  width: 640px;
  height: 640px;
  margin: auto;
  padding: 0px;
  box-sizing: border-box;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
}

button {
  background-color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.thumbnails {
  position: absolute;
  left: 50%;
  bottom: -100px;
  transform: translateX(-50%);
  height: 100px;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.thumbnails ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  position: relative;
}

.thumbnails li {
  display: inline-flex;
  margin-right: 5px;
}

.thumbnails li img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.thumbnails li:last-child {
  margin-right: 0;
}

.thumbnails li.selected {
  border: 2px solid #FF0000;
  box-sizing: content-box;
}

.close-icon {
  position: absolute;
  top: -3%;
  right: -3%;
  font-size: 24px;
  font-weight: bold;
  padding: 0px;
  transform: translate(50%, -50%);
}

@media (max-width: 640px) {

  #popup-content {
    background-color: #ffffff;
    border-radius: 20px;
    width: 95vw;
    height: 95vw;
    margin: auto;
    box-sizing: border-box;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .popup-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70vw;
    height: 70vw;
  }

  #previewScreen {
    width: 70vw;
    height: 70vw;
  }

  #previewContainer {
    width: 70vw;
    height: 70vw;
    display: flex;
    flex-direction: column;
  }

  .thumbnails {
    left: 50%;
    bottom: -100px;
    transform: translateX(-50%);
    height: 100px;
    justify-content: center;
    align-items: center;
    width: 70vw;
    overflow: hidden;
  }

  .thumbnails li img {
    width: 7vw;
    height: 7vw;
  }
  
}