/**
 * Mega Vehicle Services - Mobile App Native UX & Touch Polish Stylesheet
 * 
 * Enforces pure native-app feel:
 * 1. Zero web tap highlights (-webkit-tap-highlight-color: transparent)
 * 2. Zero accidental text selection when scrolling
 * 3. Zero callout context menus on long-press (-webkit-touch-callout: none)
 * 4. Contained overscroll behavior (prevents rubber-band conflict with SwipeRefreshLayout)
 * 5. Native inertia momentum touch scrolling
 * 6. Responsive safe-area notch and navigation padding
 */

:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

/* 1. Eliminate Tap Highlights Everywhere */
*,
*::before,
*::after {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    outline: none !important;
}

/* 2. Disable Long-Press Context Menus on Interactive Elements */
img,
a,
button,
.btn,
.nav-link,
.card {
    -webkit-touch-callout: none !important;
}

/* 3. Disable Accidental Text Selection across App Chrome & Navigation */
html,
body,
header,
nav,
footer,
button,
.btn,
.card,
.card-header,
.card-footer,
.badge,
.modal-header,
.modal-footer,
.sidebar-wrapper,
.dropdown-menu,
.nav-tabs,
.nav-link,
.table-responsive th {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* 3.1 Preserve Selection on Inputs & Content that Users Need to Copy/Edit */
input,
textarea,
select,
[contenteditable="true"],
.selectable,
.user-select-text,
.vehicle-no,
.customer-number,
.transaction-id,
.referral-code-text {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* 4. Contained Overscroll Behavior (Zero Rubber-Band Glitch with SwipeRefresh) */
html,
body {
    overscroll-behavior-y: contain !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 5. Clean Mobile Scrollbar (Native Aesthetic) */
body::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
    width: 0px !important;
    height: 0px !important;
}

body,
.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* 9. Clutter Suppression Inside Native Android Container */
body.is-android-app .btn-app-download,
body.is-android-app a[href*=".apk"],
body.is-android-app .sidebar-body a[href*=".apk"],
body.is-android-app .header-inner a[href*=".apk"] {
    display: none !important;
}

/* 10. Real-Time Network Offline / Online Animated Banner */
.mvs-network-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    padding: max(10px, env(safe-area-inset-top, 0px)) 16px 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mvs-network-banner.banner-offline {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    border-bottom: 2px solid #ef5350;
}

.mvs-network-banner.banner-online {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border-bottom: 2px solid #66bb6a;
}

@keyframes bannerSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 8. Top Native App Progress Bar for Dynamic SPA Transitions */
.mvs-page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3ddc84, #00e676, #00b0ff);
    z-index: 1000000;
    display: none;
    box-shadow: 0 0 10px rgba(61, 220, 132, 0.7);
    pointer-events: none;
}

/* 9. Interactive Earnings Cards Filter */
.earnings-card {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.earnings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.earnings-card:active {
    transform: scale(0.97);
}

.earnings-card.active {
    box-shadow: 0 0 0 3px #ffffff, 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    transform: translateY(-3px) scale(1.02);
}

.earnings-card.active::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    color: #111111;
    font-size: 11px;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.reset-link {
    font-size: 13px;
    font-weight: 600;
    color: #e53935;
    text-decoration: none !important;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(229, 57, 53, 0.08);
    transition: all 0.2s ease;
}

.reset-link:hover,
.reset-link:active {
    background: rgba(229, 57, 53, 0.16);
    color: #c62828;
}

/* Table Row Action (Remove Row) in Single Vehicle */
.table-block .table-row .t-col.col-action {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.table-block .table-row .t-col.col-action .remove-row {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    padding: 0;
    color: #e53935;
    line-height: 1;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.table-block .table-row .t-col.col-action .remove-row:hover,
.table-block .table-row .t-col.col-action .remove-row:active {
    background-color: rgba(229, 57, 53, 0.14);
    transform: scale(1.15);
}

.table-block .table-row .t-col.col-action .remove-row svg {
    width: 14px;
    height: 14px;
    stroke: #e53935;
    display: block;
}