/**
 * KindStock - Charity Retail System
 * Consolidated Stylesheet v6.1.0
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

/* ==========================================================================
   CSS Custom Properties (set dynamically via inline style on :root)
   ========================================================================== */
:root {
    --gs-primary: #1A3C34;
    --gs-secondary: #4A7C6F;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    background: #F8F6F0;
    font-family: 'DM Sans', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', serif;
}

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--gs-primary);
    border-color: var(--gs-primary);
}

.btn-primary:hover {
    background: var(--gs-secondary);
    border-color: var(--gs-secondary);
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
    background: linear-gradient(180deg, var(--gs-primary) 0%, var(--gs-secondary) 100%);
    min-height: 100vh;
    width: 240px;
    transition: all 0.3s ease;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.sidebar-overlay.show {
    display: block;
}

/* Mobile Header */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(135deg, var(--gs-primary), var(--gs-secondary));
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-header .btn-menu {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.mobile-header h6 {
    color: white;
    margin: 0;
}

/* ==========================================================================
   Responsive - Tablet & Mobile
   ========================================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        z-index: 1050;
        height: 100vh;
        width: 260px;
        overflow-y: auto;
    }

    .sidebar.show {
        left: 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Touch-friendly nav links */
    .sidebar .nav-link {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        margin: 0.5rem;
    }

    .sidebar .nav-link i {
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }
}

@media (min-width: 992px) {
    .mobile-header {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   Touch-Friendly Inputs & Buttons
   ========================================================================== */
@media (max-width: 767.98px) {
    .btn {
        min-height: 44px;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px;
    }

    .table td,
    .table th {
        padding: 0.75rem 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.35em 0.5em;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 991.98px) {
    .btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
    }

    .form-control,
    .form-select {
        min-height: 48px;
    }
}

/* Better table scrolling on mobile */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Larger touch targets for checkboxes */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
}

@media (max-width: 767.98px) {
    .form-check-input {
        width: 1.5em;
        height: 1.5em;
    }

    .form-check-label {
        padding-left: 0.5rem;
    }
}

/* Bottom safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ==========================================================================
   Dashboard KPI Cards
   ========================================================================== */
.kpi-card-primary {
    border-left: 4px solid #1A3C34;
}

.kpi-card-success {
    border-left: 4px solid #10b981;
}

.kpi-card-warning {
    border-left: 4px solid #f59e0b;
}

.kpi-card-purple {
    border-left: 4px solid #8b5cf6;
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1A3C34 0%, #4A7C6F 100%);
}

.login-card {
    width: 400px;
}

/* ==========================================================================
   Kiosk Page (Standalone)
   ========================================================================== */
.kiosk-body {
    background: linear-gradient(135deg, var(--gs-primary) 0%, var(--gs-secondary) 100%);
    min-height: 100vh;
}

.kiosk-body h1,
.kiosk-body .lead {
    color: white;
}

.kiosk-card {
    border: none;
    border-radius: 1rem;
}

#sigCanvas {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    background: white;
    touch-action: none;
}

/* Gift Aid checkbox scaling for touch */
.gift-aid-switch {
    transform: scale(1.5);
}

/* ==========================================================================
   Station Page (Standalone)
   ========================================================================== */
.station-body {
    background: #f8fafc;
}

.donor-card {
    cursor: pointer;
    transition: all 0.2s;
}

.donor-card:hover {
    background: #e3f2fd;
}

.donor-card.selected {
    background: #bbdefb;
    border-color: #2196f3;
}

/* ==========================================================================
   Point of Sale (POS)
   ========================================================================== */
.pos-container {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 2rem);
    padding: 1rem;
}

.cart-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.keypad-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

.cart-item {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
}

.cart-item:hover,
.cart-item.selected {
    background: #e3f2fd;
}

.cart-item.gift-aid {
    border-left: 3px solid #10b981;
}

.keypad-btn {
    height: 60px;
    font-size: 1.5rem;
    font-weight: bold;
}

.pay-btn {
    height: 100%;
    font-size: 1.5rem;
}

.quick-btn {
    height: 50px;
    font-size: 0.8rem;
}

.pin-display {
    font-size: 2rem;
    letter-spacing: 1rem;
    font-family: monospace;
}

.pin-keypad-container {
    max-width: 300px;
    margin: 0 auto;
}

/* ==========================================================================
   Stock Aging Report
   ========================================================================== */
.aging-table-scroll {
    max-height: 300px;
    overflow-y: auto;
}

/* ==========================================================================
   Error Page (Standalone)
   ========================================================================== */
.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */
.pin-input-sm {
    width: 60px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-uppercase {
    text-transform: uppercase;
}

/* Disabled UI state (used for POS when not logged in) */
.ui-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Gradient backgrounds for standalone pages */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--gs-primary) 0%, var(--gs-secondary) 100%);
}

