/**
 * POS Barcode & QR Code Scanner Styles
 */

/* Camera Viewport & Laser Scanner Animation */
.scanner-viewport-wrapper {
    position: relative;
    width: 100%;
    min-height: 280px;
    max-height: 380px;
    background-color: #0b111e;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scanner-reader {
    width: 100% !important;
    border: none !important;
}

#scanner-reader video {
    width: 100% !important;
    height: auto !important;
    max-height: 380px !important;
    object-fit: cover !important;
    border-radius: 12px;
}

#scanner-reader__scan_region {
    background: transparent !important;
}

#scanner-reader img[alt="Info icon"] {
    display: none !important;
}

/* Custom Viewfinder Target Box */
.scanner-laser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-target-box {
    position: relative;
    width: 250px;
    height: 250px;
    max-width: 80%;
    max-height: 80%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.45);
}

/* Corner highlights on target box */
.scanner-target-box::before,
.scanner-target-box::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: #00d2ff;
    border-style: solid;
}

.scanner-target-box::before {
    top: -2px;
    left: -2px;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 16px;
}

.scanner-target-box::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 16px;
}

.scanner-corner-tr {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-color: #00d2ff;
    border-style: solid;
    border-width: 4px 4px 0 0;
    border-top-right-radius: 16px;
}

.scanner-corner-bl {
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 28px;
    height: 28px;
    border-color: #00d2ff;
    border-style: solid;
    border-width: 0 0 4px 4px;
    border-bottom-left-radius: 16px;
}

/* Animated Glowing Laser Line */
.scanner-laser-line {
    position: absolute;
    left: 5%;
    width: 90%;
    height: 3px;
    background: linear-gradient(90deg, rgba(0, 210, 255, 0) 0%, #00d2ff 50%, rgba(0, 210, 255, 0) 100%);
    box-shadow: 0 0 12px #00d2ff, 0 0 20px #00d2ff;
    animation: scannerScan 2s infinite alternate ease-in-out;
    border-radius: 50%;
}

@keyframes scannerScan {
    0% {
        top: 10%;
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 90%;
        opacity: 0.85;
    }
}

/* Scanner Button inside Search Group */
.pos-scan-btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 4;
    cursor: pointer;
    white-space: nowrap;
}

.pos-scan-btn:hover,
#header-pos-scanner-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

#header-pos-scanner-btn {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    white-space: nowrap;
}

/* Scanner Modal Polish */
#pos-scanner-modal .modal-content {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
}

#pos-scanner-modal .modal-header {
    background: linear-gradient(135deg, #107980 0%, #0d5d62 100%);
    color: #fff;
    padding: 1rem 1.25rem;
}

#pos-scanner-modal .modal-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

#pos-scanner-modal .close {
    color: #fff;
    opacity: 0.9;
    text-shadow: none;
    font-size: 1.4rem;
}

#pos-scanner-modal .close:hover {
    opacity: 1;
}

/* Flashlight / Torch active indicator */
.btn-torch-active {
    background-color: #ffc107 !important;
    color: #212529 !important;
    border-color: #ffc107 !important;
}

/* Scanner Feedback Cards */
#scanner-last-result {
    transition: all 0.3s ease;
    border-radius: 8px;
}

/* Wireless Scanner Pairing Styles */
.custom-nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    color: #4b5563;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
}

.custom-nav-tabs .nav-link.active {
    color: #107980;
    border-color: #dee2e6 #dee2e6 #fff;
    background-color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
    animation: statusDotPulse 1.5s infinite;
}

@keyframes statusDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

