#qr-scanner-app {
  --color-zanah: #e2eed9;
  --color-pizzaz: #f29600;
  --color-cruose: #004519;
  --color-black: #000000;
  --color-white: #ffffff;

  --app-primary: var(--color-pizzaz);
  --app-secondary: var(--color-cruose);
  --app-text: var(--color-white);
  --app-button-text: var(--color-cruose);

  --fab-size: 70px;
  font-family: "Josefin Sans", sans-serif;
}

#qr-fab-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background-color: var(--app-primary);
  color: var(--color-black);
  border: none;
  box-shadow: 0 8px 20px rgba(242, 150, 0, 0.4);
  cursor: pointer;
  z-index: 10001;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.3s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-fab-button:active {
  transform: scale(0.9);
}

#qr-fab-button .icon-container {
  position: relative;
  width: 32px;
  height: 32px;
}

#qr-fab-button svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
  stroke-width: 2.5;
}

.icon-qr {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

#qr-fab-button.is-open {
  background-color: var(--color-zanah);
  color: var(--color-cruose);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
#qr-fab-button.is-open .icon-qr {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
#qr-fab-button.is-open .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

#qr-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 69, 25, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.1);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0.3s;
}

#qr-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.instruction-text {
  color: var(--color-zanah);
  margin-top: 25px;
  font-weight: 300;
  font-size: 1.2rem;
  text-align: center;
  padding: 0 20px;
  letter-spacing: 0.5px;
}

#qr-reader-container {
  width: 90%;
  max-width: 400px;
  /* Force a perfect square aspect ratio for uniformity */
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: #000; /* Black background to prevent white flashes/bars */
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- LIBRARY OVERRIDES FOR UNIFORMITY --- */

#qr-reader {
  /* biome-ignore lint/complexity/noImportantStyles: Override library inline styles */
  border: none !important;
  /* biome-ignore lint/complexity/noImportantStyles: Override library inline styles */
  padding: 0 !important;
  width: 100%;
  height: 100%;
}

#qr-reader video {
  width: 100%;
  height: 100%;
  /* This ensures the video fills the square box completely */
  object-fit: cover;
  border-radius: 20px;
}

/* Hide library status elements */
#qr-reader__dashboard_section_csr,
#qr-reader__status_span {
  /* biome-ignore lint/complexity/noImportantStyles: Hide library elements */
  display: none !important;
}