/* Navbar gradient */
.navbar-gradient {
    background: linear-gradient(135deg, var(--gs-primary) 0%, var(--gs-secondary) 100%);
}

/* ==========================================================================
   Touch Optimizations for Tablets & Mobile
   ========================================================================== */

/* Disable tap highlight for cleaner touch feedback */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly button sizes for tablets */
@media (min-width: 768px) and (max-width: 1199.98px) {
    /* POS keypad buttons - larger for tablets */
    .keypad-btn {
        height: 70px;
        font-size: 1.75rem;
    }

    .quick-btn {
        height: 60px;
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    /* Action buttons row - taller touch targets */
    .pos-container .row.g-2.mb-2 .btn {
        min-height: 60px;
        font-size: 1rem;
    }

    /* Pay button */
    .pay-btn {
        font-size: 1.75rem;
    }

    /* PIN keypad buttons */
    .pin-keypad-container .btn {
        min-height: 60px;
        font-size: 1.5rem;
    }

    /* Modal buttons */
    .modal-footer .btn {
        min-height: 50px;
        padding: 0.75rem 1.5rem;
    }

    /* Cart items - easier to tap */
    .cart-item {
        padding: 1rem;
        min-height: 60px;
    }

    /* Form controls */
    .form-control,
    .form-select {
        min-height: 50px;
        font-size: 1rem;
    }

    .form-control-lg,
    .form-select-lg {
        min-height: 56px;
        font-size: 1.1rem;
    }

    /* Table rows - tappable */
    .table td {
        padding: 1rem 0.75rem;
        vertical-align: middle;
    }

    /* Badges - larger for touch */
    .badge {
        padding: 0.5em 0.75em;
        font-size: 0.85rem;
    }

    /* Alert close buttons */
    .btn-close {
        padding: 1rem;
    }

    /* Station page category dropdowns */
    .station-body .form-select {
        min-height: 56px;
        font-size: 1.1rem;
    }
}

/* Large tablets / landscape mode */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .keypad-panel {
        width: 450px;
    }

    .keypad-btn {
        height: 75px;
    }
}

/* Portrait tablet POS layout - stack panels vertically */
@media (max-width: 991.98px) and (orientation: portrait) {
    .pos-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .keypad-panel {
        width: 100%;
    }

    .cart-panel {
        max-height: 40vh;
    }
}

/* Kiosk signature canvas - larger on tablets */
@media (min-width: 768px) {
    #sigCanvas {
        min-height: 200px;
    }
}

/* Active state feedback for touch */
.btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Prevent text selection on buttons/interactive elements */
.btn,
.cart-item,
.keypad-btn,
.quick-btn,
.pin-keypad-container button {
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   Enhanced POS Touch Targets (WCAG 2.1 - minimum 44x44px)
   ========================================================================== */

/* POS action buttons row - Item, Basket%, Misc, Remove, Refund */
.pos-container .keypad-panel > .row.g-2.mb-2:first-of-type .btn {
    min-height: 48px;
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .pos-container .keypad-panel > .row.g-2.mb-2:first-of-type .btn {
        min-height: 56px;
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
    }
}

/* Payment modal buttons - larger touch targets */
#payModal .btn-lg {
    min-height: 64px;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    #payModal .btn-lg {
        min-height: 72px;
        font-size: 1.4rem;
    }
}

/* Modal close buttons - ensure tappable */
.modal-header .btn-close {
    width: 44px;
    height: 44px;
    padding: 1rem;
}

/* Success/refund modal action buttons */
#successModal .btn-lg,
#refundSuccessModal .btn-lg {
    min-height: 56px;
    padding: 0.75rem 1.5rem;
}

/* Refund lookup/confirm buttons */
#refundLookupModal .modal-footer .btn,
#refundConfirmModal .modal-footer .btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
}

@media (min-width: 768px) {
    #refundLookupModal .modal-footer .btn,
    #refundConfirmModal .modal-footer .btn {
        min-height: 56px;
        padding: 0.75rem 1.5rem;
        font-size: 1.05rem;
    }
}

/* Discount modal - slider-friendly input and buttons */
#discountModal .form-control-lg {
    min-height: 56px;
    font-size: 1.5rem;
}

#discountModal .modal-footer .btn {
    min-height: 48px;
}

/* Till close/sign out modal buttons */
#closeTillModal .modal-footer .btn,
#signOutModal .modal-footer .btn {
    min-height: 48px;
}

@media (min-width: 768px) {
    #closeTillModal .modal-footer .btn,
    #signOutModal .modal-footer .btn {
        min-height: 56px;
        font-size: 1.05rem;
    }
}

/* Till closed summary modal */
#tillClosedModal .modal-footer .btn {
    min-height: 56px;
    padding: 0.75rem 2rem;
}

