html, body {
  margin: 0px;
  padding: 0px;
  border: none;
  overflow: hidden;

  box-sizing: border-box;
  width: 100%;
  height: 100%;

  background-color: #000;

  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;

  font-family: "Microsoft JhengHei", "Heiti TC", "PingFang TC", "Noto Sans TC", "Segoe UI", "Helvetica Neue", sans-serif;
}

button {
  background: none;

  border: none;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  z-index: 600;

  pointer-events: auto; /* Allow clicks on buttons */
  
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

#wrapper {
  box-sizing: border-box;
  margin: 0px;
  padding: 0px;
  border: none;

  width: 100%;
  height: 100%;

  z-index: 6;
}

#ui-layer {
  position: absolute;
  display: block;
  
  top: 0;
  left: 0;
  
  width: 100%;
  height: 100%;

  pointer-events: none; /* Allow clicks to pass through */
  z-index: 60;
}

#ui-left-top {
  position: absolute;
  /* background-color: aqua; */

  top: 30px;
  left: 30px;
  width: 40%;
  height: 8%;

  display: flex;
  flex-direction: row;
}

#ui-right-top {
  position: absolute;
  /* background-color: aquamarine; */

  top: 30px;
  right: 30px;
  width: 40%;
  height: 8%;

  display: flex;
  flex-direction: row-reverse;

  z-index: 80;
}

#ui-bottom-row {
  position: absolute;
  /* background-color: lightcoral; */

  left: 30px;
  bottom: 30px;
  padding: 0px;

  width: calc(100% - 60px);
  height: 200px;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: end;

  z-index: 80;
}

#ui-bottom-left {
 
  width: 60px;
  padding-bottom: 15px;

  box-sizing: border-box;
  /* background-color: lightblue; */
  display: flex;
  flex-direction: row;

  z-index: 90;
}

#ui-bottom-center {
  /* background-color: purple; */
  position: relative;
  width: 74px;
  height: 74px;

  margin: 0px;
  padding: 0px;
  border: none;

  z-index: 90;
}

#ui-bottom-right {
  position: relative;
  /* background-color: lightgreen; */

  width: 60px;
  padding-bottom: 15px;
  box-sizing: border-box;
  
  display: flex;
  flex-direction: row-reverse;

  z-index: 90;
}

#record-button {
  width: 74px;
  height: 74px;

  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

#record-button > div {
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;

  pointer-events: none;
}

#record-button .button-image {
  position: absolute;
  left: 0px;
  bottom: 0px;

  width: 100%;
  height: 100%;
  background-image: url('../assets/button-record.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
}

#record-button .recording-image {
  position: absolute;
  left: 0px;
  bottom: 0px;

  width: 100%;
  height: 100%;
  background-image: url('../assets/button-recording.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;

  animation: LoopRotate 1s linear infinite;
  opacity: 0;
}

#record-button.recording .button-image {
  opacity: 0;
}

#record-button.recording .recording-image {
  opacity: 1;
}

@keyframes LoopRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#camerakit-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;

  z-index: 10;
}

#back-button {
  height: 100%;
  aspect-ratio: 1.0;
  background-image: url('../assets/BackButton.png');
}

#share-button {
  height: 100%;
  aspect-ratio: 1.0;

  width: 32px;
  height: 44px;
  background-image: url('../assets/button-share.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
}

#share-menu {
  position: absolute;
  background-color: #FFF;

  width: 160px;
  height: auto;

  top: -140px;
  right: 0px;

  padding: 8px 16px;

  border-radius: 12px;
  box-sizing: border-box;
  
  font-size: 1.0 em;

  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.0, 0.0);
  transform-origin: 140px 140px 0px;

  z-index: 100;
}

#share-menu.open {
  transform: scale(1.0, 1.0);
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); /* easeOutBack */
}

#share-menu.close {
  transform: scale(0.0, 0.0);
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1); /* easeCubicOut */
}

#share-menu .share-item {
  padding: 8px 0px;
  border-bottom: 1px solid #EEE;

  pointer-events: auto;
  color: #111;
}

#share-menu a:link, #share-menu a:visited {
  text-decoration: none;
  color: #111;
}


#share-menu .share-item:last-child {
  border-bottom: none;
}

#share-menu .bubble-mark {
  position: absolute;
  bottom: -8px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #FFF;
}

#switch-button {
  height: 100%;
  aspect-ratio: 1.0;

  width: 32px;
  height: 44px;
  background-image: url('../assets/button-switch-camera.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;

  border: none;
  user-select: none;
  outline: none;
  transition: transform 0.1s ease;

  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#loading {
  position: absolute;
  top: 30%;
  left: 40%;
  z-index: 900;
  display: none; /* Hidden by default */
}

#loading-icon {
  height: 200px;
  width: 200px;
  animation: spin 2s linear infinite; /* Apply the spin animation */
}

/* Keyframes for the rotation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


.poweredbysnap-logo {
  position: absolute; /* Position relative to the viewport */

  top: 20px;
  right: 16px;

  width: calc(100% - 60px);
  height: 24px;

  display: flex;
  flex-direction: row-reverse;
  /* justify-content: center;
  align-items: center; */
  z-index: 100;
}

.poweredbysnap-logo > img {
  height: 100%;
  aspect-ratio: 4.2857;
}

.button-class {
  transition: transform 0.1s ease;
}

.button-class:active {
  transform: scale(0.9); /* Only scale without affecting translation */
}

#photo-snapshot-effect {
  position: absolute;
  background-color: #fff;
  opacity: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  pointer-events: none; /* Allow clicks to pass through */
  animation: none;
}

#photo-snapshot-effect.animating {
  animation: blink 0.2s ease forwards;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}