/**
 * Barcode Scanner Visual Feedback Styles
 */

/* Field highlight when barcode is scanned */
.barcode-scanned {
    animation: barcode-flash 0.5s ease-in-out;
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2) !important;
}

@keyframes barcode-flash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(39, 174, 96, 0.1);
    }
}

/* Notification popup */
.barcode-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    animation: slide-in 0.3s ease-out;
    max-width: 400px;
}

.barcode-notification.barcode-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.barcode-notification.fade-out {
    animation: slide-out 0.3s ease-out forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.barcode-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.barcode-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.barcode-text strong {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .barcode-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 0.75rem 1rem;
    }

    .barcode-icon {
        font-size: 1.25rem;
    }

    .barcode-text {
        font-size: 0.85rem;
    }

    .barcode-text strong {
        font-size: 0.9rem;
    }
}

/* Loading indicator for when barcode is being processed */
.barcode-processing {
    position: relative;
}

.barcode-processing::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #27ae60;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}
