/* PAGE LAYOUT */
.scannerPage{
padding:20px;
background:#f5f6fa;
margin-left:240px;
margin-top:50px;
}

.scannerPage h2{
margin:0;
font-size:22px;
}

.subtitle{
font-size:13px;
color:#6b7280;
margin-bottom:15px;
}


/* ================= SELECT EVENT CARD ================= */
.selectCard{
background:white;
border:1px solid #e5e7eb;
border-radius:12px;
padding:18px;
margin-bottom:15px;
}

.selectCard label{
font-weight:600;
font-size:14px;
}

.sub{
font-size:12px;
color:#6b7280;
margin:4px 0 10px 0;
}

.eventSelect{
width:100%;
padding:10px;
border:1px solid #e5e7eb;
border-radius:8px;
background:#f9fafb;
font-size:13px;
}


/* ================= GRID LAYOUT ================= */
.scannerGrid{
display:grid;
grid-template-columns:1fr 1fr;
gap:15px;
align-items:stretch;
}


/* ================= CARD BASE ================= */
.scannerCard,
.resultCard{
background:white;
border:1px solid #e5e7eb;
border-radius:12px;
padding:18px;
display:flex;
flex-direction:column;
    min-height:420px;
    overflow:hidden;
}

.scannerCard h4,
.resultCard h4{
margin:0;
font-size:15px;
}

/* ================= CAMERA BOX ================= */
.cameraBox{
    margin-top:15px;
    height:300px;
    border:2px dashed #d1d5db;
    border-radius:10px;
    background:#f9fafb;
    overflow:hidden;
    position:relative;
}

/* ================= READER ================= */
#reader{
    width:100%;
    height:100%;
    position:relative;
    overflow:hidden;
}

/* ================= VIDEO ================= */
#reader video{
    width:100% !important;
    height:100% !important;
    object-fit:cover;
    display:block;
}

/* ================= SCAN CANVAS ================= */
#reader canvas{
    position:absolute;
    top:0;
    left:0;
    width:100% !important;
    height:100% !important;
    object-fit:cover;
}

/* ================= IMAGE UPLOAD PREVIEW ================= */
#reader img{
    width:100%;
    height:100%;
    object-fit:contain;
}

/* ================= EMPTY / RESET STATE ================= */
.cameraBox.empty #reader{
    display:flex;
    align-items:center;
    justify-content:center;
    color:#9ca3af;
    font-size:13px;
}

/* ================= SCAN BUTTON ================= */
.scanBtn{
width:100%;
background:#4b2e83;
color:white;
border:none;
padding:10px;
border-radius:8px;
cursor:pointer;
font-size:13px;
margin-top:10px;
}

.scanBtn:hover{
background:#3b2468;
}


/* ================= BROWSE IMAGE ================= */
.uploadBox{
width:100%;
margin-top:8px;
}

.uploadBox input{
width:100%;
padding:8px;
border:1px solid #e5e7eb;
border-radius:8px;
background:white;
}


/* ================= MANUAL INPUT ================= */
.manualBox{
margin-top:15px;
border-top:1px solid #eee;
padding-top:15px;
}

.manualRow{
display:flex;
gap:8px;
}

.manualRow input{
flex:1;
padding:9px;
border-radius:8px;
border:1px solid #e5e7eb;
font-size:13px;
}

.manualRow button{
background:#111827;
color:white;
border:none;
padding:9px 14px;
border-radius:8px;
cursor:pointer;
font-size:13px;
}


/* ================= RESULT CARD ================= */
#scanResult{
flex:1;
display:flex;
align-items:flex-start;   /* remove big white space center */
justify-content:flex-start;
width:100%;
}


/* EMPTY RESULT */
.emptyResult{
width:100%;
height:100%;
display:flex;
align-items:center;
justify-content:center;
color:#9ca3af;
font-size:13px;
}


/* ================= SUCCESS ================= */
.scanSuccess{
width:100%;
background:#f0fdf4;
border:1px solid #bbf7d0;
border-radius:12px;
padding:14px;
animation:flashGreen .3s ease;
box-shadow:0 0 0 3px rgba(34,197,94,0.08);
}


/* ================= ERROR ================= */
.scanError{
width:100%;
background:#fff1f2;
border:1px solid #fecaca;
border-radius:12px;
padding:14px;
animation:flashRed .3s ease;
box-shadow:0 0 0 3px rgba(239,68,68,0.08);
}


