﻿/* LC-BarcodeScan.js */
#barcodeScanModal .modal-dialog {
    max-width: 100%;
    margin: 0.5rem auto;
}

.scanner-flex-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 1rem;
}

.scanner-area,
.scanned-list-area {
    flex: 1;
    min-width: 300px;
}

.lc-barcode-scanner {
    width: 100%;
    height: auto;
    min-height: 300px;
    position: relative;
}

.lc-barcode-scanner video,
.lc-barcode-scanner-video {
    width: 100% !important;
    height: auto !important;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.scan-overlay-container {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.scan-notification {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    text-align: center;
    z-index: 30;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 90%;
}

.scan-notification.success {
    background-color: rgba(40, 167, 69, 0.9);
    border: 1px solid #28a745;
}

.scan-notification.warning {
    background-color: rgba(255, 193, 7, 0.9);
    border: 1px solid #ffc107;
    color: #212529;
}

.scan-notification.danger {
    background-color: rgba(220, 53, 69, 0.9);
    border: 1px solid #dc3545;
}

.scan-notification.info {
    background-color: rgba(23, 162, 184, 0.9);
    border: 1px solid #17a2b8;
}

.lc-barcode-scan-notification--enter {
    animation: notification-in 0.3s forwards;
}

.lc-barcode-scan-notification--exit {
    animation: notification-out 0.3s forwards;
}

@keyframes notification-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes notification-out {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
}

.scan-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    border: 3px solid #00e676;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.7);
    z-index: 2;
    border-radius: 10px;
    max-width: 80%;
    max-height: 80%;
}

.lc-barcode-scan-window--fit-width {
    width: var(--lc-barcode-scan-window-size, 70%);
    height: auto;
    aspect-ratio: 1 / 1;
}

.lc-barcode-scan-window--fit-height {
    width: auto;
    height: var(--lc-barcode-scan-window-size, 70%);
    aspect-ratio: 1 / 1;
}

.lc-barcode-scan-window--size-10 {
    --lc-barcode-scan-window-size: 10%;
}

.lc-barcode-scan-window--size-20 {
    --lc-barcode-scan-window-size: 20%;
}

.lc-barcode-scan-window--size-30 {
    --lc-barcode-scan-window-size: 30%;
}

.lc-barcode-scan-window--size-40 {
    --lc-barcode-scan-window-size: 40%;
}

.lc-barcode-scan-window--size-50 {
    --lc-barcode-scan-window-size: 50%;
}

.lc-barcode-scan-window--size-60 {
    --lc-barcode-scan-window-size: 60%;
}

.lc-barcode-scan-window--size-70 {
    --lc-barcode-scan-window-size: 70%;
}

.lc-barcode-scan-window--size-80 {
    --lc-barcode-scan-window-size: 80%;
}

.lc-barcode-scan-window--size-90 {
    --lc-barcode-scan-window-size: 90%;
}

.scanner-video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.scan-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #00e676;
    border-width: 3px;
    border-style: solid;
}

.scan-corner-top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-radius: 10px 0 0 0;
}

.scan-corner-top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 10px 0 0;
}

.scan-corner-bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 10px;
}

.scan-corner-bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 10px 0;
}

.scan-line {
    position: absolute;
    width: calc(100% + 6px);
    height: 2px;
    background-color: #00e676;
    top: 50%;
    left: -3px;
    transform: translateY(-50%);
    animation: scan-line 2s linear infinite;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.8);
}

@keyframes scan-line {
    0% {
        top: 10%;
    }

    50% {
        top: 90%;
    }

    100% {
        top: 10%;
    }
}

.scan-tip {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.lc-barcode-scanned-codes-list {
    max-height: 200px;
    overflow-y: auto;
}

#scanned-codes-container {
    margin-top: 1rem;
    width: 100%;
}

.custom-extension-area {
    width: 100%;
    margin-bottom: 1rem;
}

.custom-extension-area:empty {
    display: none;
    margin-bottom: 0;
}

.lc-barcode-toast-container {
    right: 0;
    bottom: 0;
    z-index: 9999;
}

@media (min-width: 768px) {
    #barcodeScanModal .modal-dialog {
        max-width: 90%;
        margin: 1.75rem auto;
    }

    #barcodeScanModal .modal-content {
        max-height: 100vh;
        margin: 0 auto;
        width: 100%;
    }

    .scanner-flex-container {
        flex-direction: row;
    }

    .scanner-area {
        flex: 6;
    }

    .scanned-list-area {
        flex: 4;
        display: flex;
        flex-direction: column;
    }

    .lc-barcode-scanned-codes-list {
        max-height: 50vh !important;
        flex: 1;
        overflow-y: auto;
        width: 100%;
    }

    .lc-barcode-scanned-codes-list > div {
        width: 100%;
    }

    .lc-barcode-scanned-codes-list > div span {
        max-width: 80%;
    }
}

@media (max-width: 767px) {
    #barcodeScanModal .modal-dialog {
        margin: 0 auto;
        height: 100%;
        max-width: none;
        width: 100%;
    }

    #barcodeScanModal .modal-content {
        height: 100vh;
        border: none;
        border-radius: 0;
        width: 100%;
    }

    #barcodeScanModal .modal-body {
        padding: 0.5rem;
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }

    .scanner-flex-container {
        flex-direction: column;
        width: 100%;
    }

    .modal-footer.scanner-buttons-container {
        flex-wrap: nowrap;
        justify-content: flex-end;
        padding: 0.75rem;
    }

    .modal-footer.scanner-buttons-container button {
        margin: 0.25rem;
        flex: 0 1 auto;
        max-width: calc(50% - 0.5rem);
    }

    .lc-barcode-scanner {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 250px;
    }

    .lc-barcode-scanner video,
    .lc-barcode-scanner-video {
        max-height: 50vh;
    }

    .lc-barcode-scanned-codes-list {
        max-height: 25vh !important;
    }

    .scanner-buttons-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .scanner-buttons-container button {
        margin: 0.25rem;
        flex: 0 1 auto;
        white-space: nowrap;
    }

    .scan-instruction {
        margin-bottom: 0.5rem;
    }
}

