/* === BASE LAYOUT === */
html, body {
  height: 100%;
  min-height: 100vh;
  background: #fff;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE 10+ */
}

body::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

html {
  overflow-x: hidden;
}

.main-content {
  flex: 0 0 auto;
  min-height: 280px;
  background: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

/* === MENU SWITCH === */
.menu-title {
  display: flex;
  margin-left: 24px;
  margin-top: 5vw;
  gap: 3rem;
  font-size: 0.8rem;
}

.menu-title .home-menu-switch {
  font-family: 'Aptos-Narrow';
  font-weight: 400;
  color: #262C36;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: font-weight 0.18s;
}

.menu-title .home-menu-switch.selected {
  font-weight: 700;
}

/* === DIVIDER === */
.page-divider {
  width: calc(100% - 48px);
  margin-top: 1vw;
  margin-left: 24px;
  margin-right: 24px;
  height: 0.5px;
  background-color: #bbb;
}

/* === QR SCANNER === */
.qr-wrapper {
  width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.qr-scan-container {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  margin: 5vw auto;
  position: relative;
  overflow: hidden;
  background: black;
}

#cameraPreview,
#frozenFrame {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.qr-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  z-index: 2;
  pointer-events: none;
  transition: border-color 0.2s ease; /* Optional for smooth color switch */
}

/* === SHUTTER BUTTON === */
.shutter-button {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  background-color: white;
  border: 4px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: transform 0.1s ease-in-out;
  z-index: 3;
}

.shutter-button:active {
  transform: translateX(-50%) scale(0.92);
}

.shutter-button.clicked {
  transform: translateX(-50%) scale(0.88);
  box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

/* === INSTRUCTION === */
.qr-instruction {
  text-align: center;
  font-family: 'Aptos-Narrow';
  font-size: 1rem;
  color: #262C36;
  margin-bottom: 24px;
}

/* === FLASH EFFECT === */
.qr-flash,
#qrFlash {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s ease;
}

#qrFlash.active {
  opacity: 0.8;
}

/* === LOADING BAR + TEXT === */
.qr-loading-bar {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  border-radius: 4px;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
}

.qr-loading-progress {
  height: 6px;
  width: 0%;
  background-color: white;
  transition: width 3s linear;
  border-radius: 3px;
  width: 100%;
}

.qr-loading-text {
  font-family: 'Aptos-Narrow';
  font-size: 0.9rem;
  color: #fff;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
  text-align: center;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

/* Text fade-in when loading is active */
.qr-loading-bar.active .qr-loading-text {
  opacity: 1;
}


/* === QR UPLOAD ICON === */
.qr-upload-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.406);
  border-radius: 10px;
  padding: 4px;
}

.qr-upload-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
