/* Fullscreen camera barcode scanner overlay.
   Driven by wwwroot/js/barcode-scanner.js; markup lives in the consuming view.
   Accent colour matches the site's Bootstrap "success" green (#198754). */

.barcode-scanner {
    position: fixed;
    inset: 0;
    background: #000;
    display: none;
    flex-direction: column;
    z-index: 1050; /* above the fixed mobile nav (z-index 1000) */
}

.barcode-scanner.active {
    display: flex;
}

.barcode-scanner video {
    flex: 1;
    width: 100%;
    object-fit: cover;
}

.barcode-scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78%;
    max-width: 320px;
    aspect-ratio: 3.2 / 1;
    border: 2px solid #198754;
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.42);
}

.barcode-scanner-frame::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: #198754;
    animation: barcode-sweep 1.6s ease-in-out infinite;
    opacity: 0.85;
}

@keyframes barcode-sweep {
    0%, 100% { top: 12%; }
    50% { top: 85%; }
}

.barcode-scanner-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    z-index: 2;
}

.barcode-scanner-top span {
    font-size: 13px;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.barcode-scanner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.barcode-scanner-close,
.barcode-scanner-torch {
    background: rgba(255, 255, 255, 0.14);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barcode-scanner-torch {
    font-size: 0;
}

/* Element+class beats the UA [hidden] rule, so restore hiding explicitly. */
.barcode-scanner-torch[hidden] {
    display: none;
}

.barcode-scanner-torch.is-on {
    background: #ffc107;
    color: #1a1a1a;
}

.barcode-scanner-msg {
    position: absolute;
    bottom: 8%;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 13.5px;
    z-index: 2;
    padding: 0 24px;
}

.barcode-scanner-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3;
}

.barcode-scanner-fallback.show {
    display: flex;
}

.barcode-scanner-fallback p {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
    max-width: 280px;
}
