/**
 * ParamNet ERP - PWA Stylesheet
 * Responsive mobile-first notifications, install prompts, and offline alerts
 */

/* ==========================================================================
   Network Status Toast Banner
   ========================================================================== */
.pwa-network-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.pwa-network-toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-network-toast.offline {
    background-color: #dc2626;
}

.pwa-network-toast.online {
    background-color: #16a34a;
}

.pwa-network-toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   PWA Installation Banner / Card (Balanced & Proportional Design)
   ========================================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 28px;
    right: 28px;
    max-width: 360px;
    width: calc(100% - 48px);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 24px;
    z-index: 99998;
    display: none;
    text-align: center;
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-install-banner.show {
    display: block;
}

.pwa-install-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 1.35rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.pwa-install-close:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.pwa-install-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0 14px 0;
}

.pwa-brand-logo {
    height: 40px;
    max-height: 44px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}

.pwa-install-text {
    font-size: 0.92rem;
    color: #4b5563;
    margin: 0 0 20px 0;
    line-height: 1.5;
    font-weight: 400;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pwa-btn {
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pwa-btn-primary {
    background: #0073ea;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 115, 234, 0.25);
}

.pwa-btn-primary:hover {
    background: #005bb5;
    box-shadow: 0 4px 12px rgba(0, 115, 234, 0.35);
    transform: translateY(-1px);
}

.pwa-btn-subtle {
    background-color: #f3f4f6;
    color: #4b5563;
}

.pwa-btn-subtle:hover {
    background-color: #e5e7eb;
    color: #111827;
}
    transition: background-color 0.2s ease;
}

.pwa-btn-primary {
    background-color: #1e88e5;
    color: #ffffff;
}

.pwa-btn-primary:hover {
    background-color: #1565c0;
}

.pwa-btn-subtle {
    background-color: transparent;
    color: #64748b;
}

.pwa-btn-subtle:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* ==========================================================================
   iOS Installation Guidance Modal
   ========================================================================== */
.pwa-ios-modal {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
    padding: 18px;
    z-index: 99998;
    display: none;
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.4;
}

.pwa-ios-modal.show {
    display: block;
    animation: pwaSlideUp 0.3s ease-out forwards;
}

.pwa-ios-modal-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pwa-ios-steps {
    margin: 10px 0;
    padding-left: 20px;
    font-size: 0.825rem;
}

.pwa-ios-steps li {
    margin-bottom: 6px;
}

/* ==========================================================================
   Service Worker Update Available Banner
   ========================================================================== */
.pwa-update-banner {
    position: fixed;
    top: 16px;
    right: 16px;
    max-width: 360px;
    background-color: #0f172a;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 99999;
    font-size: 0.85rem;
}

.pwa-update-banner.show {
    display: flex;
    animation: pwaSlideUp 0.3s ease-out forwards;
}

.pwa-update-btn {
    background-color: #1e88e5;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-update-btn:hover {
    background-color: #1565c0;
}

/* ==========================================================================
   Desktop Help Modal & Header Button
   ========================================================================== */
.pwa-header-btn {
    transition: all 0.2s ease;
}

.pwa-header-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px;
}

.pwa-desktop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.pwa-desktop-modal.show {
    display: flex;
}

.pwa-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.pwa-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    max-width: 520px;
    width: 90%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 100001;
    animation: pwaSlideUp 0.25s ease-out;
}

.pwa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.pwa-modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.pwa-modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}

.pwa-modal-close:hover {
    color: #0f172a;
}

.pwa-modal-body {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

.pwa-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 480px) {
    .pwa-install-banner {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        width: auto;
        padding: 20px 18px;
    }
}