/* Cart header buttons (Sign Out, Close Till) */
.cart-panel .card-header .btn-sm {
    min-height: 36px;
    padding: 0.375rem 0.75rem;
}

@media (min-width: 768px) {
    .cart-panel .card-header .btn-sm {
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Barcode input clear button */
.keypad-panel .input-group .btn-outline-danger {
    min-width: 48px;
    padding: 0.5rem 0.75rem;
}

@media (min-width: 768px) {
    .keypad-panel .input-group .btn-outline-danger {
        min-width: 56px;
        padding: 0.75rem 1rem;
    }
}

/* Select elements in modals (refund reason dropdown) */
.modal .form-select-lg {
    min-height: 56px;
}

/* Touch-friendly spacing for cart item content */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .cart-item strong {
        font-size: 1.1rem;
    }

    .cart-item small {
        font-size: 0.9rem;
    }
}

/* Improved visual feedback for touch */
.btn:active,
.cart-item:active,
.keypad-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Focus visible for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid rgba(26, 60, 52, 0.5);
    outline-offset: 2px;
}

/* Larger touch area for cart item selection */
@media (pointer: coarse) {
    .cart-item {
        padding: 1rem 0.75rem;
        min-height: 70px;
    }

    .keypad-btn {
        height: 65px;
    }

    .quick-btn {
        height: 55px;
    }
}

/* ==========================================================================
   Admin Interface Touch Optimization (WCAG 2.1 Compliant)
   ========================================================================== */

/* Sidebar navigation - touch-friendly links */
.sidebar .nav-link {
    min-height: 44px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
}

@media (max-width: 991.98px) {
    .sidebar .nav-link {
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
}

/* Mobile header menu button */
.mobile-header .btn-menu {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
}

/* Admin table rows - tappable with adequate height */
.table tbody tr td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .table tbody tr td {
        padding: 1rem 0.75rem;
    }
}

/* Admin action buttons in tables (Edit, Delete, View) */
.table .btn-sm {
    min-height: 36px;
    min-width: 36px;
    padding: 0.375rem 0.5rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .table .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* List group items (used in admin.html for orgs/shops) */
.list-group-item-action {
    min-height: 60px;
    padding: 1rem;
    display: flex;
    align-items: center;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .list-group-item-action {
        min-height: 68px;
        padding: 1.125rem 1rem;
    }
}

/* Admin card headers with action buttons */
.card-header .btn-sm {
    min-height: 38px;
    padding: 0.5rem 0.875rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .card-header .btn-sm {
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Pagination buttons */
.pagination .page-link {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .pagination .page-link {
        min-width: 48px;
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Filter/search inputs in admin */
.admin-filter .form-control,
.admin-filter .form-select,
.card-body .form-control,
.card-body .form-select {
    min-height: 44px;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .admin-filter .form-control,
    .admin-filter .form-select,
    .card-body .form-control,
    .card-body .form-select {
        min-height: 50px;
        font-size: 1rem;
    }
}

/* Stock aging action buttons */
.admin-stock-aging .btn-outline-success {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .admin-stock-aging .btn-outline-success {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
}

/* Bulk action buttons (Preview Bulk Discounts, Apply All) */
.card-body .btn-lg {
    min-height: 52px;
    padding: 0.75rem 1.5rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .card-body .btn-lg {
        min-height: 56px;
        padding: 0.875rem 1.75rem;
        font-size: 1.1rem;
    }
}

/* Admin summary cards - larger touch on mobile */
.card.text-center .card-body h3 {
    font-size: 1.75rem;
}

@media (max-width: 767.98px) {
    .card.text-center .card-body {
        padding: 1rem;
    }

    .card.text-center .card-body h3 {
        font-size: 1.5rem;
    }
}

/* Alert dismiss buttons */
.alert .btn-close {
    min-width: 44px;
    min-height: 44px;
    padding: 1rem;
}

/* Transfers page item table action buttons */
.transfers-table .btn-sm {
    min-height: 38px;
    min-width: 38px;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .transfers-table .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
    }
}

/* ==========================================================================
   Kiosk Interface Touch Optimization
   ========================================================================== */

/* Kiosk form controls - extra large for public use */
.kiosk-body .form-control,
.kiosk-body .form-select {
    min-height: 48px;
    font-size: 1rem;
}

.kiosk-body .form-control-lg,
.kiosk-body .form-select-lg {
    min-height: 56px;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .kiosk-body .form-control,
    .kiosk-body .form-select {
        min-height: 52px;
        font-size: 1.05rem;
    }

    .kiosk-body .form-control-lg,
    .kiosk-body .form-select-lg {
        min-height: 60px;
        font-size: 1.15rem;
    }
}

/* Kiosk submit button - large prominent touch target */
.kiosk-body .btn-lg.w-100 {
    min-height: 64px;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .kiosk-body .btn-lg.w-100 {
        min-height: 72px;
        font-size: 1.4rem;
    }
}

/* Gift Aid switch - already has scale(1.5), enhance touch area */
.kiosk-body .form-check.form-switch {
    min-height: 48px;
    padding-left: 3.5rem;
    display: flex;
    align-items: center;
}

.kiosk-body .form-check-input.gift-aid-switch {
    width: 3.5rem;
    height: 1.75rem;
    margin-left: -3.5rem;
}

@media (min-width: 768px) {
    .kiosk-body .form-check.form-switch {
        min-height: 56px;
        padding-left: 4rem;
    }

    .kiosk-body .form-check-input.gift-aid-switch {
        width: 4rem;
        height: 2rem;
        margin-left: -4rem;
    }
}

/* Kiosk signature canvas - touch optimized */
.kiosk-body #sigCanvas {
    min-height: 150px;
    touch-action: none;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: crosshair;
}

@media (min-width: 768px) {
    .kiosk-body #sigCanvas {
        min-height: 200px;
    }
}

/* Kiosk clear signature button */
.kiosk-body #clearSig {
    min-height: 40px;
    min-width: 80px;
}

@media (min-width: 768px) {
    .kiosk-body #clearSig {
        min-height: 44px;
        min-width: 100px;
    }
}

/* Kiosk card styling for better touch experience */
.kiosk-card {
    border-radius: 1rem;
}

.kiosk-card .card-body {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .kiosk-card .card-body {
        padding: 2rem;
    }
}

/* Kiosk success card button */
.kiosk-body #successCard .btn-lg {
    min-height: 56px;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .kiosk-body #successCard .btn-lg {
        min-height: 64px;
        font-size: 1.25rem;
    }
}

