/* Shared QR scanner styles for the _QrScanner partial (UbiPark.Web.Shared). */

/* Optional hint text above/below the scanner */
.scanner-hint {
    text-align: center;
    margin: .5rem 0;
    color: #444;
}

.reader {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.status {
    padding: .75rem;
    border-radius: 6px;
    background: #f5f5f5;
}

.status.ok {
    background: #e9f8ec;
    color: #1e7e34;
}

.status.error {
    background: #fdeaea;
    color: #a71d2a;
}

.is-hidden {
    display: none !important;
}

/* Manual code entry row */
.manual-field-row {
    margin-bottom: 10px;
}

.manual-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
}

/* Inline reader with fullscreen overlay button */
.reader-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.reader-wrap .reader {
    margin-bottom: 0;
}

/* Shared overlay button (fullscreen enter/exit, on top of the camera) */
.scanner-overlay-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    cursor: pointer;
}

.scanner-overlay-button:hover {
    background: rgba(0, 0, 0, .65);
}

.scanner-overlay-button .k-svg-icon {
    width: 22px;
    height: 22px;
}

.enter-fullscreen-button {
    display: none; /* shown by JS once the inline camera starts */
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.enter-fullscreen-button.is-visible {
    display: flex;
}

.pause-scanner-button {
    display: none; /* shown by JS once the inline camera starts */
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.pause-scanner-button.is-visible {
    display: flex;
}

/* Full-screen scanner sheet */
.scanner-sheet {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 0px !important;
}

.reader-sheet {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 50vh;
    background: #000;
    overflow: hidden;
}

.reader-sheet video,
.reader-sheet canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.exit-fullscreen-button {
    position: absolute;
    top: 3vh;
    right: 3vw;
    z-index: 6;
}

.pause-scanner-button-sheet {
    display: none; /* shown by JS once the sheet camera starts */
    position: absolute;
    top: 3vh;
    left: 3vw;
    z-index: 6;
}

.pause-scanner-button-sheet.is-visible {
    display: flex;
}

/* Status (icon + message) shown above the centred QR box */
.sheet-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    width: max-content;
    max-width: 70%;
    text-align: center;
    color: #fff;
}

.sheet-status .sheet-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-status .sheet-status-icon .k-svg-icon {
    width: 40px;
    height: 40px;
}

.sheet-status .sheet-status-text {
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

.sheet-status.ok .sheet-status-icon {
    color: #3ddc6b;
}

.sheet-status.error .sheet-status-icon {
    color: #ff5a5f;
}

/* Flashlight toggle below the centred QR box */
.scanner-torch-button {
    display: none; /* shown by JS when torch is available */
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    cursor: pointer;
}

.scanner-torch-button.is-visible {
    display: flex;
}

.scanner-torch-button:hover {
    background: rgba(255, 255, 255, .28);
}

.scanner-torch-button .scanner-svg-icon {
    width: 26px;
    height: 26px;
}

.scanner-torch-button.torch-on {
    color: #1b1b1b;
    background: #ffd34d;
}

/* Ensure content fills the entire wrapper */
.k-actionsheet-content {
    margin: 0 auto !important;
    padding: 0 !important;
    width: fit-content !important;
}

/* Require for iOS */
.k-actionsheet-view {
    height: 100% !important;
}
