
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
body { 
    font-family: 'Roboto', sans-serif;
    background: #1a1a1a; 
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.is-android {
    overflow: auto !important; 
    -webkit-overflow-scrolling: touch;
}
.main-container {
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    display: none;
}
/* The Container */
#viewport {
    display: none;
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 500px; /* Mobile width on PC */
    max-height: 888px; /* Maintain 9:16 ratio on PC */
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 10px;
}
#video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    filter: blur(20px);
    transform: scaleX(-1);
    aspect-ratio: 16 / 9;
    z-index: 1;
    transition: filter 1.5s ease;
}
#video.unblurred {
    filter: blur(0px);
}
#video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

#highres-video {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    object-fit: cover;
    filter: blur(10px);
    z-index: 1;
}
#highres-video-overlay {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 2; 
    display: block; 
    pointer-events: none;
}
#flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
}
#video, #video-overlay {
    transform: scaleX(-1);
}
#scan-button {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 15px 40px;
    background: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
#error-div {
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background:rgba(0,0,0,0.8); 
    color:white; 
    display: none; 
    position: absolute; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 20;
}
#connection-lost-div {
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background:rgba(0,0,0,0.8); 
    color:white; 
    display: none; 
    position: absolute; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 20;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.test-container {
    margin-top: 10px;
    width: 100%;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
}
.run-tests-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px 60px;
    gap: 8px;
    border: none;
    background: #007bff;
    color: white;
    font-size: 20px;
    cursor: pointer;
}
#login-spinner {
    width: 16px;
    height: 16px;
    display: none;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to {
    transform: rotate(360deg);
    }
}
    #scan-complete {
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        background:rgba(0,0,0,0.8); 
        color:white; 
        display: none; 
        position: absolute; 
        flex-direction: column; 
        justify-content: center; 
        align-items: center; 
        z-index: 20;
    }
    .spinner {
        width: 50px;
        height: 50px;
        border: 6px solid #ddd;
        border-top-color: skyblue;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin: 20px auto;
    }
    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    #popup-notification {
    position: absolute;
    inset: 0;
    background: white;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-evenly;
    gap: 1px;
    width: 100%;
    height: 100%;
    z-index: 20;

    opacity: 0;
    transform: translateY(100%); 
    pointer-events: none;
    transition: 
        transform 0.7s ease,
        opacity 0.5s ease;
    }
    #popup-notification.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    }
    #popup-notification p {
    color: #000;
    font-size: 20px;
    }
    #popup-notification button {
    position: relative;
    padding: 15px 70px;
    background: #AF6C1D;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
    }
    #countdown-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
    }
    
    .circle-container {
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: conic-gradient(silver 0deg, transparent 270deg);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .inner-circle {
        width: 185px;
        height: 185px;
        background: transparent; 
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .number {
        color: silver;
        font-size: 5rem;
        font-weight: bold;
    }

    .animate-spin {
        animation: spin 1s linear infinite;
    }

    .animate-counter-spin {
        animation: counter-spin 1s linear infinite;
    }

    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    @keyframes counter-spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(-360deg); }
    }

    @media (max-width: 600px) {
    #scan-button {
        bottom: 200px;
    }
    #viewport {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    #cancel-box {
        width: 40px;
        height: 40px;
        border-radius: 3px;
    }
    #caption-container img {
        width: 35px;
        height: 35px;
    }

    #popup-notification {
        position: absolute;
        background: white;
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: initial;
        align-items: center;
        gap: 10px;
        width: 100%;
        height: 100%;
        z-index: 20;
        inset: 0;
    }
    #popup-notification img {
        width: 70%;
        height: 70dvh;
        object-fit: contain;
    }
    #popup-notification button {
        position: relative;
        width: 150px;
        height: 50px;
        padding: 0 0;
        background: #AF6C1D;
        color: #fff;
        border: none;
        cursor: pointer;
        font-weight: bold;
        font-size: 14px;
    }
    }
    #cancel-box {
    display: none;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 30px;
    right: 20px;
    background: #DDDDDD40;
    color: #FFFFFF;
    width: 63px;
    height: 63px;
    border-radius: 5px;
    z-index: 100;
    cursor: pointer;
    }
    #caption-container {
    display: none;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    column-gap: 10px;
    background: #38343299;
    color: #FFFFFF;
    padding: 10px 12px;
    border-radius: 8px;
    transform: translateX(-50%);
    left: 50%;
    bottom: 80px;
    z-index: 100;
    }
    #caption-container img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-left: 0.5px solid #FFFFFF;
    padding-left: 10px;
    }
    #caption-box {
        display: none;
        color: #FFFFFF;
        font-size: 18px;
        letter-spacing: 1px;
        max-width: 90%;
        white-space: nowrap;
        text-align: center;
        transition: opacity 0.3s ease;
        z-index: 100;
        white-space: normal;        
        word-wrap: break-word;
    }
    /* #caption-box {
        display: block;
        position: absolute;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        background: #38343299;
        color: #FFFFFF;
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 18px;
        letter-spacing: 1px;
        max-width: 90%;
        white-space: nowrap;
        text-align: center;
        transition: opacity 0.3s ease;
        z-index: 100;
    } */
    #caption-container.wrap {
    width: 90%;
    }
    #caption-box.wrapping {
        width: 80%;
        white-space: normal;        
        word-wrap: break-word;
    }
    #caption-box.visible {
        display: block;
    }
    .cursor {
        animation: blink 0.6s step-start infinite;
    }

    @keyframes blink {
        50% { opacity: 0; }
    }

    #viewport-loader {
        position: fixed;
        display: absolute;
        width: 100%;
        height: 100%;
        inset: 0;
        background: transparent;
        color: black;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }
    #viewport-spinner {
        width: 50px;
        height: 50px;
        border: 6px solid #ddd;
        border-top-color: skyblue;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin: 20px auto;
    }
    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /*Files upload*/
    .upload-container{
    display: none;
    width: 600px;
    max-width:100%;
    margin: 30px auto;
    padding: 50px 5px;
    background: transparent;
    color: white;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
    }
    .upload-header {
    margin-bottom: 20px;
    }
    .upload-header h2{
        margin:0;
        text-align: center;
    }
    .upload-header p{
        color: rgb(238, 231, 231);
        margin-top:8px;
        font-size: 15px;
        padding-top: 30px;
        text-align: center;
    }
    .upload-item{
        margin-bottom:18px;
    }

    .upload-title{
        display:flex;
        justify-content:space-between;
        margin-bottom:6px;
        font-size:14px;
    }
    .upload-bar{
        width:100%;
        height:15px;
        background:#e5e7eb;
        border-radius: 999px;
        overflow:hidden;
    }

    .upload-fill{
        width:0%;
        height:100%;
        background:#22c55e;
        transition:width .15s linear;
    }

    .upload-status{
        font-size:12px;
        color: rgb(238, 231, 231);
        margin-top:5px;
    }