/* Kiosk title selector (dropdown) */
.kiosk-body select[name="title"],
.kiosk-body select[name="communication"] {
    min-height: 48px;
}

@media (min-width: 768px) {
    .kiosk-body select[name="title"],
    .kiosk-body select[name="communication"] {
        min-height: 52px;
    }
}

/* ==========================================================================
   Touch Device Detection Enhancements (Admin & Kiosk)
   ========================================================================== */

/* Coarse pointer (touch) specific enhancements */
@media (pointer: coarse) {
    /* Admin list items */
    .list-group-item-action {
        min-height: 72px;
    }

    /* Admin table buttons */
    .table .btn-sm {
        min-height: 48px;
        min-width: 48px;
    }

    /* Pagination on touch */
    .pagination .page-link {
        min-width: 52px;
        min-height: 52px;
    }

    /* Kiosk form controls on touch */
    .kiosk-body .form-control,
    .kiosk-body .form-select {
        min-height: 56px;
    }

    /* Kiosk submit on touch */
    .kiosk-body .btn-lg.w-100 {
        min-height: 76px;
    }

    /* Sidebar links on touch */
    .sidebar .nav-link {
        min-height: 52px;
    }
}

/* Active feedback for admin/kiosk elements */
.list-group-item-action:active,
.sidebar .nav-link:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Prevent accidental double-tap zoom on kiosk */
.kiosk-body {
    touch-action: manipulation;
}

.kiosk-body button,
.kiosk-body input,
.kiosk-body select {
    touch-action: manipulation;
}

/* ==========================================================================
   Barcode Scanner
   ========================================================================== */

/* Scanner viewport container */
.scanner-viewport {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    background: #000;
}

.scanner-viewport video {
    width: 100%;
    height: auto;
    display: block;
}

.scanner-viewport canvas.drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Scanner overlay with scan region guide */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scan region box - visual guide for user */
.scanner-region {
    width: 70%;
    max-width: 300px;
    height: 100px;
    border: 3px solid rgba(26, 60, 52, 0.8);
    border-radius: 8px;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4);
    animation: scanner-pulse 2s ease-in-out infinite;
}

@keyframes scanner-pulse {
    0%, 100% {
        border-color: rgba(26, 60, 52, 0.6);
    }
    50% {
        border-color: rgba(26, 60, 52, 1);
    }
}

/* Scan success flash effect */
.scanner-viewport.scan-success .scanner-region {
    border-color: #10b981;
    animation: scanner-success 0.3s ease-out;
}

@keyframes scanner-success {
    0% {
        transform: scale(1);
        border-color: #10b981;
    }
    50% {
        transform: scale(1.05);
        border-color: #10b981;
    }
    100% {
        transform: scale(1);
        border-color: #10b981;
    }
}

/* Scanner modal responsive adjustments */
@media (max-width: 767.98px) {
    .scanner-viewport {
        min-height: 250px;
    }

    .scanner-region {
        width: 80%;
        height: 80px;
    }
}

@media (min-width: 768px) {
    .scanner-viewport {
        min-height: 350px;
    }
}
