/* Enhanced Barcode Scanner Styles */

.scanner-modal .modal-content {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.scanner-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.scanner-modal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.scanner-modal .close {
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.scanner-modal .close:hover {
    opacity: 1;
}

#scannerContainer {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

#scannerVideo {
    transition: opacity 0.3s ease-in-out;
}

#scannerPlaceholder {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: #ecf0f1;
    padding: 2rem;
}

#scannerPlaceholder i {
    color: #3498db;
    margin-bottom: 1rem;
}

#scannerOverlay {
    background: rgba(0,0,0,0.1);
}

#scannerOverlay > div {
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    border: 3px solid #fff;
    border-radius: 12px;
    position: relative;
}

#scannerOverlay > div::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #3498db;
    border-radius: 12px;
    animation: scannerPulse 2s infinite;
}

@keyframes scannerPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

#scannerStatus {
    border-radius: 8px;
    border: none;
    margin-bottom: 1rem;
}

#scannerStatus.alert-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#scannerStatus.alert-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

#scannerStatus.alert-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#scannerStatus.alert-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.scanner-buttons .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.scanner-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.scanner-buttons .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.scanner-buttons .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.scanner-buttons .btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.scanner-buttons .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Loading animation */
.scanner-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Camera selection dropdown */
.camera-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0,0,0,0.7);
    border-radius: 6px;
    padding: 8px;
    color: white;
    font-size: 0.875rem;
}

.camera-selector select {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.875rem;
}

.camera-selector select:focus {
    outline: none;
    border-color: #3498db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scanner-modal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    #scannerContainer {
        height: 280px;
    }
    
    .scanner-buttons .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Accessibility improvements */
.scanner-modal .modal-content:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.scanner-modal button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #scannerOverlay > div {
        border-color: #000;
    }
    
    .scanner-modal .modal-header {
        background: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #scannerOverlay > div::before {
        animation: none;
    }
    
    .scanner-buttons .btn:hover {
        transform: none;
    }
    
    .scanner-loading {
        animation: none;
    }
}
