.webcame-recognition {
  position: relative;
  text-align: center;
  width:100%;
  display: inline-block;
  vertical-align: baseline;
  overflow: hidden;

}

.webcame-recognition .video-recognition {
  position: relative;
}

.webcame-recognition .vidDisplay {
  position: relative;
  width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: baseline;
  transform: scaleX(-1);
  height: auto;
  border-radius: 15px;
}

.webcame-recognition canvas#overlay {
  width: 100%;
}

.webcame-recognition .overlay-recognition {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height:250px;
  border: 5px double;
  border-color: #FFFFFF;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  pointer-events: none;
  border-radius: 20px;
  opacity: 0.8;
}

.webcame-recognition .overlay-recognition.error {
  border-color: #ff0052;
}

.webcame-recognition .overlay-recognition.success {
  border-color: #4BD763;
}

.webcame-recognition .overlay-recognition .result-label {
  width: 90%;
  padding: 3px 2px;
  background-color: #ffffff;
  position: absolute;
  top: -0px;
  border-radius: 0px 0px 10px 10px;
  text-align: center;
  font-size: 13px;
  line-height: 20px;
  color: #111111;
  opacity: 0.7;
}

.webcame-recognition .overlay-recognition .result-label.error {
  background-color: #ff0052;
  color: #ffffff;
}

.webcame-recognition .overlay-recognition .result-label.success {
  background-color: #ffffff;
  color: #111111;
}

.webcame-recognition .overlay-recognition .result-label-top {
  width: 90%;
  padding: 3px 2px;
  position: absolute;
  top: 10px;
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  color: #ffffff;
}

/* Garis scan */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, rgba(0, 255, 0, 0), rgba(255, 255, 255, 0.842), rgba(0, 255, 0, 0));
  animation: scan 2s linear infinite;
}

/* Animasi scan bergerak dari atas ke bawah */
@keyframes scan {
  0% {
    top: 0;
  }

  50% {
    top: calc(100% - 4px);
  }

  100% {
    top: 0;
  }
}

.resume-capture-face-api {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 120px;
  height: 130px;
  border-radius: 10px;
  overflow: hidden;
  border: solid 3px #eeeeee;
  display: none;
  box-shadow: 16px 14px 20px #0000008c;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.resume-capture-face-api::before {
  content: "";
  background-image: conic-gradient(#ff0052 20deg,
      transparent 120deg);
  width: 160%;
  height: 160%;
  position: absolute;
  animation: rotate 2s linear infinite;
  opacity: 0.4;
}

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

  100% {
    transform: rotate(-360deg);
  }
}


/** Webcame Biasa */
.webcam-app {
  position: relative;
  text-align: center;
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.webcam-app video{
  width: 100%;
  height: auto;
  border-radius: 10px;
  max-height: 400px;
}

.webcame #map-overlay {
  position:relative;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  opacity: 100;
}

#canvas {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 100%;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  border-radius: 10px;
  z-index: 0 !important;
}

.webcame-recognition canvas{
 position:absolute;
 top:0;
 left:0;
 width:100%;
}


.flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 999999;
}


#map-overlay {
  position:relative;
  overflow: hidden;
  opacity: 0.8;
  width: 100%;
  height:200px;
}

.lokasi-overlay{
  position: absolute;
  bottom: -121px;
  left: 50%;
  width: 95%;
  height: 100px;
  z-index: 2;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0.8;
  transform: translate(-50%, -50%);
  background: transparent;
}

.lokasi-overlay .form-control{
  background-color: rgba(0, 0, 0, 0.72);
  color: #ffffff;
}


.camera-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}

.camera-flash.active {
  animation: flash 0.3s ease-in-out;
}


.webcam-app-mini {
  position: relative;
  text-align: center;
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.webcam-app-mini video{
  width: 100%;
  height: auto;
  border-radius: 10px;
  max-height: 300px;
}
.close-webcam{
  position: absolute;
  right: 20px;
  top: 10px;
  background: #ffffff;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 0px;
  font-size: 13px;
}
/* kamera full screen */
#reader {
 width: 100%;
 height: 100%;
}


/* overlay center */
.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

/* frame ala PeduliLindungi / Gojek */
.scan-frame {
  width: 300px;
  height:300px;
  border-radius: 18px;
  border: 2px solid rgba(0, 255, 153, 0.9);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.55),
    0 0 25px rgba(0, 255, 153, 0.6);
  position: relative;
  overflow: hidden;
}

.scan-frame.success {
    border: 2px solid #ffd000 !important;
    box-shadow:
        0 0 0 9999px rgba(0,0,0,0.55),
        0 0 25px rgba(255, 208, 0, 0.9),
        0 0 60px rgba(255, 208, 0, 0.6);
    animation: successPulse 0.8s ease-in-out 2;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.03);
        filter: brightness(1.3);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* 🔥 laser animation */
.laser {
  position: absolute;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    transparent,
    #00ff99,
    transparent
  );

  animation: scanMove 2s infinite;
  opacity: 0.9;
}

@keyframes scanMove {
  0% { top: 0; }
  50% { top: 50%; }
  100% { top: 100%; }
}

@keyframes flash {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media screen and (max-width: 1600px) {
  .webcame-recognition .overlay-recognition {
    width: 240px;
    height:250px;
  }
}


@media screen and (max-width: 480px) {
  /** Webcame Recongnition */
  .webcame-recognition {
    position: relative;
    width: 100% !important;
    height: 100%;
  }

  .webcame-recognition .video-recognition {
    position: relative;
    width: 100%;
    max-height: 350px;
  }

  .webcame-recognition .vidDisplay{
    max-height:350px;
  }

  .webcame-recognition .overlay-recognition {
    width: 200px;
    height:200px;
    top: 53%;
    border: 5px double;
    border-radius: 20px;
    opacity: 0.8;
    margin: auto;
    border-color: #FFFFFF;
  }


  .resume-capture-face-api {
    top: 5px;
    right: 5px;
    width: 60px;
    height: 70px;
  }

  /* Webcame*/
  #webcam {
    width: 100%;
    object-fit: cover;
    z-index: 0;
    max-height: 400px;
  }

  .scan-frame {
    width:250px;
    height:250px;
  }
}