/* ============================================================
   PWA Install Banner — Blue & White Theme
   ============================================================ */

.pwa-install {
    position: fixed;
    inset-inline: 12px;
    bottom: 12px;
    z-index: 10050;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    /* Blue & White gradient */
    background: linear-gradient(135deg, #ffffff 0%, #eaf2ff 55%, #dbe9ff 100%);
    color: #0b2545;
    border: 1px solid rgba(33, 99, 232, 0.18);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(33, 99, 232, 0.18), 0 4px 10px rgba(0, 0, 0, 0.06);
    font-family: Tahoma, sans-serif;
    direction: rtl;
    /* Soft entrance animation */
    transform: translateY(120%);
    opacity: 0;
    animation: pwa-slide-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity;
    overflow: hidden;
}

    /* Decorative soft glow behind the banner */
    .pwa-install::before {
        content: "";
        position: absolute;
        inset: -40% -20% auto auto;
        width: 220px;
        height: 220px;
        background: radial-gradient(circle, rgba(33, 99, 232, 0.18), transparent 70%);
        pointer-events: none;
        filter: blur(2px);
        animation: pwa-glow 6s ease-in-out infinite alternate;
    }

/* Entrance animation */
@keyframes pwa-slide-in {
    from {
        transform: translateY(120%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Soft pulsing glow */
@keyframes pwa-glow {
    from {
        transform: scale(1) translate(0, 0);
        opacity: 0.7;
    }

    to {
        transform: scale(1.15) translate(-10px, 10px);
        opacity: 1;
    }
}

.pwa-install[hidden] {
    display: none !important;
}

/* ---------- Text ---------- */

.pwa-install p {
    margin: 0;
    flex: 1;
    font-size: 14px;
    line-height: 1.8;
    font-family: 'IRANSans', Tahoma, sans-serif;
    color: #0b2545;
    letter-spacing: 0.2px;
}

/* ---------- Actions ---------- */

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.pwa-install-btn,
.pwa-install-dismiss {
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Primary button ---------- */

.pwa-install-btn {
    position: relative;
    background: linear-gradient(135deg, #2163e8 0%, #3b82f6 50%, #2163e8 100%);
    background-size: 200% 200%;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(33, 99, 232, 0.35);
    animation: pwa-btn-gradient 4s ease infinite;
}

    /* Shine sweep effect */
    .pwa-install-btn::after {
        content: "";
        position: absolute;
        top: 0;
        inset-inline-start: -60%;
        width: 40%;
        height: 100%;
        background: linear-gradient( 120deg, transparent, rgba(255, 255, 255, 0.55), transparent );
        transform: skewX(-20deg);
        transition: inset-inline-start 0.6s ease;
    }

    .pwa-install-btn:hover::after {
        inset-inline-start: 120%;
    }

    .pwa-install-btn:hover {
        transform: translateY(-2px) scale(1.03);
        box-shadow: 0 10px 22px rgba(33, 99, 232, 0.45);
    }

    .pwa-install-btn:active {
        transform: translateY(0) scale(0.97);
        box-shadow: 0 4px 10px rgba(33, 99, 232, 0.35);
    }

    .pwa-install-btn[hidden] {
        display: none !important;
    }

@keyframes pwa-btn-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ---------- Dismiss button ---------- */

.pwa-install-dismiss {
    background: rgba(33, 99, 232, 0.08);
    color: #2163e8;
    border: 0;
    font-size: 20px;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .pwa-install-dismiss:hover {
        background: rgba(33, 99, 232, 0.16);
        color: #0b2545;
        transform: rotate(90deg) scale(1.05);
    }

    .pwa-install-dismiss:active {
        transform: rotate(90deg) scale(0.95);
    }

/* ---------- Responsive tweaks ---------- */

@media (max-width: 420px) {
    .pwa-install {
        padding: 12px 14px;
        gap: 10px;
        border-radius: 14px;
    }

        .pwa-install p {
            font-size: 13px;
            line-height: 1.7;
        }

    .pwa-install-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ---------- Respect reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .pwa-install,
    .pwa-install::before,
    .pwa-install-btn {
        animation: none !important;
    }

    .pwa-install {
        transform: none;
        opacity: 1;
    }

    .pwa-install-btn,
    .pwa-install-dismiss {
        transition: none;
    }
}
