body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

.build-controls-top {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  position: relative;
  box-shadow: 0 0 1px #0000001a, 0 1px 1px #0000001a;
  width: 100%;
  padding: 5px 10px;
}

.build-controls-bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-color: dimgrey;
  padding: 8px 0;
  width: 100%;
  position: absolute;
  z-index: 9999;
}

.build-button {
  width: 40px;
  height: auto;
  margin: 0 20px 0;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  border: none;
  text-align: center;
  position: relative;
}

.build-header {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
}

.build-header-img {
  width: 125px;
  height: 25px;
}

.build-header-text {
  color: #0da8ac;
  font-weight: bold;
  font-size: large;
  font-style: italic;
  align-content: center;
}

.build-button[data-type="addmorevia"] {
  width: 30px;
  height: 30px;
  margin-right: 20px;
}

.build-button[data-type="backtogallery"] {
  width: 35px;
  height: 35px;
  align-self: end;
}

.build-button span {
  font-size: 10px;
  color: white;
  text-align: center;
}

.review-image,
.viewed-image {
  width: auto;
  height: 100vh;
  object-fit: contain;
}

.header-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 10px;
}


/* Gallery Screen Styles */
.gallery-screen {
  text-align: center;
}

.thumbnail-checkbox {
  position: absolute;
  background-color: white;
  vertical-align: middle;
  border: 1px solid #ddd;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

/* When checkbox is checked, change background color and add inner circle */
.thumbnail-checkbox:checked {
  background-color: darkturquoise;
  /* Green when checked */
  border-color: darkturquoise;
}

/* Container for the thumbnail images */
.thumbnail-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  margin: 0 auto;
  padding: 0;
  background: whitesmoke;
  width: 100vw;
  height: 80vh;
  overflow-y: auto;
}

/* Each thumbnail item */
.thumbnail-item {
  position: relative;
  padding: 8px;
  box-sizing: border-box;
  transition: transform 0.3s ease;
  width: calc(100% / 5);
  /* Default to 5 items per row on desktop */
  overflow: hidden;
}

/* Thumbnail image styling */
.thumbnail-item img {
  width: 100%;
  height: 150px;
  max-height: 150px;
  cursor: pointer;
  transition: transform 0.3s ease;
  border-radius: 8px;
  object-fit: cover;
}

/* Hover effect for thumbnail images */
.thumbnail-item img:hover {
  transform: scale(1.03);
}

/* Full-screen view of the image */
.image-full-view {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  flex-direction: column;
  height: 100%;
  background-color: rgba(0, 0, 0, 1);
  justify-content: start;
  align-items: center;
  z-index: 999;
}

/* Full-screen image styling */
.image-full-view img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 3%;
  object-fit: contain;
}

/* Back button for navigating back to gallery and full-screen */
.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 10px 20px;
  font-size: 16px;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  border-radius: 5px;
  z-index: 1000;
}

/* Hover effect for back button */
.back-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Responsive design: Adjust thumbnail grid for smaller screens */
/* Desktop and large screens (show 5 items per row) */
@media (min-width: 1024px) {
  .thumbnail-item {
    width: calc(100% / 5);
    /* 5 items per row on desktop */
  }

  .image-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #000;
  }

  .thumbnail-checkbox {
    top: 10px;
    left: 10px;
    width: 15px;
    height: 15px;
  }
}

/* Medium screens (tablets and smaller desktops, show 3 items per row) */
@media (max-width: 1023px) and (min-width: 768px) {
  .thumbnail-item {
    width: calc(100% / 3);
    /* 3 items per row on tablets */
  }

  .image-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #000;
  }

  .review-image,
  .viewed-image {
    width: auto;
    height: 90%;
    object-fit: contain;
  }

  .thumbnail-checkbox {
    top: 10px;
    left: 10px;
    width: 15px;
    height: 15px;
  }
}

/* Small screens (phones, show 3 items per row) */
@media (max-width: 768px) and (min-width: 480px) {
  .thumbnail-item img {
    object-fit: cover;
  }

  .thumbnail-item {
    width: calc(100% / 3);
    height: fit-content;
    /* 3 items per row on small tablets */
  }

  .image-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #000;
  }

  .review-image,
  .viewed-image {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
  }
}

/* Extra small screens (phones, 3 items per row) */
@media (max-width: 480px) {
  .thumbnail-item img {
    object-fit: cover;
  }

  .thumbnail-item {
    width: calc(100% / 2);
    height: fit-content;
    /* 3 items per row on mobile devices */
  }

  .image-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #000;
  }

  .review-image,
  .viewed-image {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
  }

  /* Ensure images take up full screen when viewed individually */
  .image-full-view img {
    max-width: 98%;
    padding: 1%;
    border-radius: 3%;
    /* Take up full screen on mobile */
  }

  /* Optional: Adjust back button size */
  .back-button {
    padding: 8px 16px;
    font-size: 14px;
  }

  /* Small adjustment for checkbox size on small screens */
  .thumbnail-checkbox {
    width: 20px;
    height: 20px;
    top: 10px;
    left: 10px;
  }
}

/* Adjust checkbox position for smaller screens */
@media (max-width: 320px) {
  .thumbnail-item img {
    object-fit: cover;
  }

  .thumbnail-checkbox {
    top: 8px;
    left: 8px;
  }

  .image-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #000;
  }

  .review-image,
  .viewed-image {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
  }
}

::-webkit-scrollbar {
  width: 5px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #9e9e9e;
  border-top: 2px solid transparent;
}

::-webkit-scrollbar-track {
  width: 10px;
  border-radius: 10px;
  background: none;
}

/* Modal capture modal container styles */
.capture-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.capture-modal-box {
  position: relative;
  /* Ensure the close button is positioned relative to this */
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  max-width: 400px;
  margin: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.capture-title {
  font-size: 18px;
  margin-bottom: 20px;
}

.capture-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.capture-btn-camera,.capture-btn-gallery,.capture-btn-qrbar {
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
  color: white;
}

.capture-btn-camera {
  background-color: #007bff;
}

.capture-btn-camera:hover {
  background-color: #0056b3;
}

.capture-btn-gallery {
  background-color: #EF6C00;
}

.capture-btn-gallery:hover {
  background-color: #E65100;
}

.capture-btn-qrbar {
  background-color: #6c757d;
}

.capture-btn-qrbar:hover {
  background-color: #4e555b;
}

.capture-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s ease;
}

.capture-close:hover {
  color: #333;
}