#stop-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #333;
    z-index: 1002;
}

.scanner-main-container {
    max-width: 800px;
    margin: 0 auto;
}

#scanner-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#interactive {
    width: 100%;
    height: auto;
    min-height: 400px;
}

#interactive video,
#interactive canvas {
    width: 100%;
    height: auto;
    display: block;
}

.focus-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    height: 200px;
    border: 3px solid #4CAF50;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 10;
}

.focus-frame::before,
.focus-frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid #4CAF50;
}

.focus-frame::before {
    top: -4px;
    left: -4px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 10px;
}

.focus-frame::after {
    top: -4px;
    right: -4px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 10px;
}

.focus-frame .corner-bl,
.focus-frame .corner-br {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid #4CAF50;
}

.focus-frame .corner-bl {
    bottom: -4px;
    left: -4px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 10px;
}

.focus-frame .corner-br {
    bottom: -4px;
    right: -4px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 10px;
}

.scanning-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4CAF50, transparent);
    animation: scan 2s linear infinite;
    top: 0;
}

@keyframes scan {
    0% {
        top: 0;
    }
    50% {
        top: calc(100% - 2px);
    }
    100% {
        top: 0;
    }
}

.overlay-content {
    position: relative;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.overlay-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
}

.instruction-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.controls {
    text-align: center;
    margin-top: 20px;
}

.status {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    background: #333;
}

.drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
}