.install-prompt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100010;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.install-prompt-backdrop.show {
    display: flex;
    opacity: 1;
}

body.dark-theme .install-prompt-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.install-prompt {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px 24px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.15),
        0 10px 30px -10px rgba(0, 0, 0, 0.08),
        inset 0 2px 3px -1px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px -1px rgba(255, 255, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    text-align: center;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    overflow: hidden;
}

.install-prompt-backdrop.show .install-prompt {
    transform: scale(1) translateY(0);
}

.install-prompt::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 46%;
    border-radius: 24px 24px 12px 12px / 24px 24px 8px 8px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.install-prompt::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

body.dark-theme .install-prompt {
    background: rgba(30, 30, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.6),
        0 10px 30px -10px rgba(0, 0, 0, 0.4),
        inset 0 2px 3px -1px rgba(255, 255, 255, 0.06),
        inset 0 -2px 4px -1px rgba(255, 255, 255, 0.02),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.dark-theme .install-prompt::before {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}

body.dark-theme .install-prompt::after {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

.install-prompt-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.3);
    z-index: 3;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-theme .install-prompt-close {
    color: rgba(255, 255, 255, 0.35);
}

.install-prompt-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.8);
}

body.dark-theme .install-prompt-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.install-prompt-close svg {
    width: 18px;
    height: 18px;
}

.install-prompt-content {
    position: relative;
    z-index: 2;
}

.install-prompt-icon {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 18px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    background: var(--tab-glass-bg, rgba(255, 255, 255, 0.12));
    animation: floatIcon 3s ease-in-out infinite;
}

body.dark-theme .install-prompt-icon {
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.install-prompt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.install-prompt-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

body.dark-theme .install-prompt-title {
    color: #e8e8e8;
}

.install-prompt-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
    margin: 0 0 22px 0;
    transition: color 0.3s ease;
}

body.dark-theme .install-prompt-desc {
    color: #b0b8c8;
}

.install-prompt-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 22px 0;
    padding: 14px 16px;
    background: rgba(0, 122, 255, 0.05);
    border: 1px solid rgba(0, 122, 255, 0.1);
    border-radius: 14px;
    text-align: right;
}

body.dark-theme .install-prompt-features {
    background: rgba(255, 215, 0, 0.04);
    border-color: rgba(255, 215, 0, 0.08);
}

.install-prompt-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #444;
    transition: color 0.3s ease;
}

body.dark-theme .install-prompt-feature {
    color: #b0b8c8;
}

.install-prompt-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-theme .install-prompt-feature-icon {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.install-prompt-feature-icon svg {
    width: 14px;
    height: 14px;
}

.install-prompt-actions {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
}

.install-prompt-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 30px;
    font-family: 'Estedad', 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.install-prompt-btn svg {
    width: 16px;
    height: 16px;
}

.install-prompt-btn.install {
    background: #007aff;
    border-color: #007aff;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

.install-prompt-btn.install:hover {
    background: #0055b3;
    border-color: #0055b3;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.4);
}

.install-prompt-btn.install:active {
    transform: scale(0.97);
}

body.dark-theme .install-prompt-btn.install {
    background: #ffd700;
    border-color: #ffd700;
    color: #0a1628;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

body.dark-theme .install-prompt-btn.install:hover {
    background: #ffe44d;
    border-color: #ffe44d;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.install-prompt-btn.later {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.1);
    color: #555;
}

.install-prompt-btn.later:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
}

body.dark-theme .install-prompt-btn.later {
    border-color: rgba(255, 255, 255, 0.1);
    color: #b0b8c8;
}

body.dark-theme .install-prompt-btn.later:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.install-prompt-ios-hint {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(0, 122, 255, 0.06);
    border: 1px solid rgba(0, 122, 255, 0.1);
    border-radius: 12px;
    font-size: 0.78rem;
    color: #555;
    line-height: 1.7;
    text-align: right;
}

body.dark-theme .install-prompt-ios-hint {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.08);
    color: #b0b8c8;
}

.install-prompt-ios-hint.show {
    display: block;
}

.install-prompt-ios-hint strong {
    color: #007aff;
    font-weight: 700;
}

body.dark-theme .install-prompt-ios-hint strong {
    color: #ffd700;
}

.install-prompt-ios-hint .ios-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 6px;
    color: #007aff;
    vertical-align: middle;
    margin: 0 2px;
}

body.dark-theme .install-prompt-ios-hint .ios-icon {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.install-prompt-ios-hint .ios-icon svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 480px) {
    .install-prompt-backdrop {
        padding: 12px;
        align-items: flex-end;
    }

    .install-prompt {
        padding: 26px 20px 20px;
        border-radius: 22px;
        max-width: 100%;
        transform: scale(1) translateY(100%);
    }

    .install-prompt-backdrop.show .install-prompt {
        transform: scale(1) translateY(0);
    }

    .install-prompt-icon {
        width: 76px;
        height: 76px;
        border-radius: 18px;
        margin-bottom: 14px;
    }

    .install-prompt-title {
        font-size: 1.1rem;
    }

    .install-prompt-desc {
        font-size: 0.82rem;
        margin-bottom: 18px;
    }

    .install-prompt-features {
        padding: 12px 14px;
        gap: 8px;
        margin-bottom: 18px;
    }

    .install-prompt-feature {
        font-size: 0.75rem;
    }

    .install-prompt-btn {
        padding: 11px 16px;
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .install-prompt-backdrop,
    .install-prompt,
    .install-prompt-icon,
    .install-prompt-btn {
        transition: none !important;
        animation: none !important;
    }
}