/* ================= STATUS BADGE ================= */
.status{
display:flex;
align-items:center;
gap:8px;
font-weight:700;
font-size:14px;
margin-bottom:12px;
}

.status.success{
color:#16a34a;
}

.status.invalid{
color:#dc2626;
}


/* ================= RESULT INFO GRID ================= */
.infoGrid{
display:flex;
flex-direction:column;
gap:6px;
}


/* each row */
.userRow{
display:flex;
justify-content:space-between;
align-items:center;
font-size:13px;
padding:6px 0;
border-bottom:1px dashed #eee;
}

.userRow:last-child{
border-bottom:none;
}

.userRow span{
color:#6b7280;
}

.userRow b{
color:#111827;
}


/* ================= NAME BIG ================= */
.userRow.name{
font-size:16px;
font-weight:600;
border-bottom:1px solid #eee;
padding-bottom:8px;
}


/* ================= ERROR MESSAGE ================= */
.errorMsg{
margin-top:8px;
font-size:13px;
font-weight:600;
color:#dc2626;
}


/* ================= ANIMATION ================= */
@keyframes flashGreen{
0%{transform:scale(.96);opacity:.6}
100%{transform:scale(1);opacity:1}
}

@keyframes flashRed{
0%{transform:scale(.96);opacity:.6}
100%{transform:scale(1);opacity:1}
}
/* ======================================================
   RESPONSIVE
====================================================== */

*{
    box-sizing:border-box;
}

img,
video,
canvas{
    max-width:100%;
}

body{
    overflow-x:hidden;
}


/* ================= TABLET ================= */

@media (max-width:992px){

    .scannerPage{
        margin-left:0;
        margin-top:75px;
        padding:15px;
    }

    .scannerGrid{
        grid-template-columns:1fr;
    }

    .scannerCard,
    .resultCard{
        min-height:auto;
    }

    .cameraBox{
        min-height:320px;
    }

}


/* ================= MOBILE ================= */

@media (max-width:768px){

    .scannerPage{
        margin-left:0;
        margin-top:70px;
        padding:12px;
    }

    .scannerPage h2{
        font-size:20px;
        line-height:1.3;
    }

    .subtitle{
        font-size:13px;
        margin-bottom:15px;
    }

    .selectCard,
    .scannerCard,
    .resultCard{
        padding:14px;
        border-radius:12px;
    }

    .scannerGrid{
        grid-template-columns:1fr;
        gap:12px;
    }

    .eventSelect{
        height:48px;
        font-size:14px;
    }

    .cameraBox{
        min-height:260px;
    }

    #reader{
        height:240px;
    }

    .uploadBox{
        display:block !important;
        width:100%;
        margin-top:10px;
    }

    .uploadBox input{
        width:100%;
        min-height:48px;
        font-size:14px;
    }

    .scanBtn{
        width:100%;
        min-height:48px;
        font-size:14px;
        font-weight:600;
    }

    .manualRow{
        flex-direction:column;
        gap:10px;
    }

    .manualRow input{
        width:100%;
        min-height:48px;
        font-size:14px;
    }

    .manualRow button{
        width:100%;
        min-height:48px;
        font-size:14px;
        font-weight:600;
    }

    .status{
        font-size:15px;
    }

    .userRow{
        flex-direction:column;
        align-items:flex-start;
        gap:4px;
        padding:8px 0;
    }

    .userRow span{
        font-size:12px;
    }

    .userRow b{
        width:100%;
        word-break:break-word;
    }

    .userRow.name{
        font-size:17px;
    }

}


/* ================= SMALL MOBILE ================= */

@media (max-width:480px){

    .scannerPage{
        padding:10px;
        margin-top:65px;
    }

    .scannerPage h2{
        font-size:18px;
    }

    .subtitle{
        font-size:12px;
    }

    .selectCard,
    .scannerCard,
    .resultCard{
        padding:12px;
        border-radius:10px;
    }

    .cameraBox{
        min-height:220px;
    }

    #reader{
        height:200px;
    }

    .eventSelect,
    .scanBtn,
    .manualRow input,
    .manualRow button{
        font-size:13px;
    }

    .status{
        font-size:14px;
    }

    .userRow{
        font-size:13px;
    }

    .userRow.name{
        font-size:16px;
    }

}