/* PWA install prompts — iOS modal + Android banner.
   Mirrors the styling used on demo.robottrader.ai. */

@media (max-width: 767.98px) {
    /* iOS Add-to-Home-Screen modal */
    .rb-ios-prompt-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 2099;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .rb-ios-prompt-backdrop--visible { opacity: 1; }

    .rb-ios-prompt {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2100;
        padding: 0 12px calc(16px + env(safe-area-inset-bottom, 0px));
        transform: translateY(110%);
        transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .rb-ios-prompt--visible { transform: translateY(0); }

    .rb-ios-prompt__card {
        background: #fff;
        border-radius: 20px;
        padding: 20px 20px 16px;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.24);
        position: relative;
    }

    .rb-ios-prompt__close {
        position: absolute;
        top: 14px;
        right: 14px;
        background: rgba(120, 120, 128, 0.16);
        border: none;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        font-size: 17px;
        line-height: 1;
        color: #3c3c43;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .rb-ios-prompt__header {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 16px;
        padding-right: 32px;
    }

    .rb-ios-prompt__icon {
        width: 54px;
        height: 54px;
        border-radius: 12px;
        object-fit: contain;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .rb-ios-prompt__title {
        font-size: 16px;
        font-weight: 700;
        color: #0f172a;
        margin: 0 0 3px;
    }

    .rb-ios-prompt__subtitle {
        font-size: 13px;
        color: #64748b;
        margin: 0;
        line-height: 1.4;
    }

    .rb-ios-prompt__steps {
        background: #f8fafc;
        border-radius: 12px;
        padding: 14px 16px;
        margin-bottom: 14px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .rb-ios-prompt__step {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        color: #334155;
        line-height: 1.4;
    }

    .rb-ios-prompt__step-num {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: #1940b0;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .rb-ios-prompt__share-icon {
        width: 15px;
        height: 15px;
        vertical-align: -2px;
        display: inline-block;
        margin: 0 1px;
    }

    .rb-ios-prompt__btn {
        display: block;
        width: 100%;
        padding: 13px;
        background: #1940b0;
        border: none;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        text-align: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: opacity 0.12s;
    }

    .rb-ios-prompt__btn:active { opacity: 0.8; }

    .rb-ios-prompt__arrow {
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #fff;
        margin: 0 auto;
        filter: drop-shadow(0 4px 4px rgba(0,0,0,0.12));
    }

    /* Android / Chrome install banner */
    .rb-pwa-banner {
        position: fixed;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
        left: 12px;
        right: 12px;
        background: #1940b0;
        color: #fff;
        border-radius: 16px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        z-index: 1040;
        box-shadow: 0 8px 24px rgba(25,64,176,0.40);
        animation: rb-slide-up 0.3s cubic-bezier(0.4,0,0.2,1) both;
    }

    .rb-pwa-banner__text    { flex: 1; font-size: 13px; font-weight: 500; line-height: 1.4; }
    .rb-pwa-banner__install { background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
    .rb-pwa-banner__close   { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 20px; cursor: pointer; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

    @keyframes rb-slide-up {
        from { opacity: 0; transform: translateY(16px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}
