/* Ramli PWA Styles */

/* 1. Install Prompt Banner */
.ramli-pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 480px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 16px 36px -10px rgba(56, 110, 172, 0.25), 0 0 1px 1px rgba(56, 110, 172, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.9);
    z-index: 99999;
    padding: 14px 16px;
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.ramli-pwa-install-banner.pwa-banner-fadeout {
    animation: pwaSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideDown {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
}

.pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.pwa-icon-box {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #386EAC 0%, #4A7EBB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(56, 110, 172, 0.25);
    overflow: hidden;
}

.pwa-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.pwa-text-box {
    flex: 1;
    min-width: 0;
}

.pwa-title {
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.3;
    margin-bottom: 2px;
}

.pwa-desc {
    font-size: 11px;
    color: #64748B;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-action-box {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-btn-later {
    background: transparent;
    border: none;
    color: #64748B;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pwa-btn-later:hover {
    color: #1E293B;
    background: #F1F5F9;
}

.pwa-btn-install {
    background: linear-gradient(135deg, #386EAC 0%, #4A7EBB 100%);
    color: #FFFFFF;
    border: none;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(56, 110, 172, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.pwa-btn-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 110, 172, 0.4);
}

.pwa-btn-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E2E8F0;
    color: #475569;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 2. Update Toast */
.pwa-update-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1E293B;
    color: #FFFFFF;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    animation: pwaSlideDownToast 0.3s ease-out;
}

@keyframes pwaSlideDownToast {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-update-btn {
    background: #386EAC;
    color: #FFFFFF;
    border: none;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-update-btn:hover {
    background: #4A7EBB;
}

/* 3. Network Status Badge */
.ramli-net-badge {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: opacity 0.4s ease;
}

.ramli-net-badge.net-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
}

.ramli-net-badge.net-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

@media (max-width: 576px) {
    .ramli-pwa-install-banner {
        bottom: calc(75px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 20px);
        padding: 12px 14px;
    }
    .pwa-desc {
        max-width: 140px;
    }
}
