/* PWA Install Popup Premium 2026 Design */
.pwa-popup-container {
    position: fixed;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Tajawal', sans-serif;
    color: var(--text-main, #fff);
    dir: rtl;
}

.pwa-popup-container.show {
    opacity: 1;
    pointer-events: all;
}

/* Default: Desktop & Tablet (Floating Bottom Left) */
.pwa-popup-container {
    bottom: 30px;
    left: 30px;
    width: 360px;
    transform: translateY(20px) scale(0.95);
}

.pwa-popup-container.show {
    transform: translateY(0) scale(1);
}

.pwa-popup-content {
    background: rgba(13, 17, 23, 0.85);
    /* Dark Glass */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Glow Effect */
.pwa-popup-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top right, rgba(0, 174, 239, 0.15), transparent 50%),
        radial-gradient(circle at bottom left, rgba(227, 30, 36, 0.1), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.pwa-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.pwa-app-icon {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    padding: 10px;
}

.pwa-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pwa-title-group {
    flex: 1;
}

.pwa-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.pwa-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #9ca3af);
    margin: 0;
}

.pwa-close-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted, #9ca3af);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.pwa-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.pwa-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.pwa-install-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--primary, #E31E24), #b0171c);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 16px rgba(227, 30, 36, 0.2);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(227, 30, 36, 0.3);
}

.pwa-later-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main, #fff);
    border-radius: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-later-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* iOS Specific Instructions */
.pwa-ios-instructions {
    display: none;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted, #9ca3af);
    position: relative;
    z-index: 1;
}

.pwa-ios-instructions.show {
    display: block;
}

.pwa-ios-instructions .ios-icon {
    font-size: 1.2rem;
    color: #0ea5e9;
    margin: 0 4px;
    vertical-align: middle;
}

/* Mobile Layout - Bottom Sheet */
@media (max-width: 600px) {
    .pwa-popup-container {
        width: 100%;
        left: 0;
        bottom: 0;
        transform: translateY(100%);
        padding: 15px;
    }

    .pwa-popup-container.show {
        transform: translateY(0);
    }

    .pwa-popup-content {
        border-radius: 28px;
        padding: 24px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }
}

/* Light Theme Overrides */
[data-theme="light"] .pwa-popup-container {
    color: var(--text-main, #020617);
}

[data-theme="light"] .pwa-popup-content {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .pwa-subtitle {
    color: var(--text-muted, #475569);
}

[data-theme="light"] .pwa-close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted, #475569);
}

[data-theme="light"] .pwa-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-main, #020617);
}

[data-theme="light"] .pwa-later-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-main, #020617);
}

[data-theme="light"] .pwa-later-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .pwa-ios-instructions {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-muted, #475569);
}

[data-theme="light"] .pwa-ios-instructions strong {
    color: var(--text-main, #020617) !important;
}