﻿/* Overlay */
.scanner-overlay,
.mud-overlay.scanner-overlay {
    backdrop-filter: blur(2px);
    position: fixed !important;
    inset: 0 !important; /* substitui top/left/width/height */
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    display: block !important;
}

/* Container base */
.scanner-container {
    position: fixed;
    inset: 0; /* já define a tela cheia; remover width/height */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: black;
    backdrop-filter: blur(2px);
}

/* Cabeçalho */
.scanner-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 20px;
    left: 0;
    z-index: 10003;
    padding: 0 16px;
}

.scanner-close {
    position: absolute;
    left: 12px;
    color: white !important;
}

.scanner-tip {
    background: rgba(20, 20, 20, 0.88);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
}

/* Área da câmera */
.scanner-camera-wrapper {
    position: relative;
    width: 100%; /* era 100vw  */
    height: 100%; /* era 100dvh */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reader */
.scanner-reader {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
}

/*@media (orientation: portrait) {
    .scanner-landscape {
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100dvh;
        height: 100vw;
    }
}
*/



/* Corrige vídeo/canvas injetado */
#reader,
#reader video,
#reader canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Máscara escura fora da faixa de leitura */
.scanner-mask {
    position: absolute;
    width: 100%;
    background: rgba(0, 0, 0, 0.60);
    z-index: 10001;
    pointer-events: none;
}

    .scanner-mask.top {
        top: 0;
        height: calc(50% - 55px);
    }

    .scanner-mask.bottom {
        bottom: 0;
        height: calc(50% - 55px);
    }

/* Moldura do scanner - estilo horizontal real */
.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(88%, 900px);
    height: 110px;
    border-radius: 20px;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Linha animada */
.scanner-line {
    position: absolute;
    width: 90%;
    height: 2px;
    background: white;
    opacity: 0.95;
    border-radius: 999px;
    animation: scannerPulse 1.8s infinite ease-in-out;
}

@keyframes scannerPulse {
    0% {
        transform: translateY(-18px);
        opacity: 0.5;
    }

    50% {
        transform: translateY(18px);
        opacity: 1;
    }

    100% {
        transform: translateY(-18px);
        opacity: 0.5;
    }
}

/* Cantos */
.corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 4px solid white;
    border-radius: 4px;
}

.top-left {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.top-right {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.bottom-left {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.bottom-right {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}
