#scanner-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.camera-view {
    width: 100%;
    height: 100%;
    position: relative;
}

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

.overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.camera-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.drawingBuffer {
    display: none;
}

.scan-highlight {
    animation: highlight 0.5s ease-out;
}

@keyframes highlight {
    0% {
        background-color: var(--bs-success);
        transform: scale(1);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Objects highlighting */
.object-box {
    position: absolute;
    border: 2px solid var(--bs-warning);
    pointer-events: none;
    z-index: 20;
    border-radius: 4px;
}

.object-label {
    position: absolute;
    background-color: var(--bs-warning);
    color: var(--bs-dark);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 2px;
    top: -20px;
    left: 0;
    white-space: nowrap;
}

.barcode-box {
    position: absolute;
    border: 2px solid var(--bs-success);
    pointer-events: none;
    z-index: 20;
    border-radius: 4px;
}

.barcode-label {
    position: absolute;
    background-color: var(--bs-success);
    color: var(--bs-dark);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 2px;
    top: -20px;
    left: 0;
    white-space: nowrap;
}

/* Cart highlight for real-time updates */
.highlight-section {
    animation: cart-highlight 2s ease;
}

@keyframes cart-highlight {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(var(--bs-success-rgb), 0.15);
    }
}

/* List item styling */
.list-scan-item, .list-detection-item {
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    padding: 0.75rem 1rem;
}

.list-scan-item {
    border-left-color: var(--bs-primary);
}

.list-detection-item {
    border-left-color: var(--bs-success);
    margin-bottom: 0.25rem;
}

.list-scan-item:hover, .list-detection-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.detection-label {
    text-transform: capitalize;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    #scanner-container {
        height: 300px;
    }
    
    .object-label, .barcode-label {
        font-size: 0.6rem;
        padding: 1px 4px;
        top: -16px;
    }
    
    .list-scan-item, .list-detection-item {
        padding: 0.5rem 0.75rem;
    }
}
