/* ==========================================================================
   Subway ERP - PWA Install UI Styles
   ========================================================================== */

/* ==========================================================================
   Global Browser Scrollbar Suppression (Website & PWA)
   ========================================================================== */
html,
body,
* {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar,
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-thumb {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

/* ==========================================================================
   Zero-Flicker Standalone Protection (Instant CSS Engine Evaluation)
   Guarantees zero microsecond flicker when running in installed app
   ========================================================================== */
@media all and (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .pwa-install-btn,
    .pwa-sidebar-item,
    .pwa-install-banner,
    .pwa-header-btn,
    #pwa-install-banner,
    #pwa-ios-modal,
    #pwa-desktop-modal {
        display: none !important;
    }
}

html.pwa-standalone .pwa-install-btn,
html.pwa-standalone .pwa-sidebar-item,
html.pwa-standalone .pwa-install-banner,
html.pwa-standalone .pwa-header-btn,
html.pwa-standalone #pwa-install-banner,
html.pwa-standalone #pwa-ios-modal,
html.pwa-standalone #pwa-desktop-modal {
    display: none !important;
}

/* Header Install Button */
.pwa-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #eafaf1;
    color: #008c3a !important;
    border: 1.5px solid #008c3a;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    cursor: pointer;
    margin-right: 15px;
    box-shadow: 0 2px 6px rgba(0, 140, 58, 0.12);
}

.pwa-header-btn:hover {
    background-color: #008c3a;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 140, 58, 0.25);
    transform: translateY(-1px);
}

.pwa-header-btn svg,
.pwa-header-btn i {
    font-size: 15px;
}

@media (max-width: 575px) {
    .pwa-header-btn span {
        display: none;
    }
    .pwa-header-btn {
        padding: 8px 10px;
        border-radius: 50%;
        margin-right: 8px;
    }
}

/* Login Page Install Button */
.pwa-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #008c3a;
    border: 2px solid #008c3a;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none !important;
}

.pwa-login-btn:hover {
    background: #008c3a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 140, 58, 0.25);
}

/* Sidebar Install Item */
.sidebar-menu .pwa-sidebar-item a {
    color: #008c3a !important;
    font-weight: 600;
}

.sidebar-menu .pwa-sidebar-item a:hover {
    background-color: #008c3a !important;
    color: #ffffff !important;
}

/* Floating Bottom Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: -150px;
    left: 20px;
    right: 20px;
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #008c3a;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    padding: 14px 18px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 999999;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-banner.pwa-banner-show {
    bottom: 25px;
    display: flex;
}

.pwa-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pwa-banner-text strong {
    font-size: 14px;
    color: #1a202c;
    font-weight: 700;
    line-height: 1.2;
}

.pwa-banner-text span {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-banner-btn-install {
    background-color: #008c3a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.pwa-banner-btn-install:hover {
    background-color: #006b2c;
    transform: scale(1.02);
}

.pwa-banner-btn-close {
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.pwa-banner-btn-close:hover {
    color: #4a5568;
}

@media (max-width: 575px) {
    .pwa-install-banner {
        left: 12px;
        right: 12px;
        bottom: -150px;
        padding: 12px 14px;
    }
    .pwa-install-banner.pwa-banner-show {
        bottom: 15px;
    }
    .pwa-banner-icon {
        width: 38px;
        height: 38px;
    }
    .pwa-banner-text strong {
        font-size: 13px;
    }
    .pwa-banner-text span {
        font-size: 11px;
    }
    .pwa-banner-btn-install {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Modals Overlay (iOS & Desktop Instructions) */
.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    padding: 20px;
}

.pwa-modal-content {
    background: #ffffff;
    border-radius: 14px;
    max-width: 440px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: pwaModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pwa-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 18px;
}

.pwa-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pwa-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    line-height: 1.2;
}

.pwa-modal-subtitle {
    font-size: 13px;
    color: #718096;
    margin: 3px 0 0;
}

.pwa-modal-close {
    position: absolute;
    top: -5px;
    right: -5px;
    background: transparent;
    border: none;
    font-size: 26px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.pwa-modal-close:hover {
    color: #4a5568;
}

.pwa-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.pwa-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #eafaf1;
    color: #008c3a;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-step-text {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.45;
    padding-top: 3px;
}

.pwa-modal-footer {
    display: flex;
    justify-content: flex-end;
}

.pwa-btn-primary {
    background-color: #008c3a;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

.pwa-btn-primary:hover {
    background-color: #006b2c;
}
