/*
 * Override Buttons
 */

/* 3-Color GO! Manila System:
               - Manila Blue: #4a6fa5 (main brand color)
               - White: #ffffff (text and backgrounds)
               - Deep Manila: #2c4a7a (darker shade for interactions)
            */

.bg-green {
    color: #ffffff;
    background-color: #4a6fa5;
}

.th-green {
    color: #ffffff !important;
    background-color: #4a6fa5;
    font-weight: bold !important;
}

.btn-primary {
    color: #ffffff;
    background-color: #4a6fa5;
    border-color: #4a6fa5;
}

.btn-primary:hover {
    color: #ffffff;
    background-color: #2c4a7a;
    border-color: #2c4a7a;
}

.btn-primary:focus,
.btn-primary.focus {
    box-shadow: 0 0 0 .2rem rgba(74, 111, 165, 0.5)
}

.btn-primary.disabled,
.btn-primary:disabled {
    color: #212529;
    background-color: #4a6fa5;
    border-color: #4a6fa5;
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show>.btn-primary.dropdown-toggle {
    color: #ffffff;
    background-color: #2c4a7a;
    border-color: #2c4a7a;
}

.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus,
.show>.btn-primary.dropdown-toggle:focus {
    box-shadow: 0 0 0 .2rem rgba(44, 74, 122, 0.5)
}

.btn-outline-primary {
    color: #4a6fa5;
    background-color: transparent;
    background-image: none;
    border-color: #4a6fa5;
}

.btn-outline-primary:hover {
    color: #ffffff;
    background-color: #2c4a7a;
    border-color: #2c4a7a;
}

.btn-outline-primary:focus,
.btn-outline-primary.focus {
    box-shadow: 0 0 0 .2rem rgba(74, 111, 165, 0.3)
}

.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
    color: #4a6fa5;
    background-color: transparent;
}

.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show>.btn-outline-primary.dropdown-toggle {
    color: #ffffff;
    background-color: #2c4a7a;
    border-color: #2c4a7a;
}

.btn-outline-primary:not(:disabled):not(.disabled):active:focus,
.btn-outline-primary:not(:disabled):not(.disabled).active:focus,
.show>.btn-outline-primary.dropdown-toggle:focus {
    box-shadow: 0 0 0 .2rem rgba(44, 74, 122, 0.3)
}


/*
 * Enroll Layout form
 */

#video,
#canvas {
    width: 420px;
    height: 420px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}


#videoPhoto {
    width: auto;
    height: auto;
    display: block;
    width: 40vw; /* Full viewport width */
}

#frame-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    border: 2px solid lime;
    border-radius: 3px;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
}

/* 👇 Blur with a rectangular hole in the center */
.blur-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 1;

    /* Cut a transparent rectangular hole using mask */
    -webkit-mask-image: radial-gradient(closest-side, transparent 0%, transparent 99%, black 100%);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    mask-image: linear-gradient(#000 0 0);
    /* fallback solid mask */
}

/* Use mask-position and size to make the transparent cut match #frame-box */
.blur-overlay {
    --cut-width: 300px;
    --cut-height: 300px;
    --cut-radius: 3px; /* Match frame-box radius */

    mask-image: none;
    -webkit-mask-image: none;
    -webkit-mask: radial-gradient(circle, black 100%, black 100%) no-repeat, linear-gradient(black, black);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;

    /* Size and position of transparent box */
    -webkit-mask-position: center;
    -webkit-mask-size: var(--cut-width) var(--cut-height);
}


 /*
 * Camera Layout form
 */
 body {
    /* background: linear-gradient(135deg, #4a6fa5 0%, #2c4a7a 100%); */
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


.verification-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 420px;
    max-height: 420px;
    aspect-ratio: 1 / 1;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f1f1;
    overflow: hidden;
    border-radius: 15px;
    /* fallback background */
}

/* .camera-container {
    background: #f8f9fa;
    border-radius: 15px;
    border: 3px dashed #dee2e6;
    width: 400px;
    height: 400px;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    margin-left: auto;
    margin-right: auto;
} */

.camera-active {
    border-color: #28a745;
    border-style: solid;
}

.face-detected {
    border-color: #4a6fa5;
    border-style: solid;
    box-shadow: 0 0 20px rgba(74, 111, 165, 0.5);
}

/* #video {
    width: 400px;
    height: 400px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
} */

#faceCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 12px;
}

.captured-image {
    width: 420px;
    height: 420px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
}



.verification-steps {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}


.step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.step.active {
    background: #e8f0ff;
    border-left: 4px solid #4a6fa5;
}

.step.completed {
    background: #e8f5e8;
    border-left: 4px solid #2c4a7a;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    background: #dee2e6;
    color: #6c757d;
}

.step.active .step-icon {
    background: #4a6fa5;
    color: white;
}

.step.completed .step-icon {
    background: #2c4a7a;
    color: white;
}

.btn-camera {
    background: linear-gradient(45deg, #4a6fa5, #2c4a7a);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.4);
}

.btn-camera:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.6);
    color: white;
}

.btn-capture {
    background: linear-gradient(45deg, #2c4a7a, #4a6fa5);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-capture:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-verify {
    background: linear-gradient(45deg, #4a6fa5, #2c4a7a);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-verify:hover {
    transform: translateY(-2px);
    color: white;
}

.auto-scan-controls {
    background: #e8f0ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #4a6fa5;
}

.detection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.detection-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 2s infinite;
}

.detection-indicator.active {
    background: #4a6fa5;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(74, 111, 165, 0.9);
    color: white;
    padding: 20px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    display: none;
    z-index: 10;
}

.loading-spinner {
    display: none;
}

.verification-result {
    display: none;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
}

.success-result {
    background: linear-gradient(45deg, #2c4a7a, #4a6fa5);
    color: white;
}

.error-result {
    background: linear-gradient(45deg, #dc3545, #e63946);
    color: white;
}

