/**
 * File: includes/shared/scanner/scanner.css
 * Module: OML Shared Driver Scanner
 * Version: 1.1.0
 */

.oml-shared-scanner-root {
    position: relative;
    z-index: 999999;
}

/* FULLSCREEN MODE */

.oml-scanner-mode-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #000;
    color: #fff;
}

.oml-scanner-mode-fullscreen .oml-scanner-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: #000;
}

.oml-scanner-mode-fullscreen .oml-scanner-camera {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.oml-scanner-mode-fullscreen .oml-scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* EMBEDDED MODE */

.oml-scanner-embedded-host-active {
    width: 100%;
}

.oml-scanner-mode-embedded {
    position: relative;
    width: 100%;
    height: 50vh;
    max-height: 520px;
    min-height: 280px;
    overflow: hidden;
    border-radius: 20px;
    background: #000;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}

.oml-scanner-mode-embedded .oml-scanner-shell,
.oml-scanner-mode-embedded .oml-scanner-camera {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.oml-scanner-mode-embedded .oml-scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

/* SHARED CAMERA ELEMENTS */

.oml-scanner-line {
    position: absolute;
    left: 4%;
    right: 4%;
    top: 42%;
    height: 5px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(90, 255, 247, .15),
        rgba(117, 255, 250, 1),
        rgba(90, 255, 247, .15)
    );
    box-shadow:
        0 0 8px rgba(103, 255, 250, .95),
        0 0 18px rgba(103, 255, 250, .85),
        0 0 34px rgba(103, 255, 250, .65);
    animation: omlSharedScannerPulse 1.1s ease-in-out infinite;
    z-index: 3;
}

@keyframes omlSharedScannerPulse {
    0% { opacity: .72; }
    50% { opacity: 1; }
    100% { opacity: .72; }
}

/* TORCH ICON TOP RIGHT */

.oml-scanner-torch {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, .62);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.oml-scanner-torch.is-active {
    background: #0788c8;
}

.oml-scanner-torch.is-disabled,
.oml-scanner-torch:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* HEADER / CLOSE ONLY USED WHEN REQUESTED */

.oml-scanner-head {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9;
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    gap: 8px;
    align-items: center;
    padding: calc(env(safe-area-inset-top) + 10px) 12px 0;
    pointer-events: none;
}

.oml-scanner-copy {
    grid-column: 2;
    text-align: center;
    pointer-events: auto;
}

.oml-scanner-title {
    font-size: 16px;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}

.oml-scanner-subtitle {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 750;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}

.oml-scanner-close {
    grid-column: 3;
    pointer-events: auto;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, .58);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* MESSAGE */

.oml-scanner-message {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 7;
    min-height: 38px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 16px;
    background: rgba(15, 23, 42, .70);
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
    backdrop-filter: blur(10px);
}

.oml-scanner-message.is-success {
    color: #86efac;
}

.oml-scanner-message.is-warning {
    color: #fde68a;
}

.oml-scanner-message.is-danger {
    color: #fca5a5;
}

.oml-scanner-message.is-info {
    color: #bae6fd;
}

/* MANUAL FORM ONLY USED WHEN REQUESTED */

.oml-scanner-manual {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 60px;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
}

.oml-scanner-input {
    min-width: 0;
    min-height: 46px;
    border: none;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    padding: 0 12px;
    font-size: 15px;
    font-weight: 850;
    text-transform: uppercase;
}

.oml-scanner-input::placeholder {
    color: #64748b;
}

.oml-scanner-submit {
    min-height: 46px;
    border: none;
    border-radius: 14px;
    background: #0788c8;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

/* RECEIPT / COLLECTION EMBEDDED OVERRIDES */

.oml-scanner-mode-embedded .oml-scanner-head {
    display: none;
}

.oml-scanner-mode-embedded .oml-scanner-manual {
    display: none;
}

.oml-scanner-mode-embedded .oml-scanner-message {
    bottom: 10px;
    left: 10px;
    right: 10px;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 12px;
}

/* SMALL MOBILE FIXES */

@media (max-width: 420px) {
    .oml-scanner-mode-embedded {
        height: 46vh;
        min-height: 240px;
        border-radius: 18px;
    }

    .oml-scanner-torch {
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
    }
}