.subtitle {
    opacity: 0.7;
    font-size: 15px;
    margin-top: 6px;
}

.main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    gap: 14px;
    max-width: 720px;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    width: 640px;
    height: 380px;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 255, 157, 0.25);
    border: 4px solid #111;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.overlay {
    position: absolute;
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s;
}

#status-text {
    top: 20px;
    background: rgba(10, 10, 10, 0.85);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

#camera-reminder {
    top: 0px;
    background: rgba(255, 235, 59, 0.9);
    color: #000;
    padding: 7px 0px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(255, 235, 59, 0.4);
}

#guide-message {
    top: 30px;
    border-top: none;
    background: rgb(248 56 103) !important;
    color: #fff;
    padding: 8px 26px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(255, 235, 59, 0.4);
    display: none;
}

.distance-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 390px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    overflow: hidden;
    z-index: 10;
}

.distance-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff3366, #00ff9d, #00ff9d);
    transition: width 0.4s ease;
}

.distance-label {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #aaa;
    z-index: 11;
}

.progress-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    overflow: hidden;
    z-index: 10;
    display: none;
}

#fit-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green), #00ccff);
    transition: width 0.4s ease;
}

.controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

#start-btn {
    background: var(--green);
    color: #000;
}

#stop-btn,
#capture-btn {
    background: #222;
    color: white;
}

#capture-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-box {
    padding: 28px 40px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 50px rgba(0, 255, 157, 0.2);
    display: none;
    animation: popIn 0.4s;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pd-value {
    font-size: 68px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--green);
    line-height: 1;
    letter-spacing: -2px;
}

.info {
    margin-top: 12px;
    font-size: 15px;
    opacity: 0.85;
}

.live-guide-panel {
    background: #111;
    padding: 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    font-size: 14.5px;
    line-height: 1.65;
}

.tip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.tip::before {
    content: "â†’";
    color: var(--green);
    font-size: 18px;
}

#card-box {
    position: absolute;
    width: 260px;
    height: 160px;
    border: 3px dashed #00ff9d;
    border-radius: 12px;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
}


#card-text {
    position: absolute;
    top: 68%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 600;
    background: rgba(0, 255, 157, 0.9);
    color: #000;
    padding: 6px 16px;
    border-radius: 20px;
}

#pd-result {
    font-size: 24px;
    margin-bottom: 20px !important;
    margin-top: 18px !important;
}

.subtitle {
    color: #000;
    font-size: 1.1rem;
}

button {
    color: #000;
    border: none;
    padding: 14px 32px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* box-shadow: 0 0 15px rgba(0, 255, 255, 0.5); */
}

/* button:hover {
            background: #00ffcc;
            transform: translateY(-3px);
        } */

#scannerWrapper {
    display: none;
    margin-top: 20px;
}

.scanner-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 20px auto;
    /* border: 2px solid #000; */
    border-radius: 16px;
    overflow: hidden;
    /* box-shadow: 0 0 40px rgba(0, 0, 0, 0.1); */
}

canvas {
    width: 100%;
    height: auto;
    display: block;
}

#centerLine {
    position: absolute;
    left: 50%;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(transparent, #00ffff, transparent);
    box-shadow: 0 0 20px #00ffff;
    transform: translateX(-50%);
    pointer-events: none;
    animation: scanPulse 2s infinite;
}

.product-gallery {
    position: sticky;
    top: 0;
}

@keyframes scanPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* .info-panel {
    border: 1px solid #00ffff;
    border-radius: 12px;
} */

#statusBar {
    font-size: 18px;
    margin: 18px 0 0;
    min-height: auto;
}

#countdown {
    font-size: 2.3rem;
    font-weight: 600;
    color: #dac2a7;
    display: none;
    margin: 8px 0 8px;
}

#pd {
    font-size: 2.3rem;
    color: #dac2a7;
    margin: 8px 0 8px;
    font-weight: 600;
}

#popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#popupContent {
    background: #0f0f1f;
    border: 2px solid #00ffff;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.6);
}

#close-pd {
    position: absolute;
    right: 0;
    top: 0;
    background-color: #000;
    color: #fff;
    font-size: 10px;
    width: 25px;
    height: 25px;
    line-height: 25px;
    border-radius: 50px;
}

.pd-container {
    position: relative;
}

.pd-custom-container h1 {
    font-size: 25px;
    margin-top: 18px;
}

.pd-custom-container p.subtitle {
    font-size: 14px;
}

.pd-custom-container {
    padding-bottom: 16px;
}

.color-select-check-box label.radio-custom-label::before {
    content: '';
    background: #000;
    border: 2px solid #fff;
    display: inline-block;
    vertical-align: middle;
    width: 14px;
    height: 14px;
    padding: 2px;
    margin-right: 0;
    text-align: center;
    top: -2px;
    position: relative;
    border-radius: 50px;
}

.color-select-check-box label.radio-custom-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 15px;
    letter-spacing: 1px;
}

.addon-radio {
    opacity: 0;
    position: absolute;
}

.color-select-check-box .addon-radio:checked+.radio-custom-label:before {
    content: "\f00c";
    font-family: 'FontAwesome';
    color: #fff;
    font-size: 14px;
}

@media only screen and (max-width: 1365px) {
    .color-select-check-box .addon-radio:checked+.radio-custom-label:before {
        font-size: 12px;
        line-height: 15px;
    }
}

@media only screen and (max-width: 991px) {
    .product-gallery {
        position: relative;
        top: 0;
    }
}