/**
 * KHADIJA FOUNDATION - OFFICIAL APP INSTALL & SHORTCUT POPUP
 * Branded Theme: Emerald Green (#058245), Royal Blue (#005696) & Gold (#ffd166)
 */

.kf-pwa-popup-wrapper {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9999999;
    max-width: 410px;
    width: calc(100vw - 36px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-24px) translateX(36px) scale(0.93);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Visible State */
.kf-pwa-popup-wrapper.kf-pwa-show {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) translateX(0) scale(1) !important;
    visibility: visible !important;
    display: block !important;
}

/* Premium Card Box */
.kf-pwa-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 22px;
    padding: 22px 20px 18px 20px;
    box-shadow: 0 24px 50px -10px rgba(0, 56, 100, 0.24), 
                0 8px 20px -4px rgba(5, 130, 69, 0.14),
                0 0 0 1px rgba(0, 86, 150, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

/* Top Branded Shimmer Gradient Stripe (Green -> Blue -> Gold) */
.kf-pwa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4.5px;
    background: linear-gradient(90deg, #058245 0%, #005696 55%, #ffd166 100%);
}

/* Close Button */
.kf-pwa-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.25s ease;
    z-index: 2;
    padding: 0;
}

.kf-pwa-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

/* Branded Badge Row (Emerald & Gold) */
.kf-pwa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(5, 130, 69, 0.08) 0%, rgba(0, 86, 150, 0.08) 100%);
    color: #058245;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    border: 1px solid rgba(5, 130, 69, 0.22);
}

.kf-pwa-badge svg,
.kf-pwa-badge i {
    color: #f59e0b;
    font-size: 11.5px;
}

/* Card Content Layout */
.kf-pwa-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 16px;
}

/* App Icon Container */
.kf-pwa-icon-box {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 16px;
    background: #ffffff;
    border: 1.5px solid rgba(0, 86, 150, 0.18);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 86, 150, 0.12);
    overflow: visible;
}

.kf-pwa-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

/* Live Active Green Indicator Dot with Pulse Effect */
.kf-pwa-icon-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2.5px solid #FFFFFF;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
    animation: kfPwaPulse 2s infinite;
}

@keyframes kfPwaPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* App Info */
.kf-pwa-info {
    flex: 1;
    min-width: 0;
}

.kf-pwa-title {
    font-size: 16px;
    font-weight: 800;
    color: #07162c;
    margin: 0 0 4px 0;
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.kf-pwa-desc {
    font-size: 12.5px;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

/* Action Buttons */
.kf-pwa-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* Download App Primary CTA - NGO Emerald to Navy Gradient */
.kf-pwa-btn-install {
    flex: 1;
    background: linear-gradient(135deg, #058245 0%, #005696 100%);
    color: #FFFFFF !important;
    border: none;
    padding: 11px 16px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(5, 130, 69, 0.32);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
    letter-spacing: 0.2px;
}

.kf-pwa-btn-install svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
}

.kf-pwa-btn-install:hover {
    background: linear-gradient(135deg, #046c39 0%, #004578 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 130, 69, 0.44);
    color: #FFFFFF !important;
}

.kf-pwa-btn-install:active {
    transform: translateY(1px);
}

/* Later Button */
.kf-pwa-btn-later {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kf-pwa-btn-later:hover {
    background: #f0fdf4;
    color: #058245;
    border-color: #058245;
    box-shadow: 0 2px 8px rgba(5, 130, 69, 0.12);
}

/* Responsive adjustments for Mobile - Compact & Slim Size */
@media (max-width: 576px) {
    .kf-pwa-popup-wrapper {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        margin: 0 auto;
    }
    
    .kf-pwa-card {
        padding: 10px 12px 10px 12px;
        border-radius: 16px;
        box-shadow: 0 12px 32px -4px rgba(0, 56, 100, 0.25), 
                    0 4px 12px -2px rgba(5, 130, 69, 0.12);
    }

    .kf-pwa-close-btn {
        top: 7px;
        right: 8px;
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .kf-pwa-badge {
        font-size: 8.5px;
        padding: 1.5px 8px;
        margin-bottom: 6px;
        letter-spacing: 0.4px;
        line-height: 1.2;
    }

    .kf-pwa-badge svg {
        width: 9px;
        height: 9px;
    }

    .kf-pwa-content {
        gap: 10px;
        margin-bottom: 9px;
        align-items: center;
    }

    .kf-pwa-icon-box {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        padding: 2px;
    }

    .kf-pwa-icon-dot {
        top: -2px;
        right: -2px;
        width: 9px;
        height: 9px;
        border-width: 1.5px;
    }

    .kf-pwa-title {
        font-size: 13px;
        margin: 0 0 1px 0;
        line-height: 1.2;
        font-weight: 700;
    }

    .kf-pwa-desc {
        font-size: 11px;
        line-height: 1.25;
        color: #475569;
    }

    .kf-pwa-actions {
        gap: 6px;
    }

    .kf-pwa-btn-install {
        padding: 7px 13px;
        font-size: 11.5px;
        border-radius: 20px;
        gap: 5px;
    }

    .kf-pwa-btn-install svg {
        width: 13px;
        height: 13px;
        stroke-width: 2.2;
    }

    .kf-pwa-btn-later {
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 20px;
    }
}

@media (max-width: 380px) {
    .kf-pwa-card {
        padding: 8px 10px;
        border-radius: 14px;
    }

    .kf-pwa-badge {
        display: none;
    }

    .kf-pwa-icon-box {
        width: 34px;
        height: 34px;
    }

    .kf-pwa-title {
        font-size: 12px;
    }

    .kf-pwa-desc {
        font-size: 10px;
    }

    .kf-pwa-btn-install {
        padding: 6px 10px;
        font-size: 11px;
    }

    .kf-pwa-btn-later {
        padding: 5px 9px;
        font-size: 10px;
    }
}

/* Toast Notification (Installed & Shortcut alerts) */
.kf-pwa-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #058245 0%, #005696 100%);
    color: #FFFFFF;
    padding: 11px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(5, 130, 69, 0.35);
    z-index: 99999999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: kfFadeInUp 0.3s ease;
}

@keyframes kfFadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .kf-pwa-toast {
        bottom: 16px;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: max-content;
        max-width: calc(100vw - 32px);
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 24px;
    }
}


