body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  font-family: Arial, sans-serif;
  background-color: rgb(57, 57, 173);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Loading Overlay */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  z-index: 9999; /* Ensures it overlays all other elements */
}

.loadingMessage {
  text-align: center;
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Logo Container */
#logoContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  width: 100%;
  max-height: 20vh; /* Limit logo container height to 20% of the viewport height */
}

#authNowLogo {
  max-width: 40%; /* Ensures the logo fits inside the container */
  max-height: 100%; /* Ensures the logo scales properly */
  object-fit: contain;
}

/* Canvas Container */
#canvasContainer {
  position: relative;
  display: flex;
  align-items: center; /* Vertical centering */
  justify-content: center; /* Horizontal centering */
  width: 95vw;
  height: 72vw; /* Make the canvas responsive */
  margin: 10px 0;
  border-radius: 15px; /* Rounded corners */
  border: 1px solid #ccc; /* Optional: Adds a subtle border */
  overflow: hidden; /* Ensures content inside also follows rounded corners */
}

#canvasOutput {
  width: 100%;
  height: 100%;
  display: block;
  background: #ddd;
  object-position: center;
}

#overlayImage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: cover;
  object-position: center;
  border-radius: 15px; /* Rounded corners */
  opacity: 1;
}

#finalResultInfo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 15px; /* Rounded corners */
  opacity: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  display: none;
}

#resultIcoLogo {
  height: 30%;
  width: auto;
  position: relative;
}

#resultTextTitle {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #0000ff;
  font-size: 30px;
  font-weight: bold;
  padding: 5px;
  margin-bottom: 5px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

#resultTextDescription {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  padding: 5px;
  margin-bottom: 10px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

/* Dynamic Text */
#dynamicText {
  position: absolute;
  text-align: center;
  width: 100%;
  font-size: 26px;
  font-weight: bold;
  padding: 5px;
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  display: none;
  z-index: 10;

  /* Allow line breaks */
  white-space: pre-line;

  /* Animation for blinking effect */
  animation: blink 2500ms infinite;
}

/* Keyframes for smoother blink animation */
@keyframes blink {
  0% {
    opacity: 0;
  } /* Start fully invisible */
  20% {
    opacity: 1;
  } /* Gradually fade in */
  40% {
    opacity: 1;
  } /* Stay fully visible */
  60% {
    opacity: 0;
  } /* Gradually fade out */
  100% {
    opacity: 0;
  } /* Stay invisible */
}

/* Progress Bar Container */
#progressBarContainer {
  width: 90vw;
  max-width: 400px;
  height: 20px;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden; /* Ensures the bar doesn’t exceed container */
  margin: 20px auto 10px; /* Add spacing above scannerContainer */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Progress Bar */
#progressBar {
  width: 0%; /* Default width (initial state) */
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

/* Scanner Container */
#scannerContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90vw;
  max-width: 400px; /* Limit the width for smaller screens */
  border-radius: 8px;
}

/* info logo Container */
#infoIcoContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  width: 100%;
  max-height: 5vh; /* Limit logo container height to 20% of the viewport height */
}

#infoIcoLogo {
  max-width: 40%; /* Ensures the logo fits inside the container */
  max-height: 100%; /* Ensures the logo scales properly */
  object-fit: contain;
}

#infoTextTitle {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #0000ff;
  font-size: 24px;
  font-weight: bold;
  padding: 5px;
  margin-bottom: 5px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

#infoTextDescription {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  padding: 5px;
  margin-bottom: 10px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

/* Start Button */
#scanButton- {
  width: 100%;
  height: 60px;
  font-size: 16px;
  padding: 10px;
  margin: 10px 0;
  background-color: #28a745;
  color: white;
  border: 2px solid white;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

/* Initial Overlay */
#initialOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw; /* Full viewport width */
  height: 100vh; /* Full viewport height */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;

  /* Background blur effect */
  backdrop-filter: blur(10px); /* Blurs the background */
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */

  /* Smooth fade-out transition */
  transition: all 0.5s ease;
}

/* Image inside the overlay */
#initialOverlay img {
  max-width: 90%;
  max-height: 70%;
  margin-bottom: 20px; /* Add space between image and button */
}

/* Continue Button */
/* #continueButton {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #28a745; 
  color: white;
  border: 2px solid white;
  border-radius: 20px;
  transition: background-color 0.3s;
}

#continueButton:hover {
  background-color: #0056b3; 
}
 */
#uploadButton {
  font-size: 18px;
  padding: 10px 20px;
  margin: 10px 0;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: none;
}

#uploadButton:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#uploadButton:hover:not(:disabled) {
  background-color: #0056b3;
}

#stateCDP_Button {
  font-size: 18px;
  padding: 10px 20px;
  margin: 10px 0;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: none;
}

#stateCDP_Button:hover:not(:disabled) {
  background-color: #0056b3;
}

/* Media Queries for Smaller Screens */
@media (max-height: 812px) {
  /* iPhone X height */

  #scanButton- {
    font-size: 24px;
    height: 60px;
  }

  #infoText {
    font-size: 24px;
  }
}
