/* ===================================================
   PWA WF – Floating Install Button (FAB)
   =================================================== */

#pwa-wf-fab {
    position: fixed;
    z-index: 99999;
    display: none; /* shown via JS when prompt available */
    align-items: center;
    gap: 10px;
    background: #1976D2;
    color: #ffffff;
    padding: 12px 20px 12px 14px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(25, 118, 210, 0.45);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease,
        opacity 0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    animation: pwa-fab-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pwa-fab-enter {
    from {
        opacity: 0;
        transform: scale(0.6) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#pwa-wf-fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 36px rgba(25, 118, 210, 0.55);
}

#pwa-wf-fab:active {
    transform: scale(0.97);
}

/* Icon */
.pwa-wf-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.pwa-wf-fab-icon svg,
.pwa-wf-fab-ps-icon {
    width: 22px;
    height: 22px;
    fill: #ffffff;
    display: block;
}

.pwa-fab-custom-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

/* Label */
.pwa-wf-fab-label {
    white-space: nowrap;
    line-height: 1;
}

/* Ripple */
.pwa-wf-fab-ripple {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
    pointer-events: none;
}

#pwa-wf-fab:active .pwa-wf-fab-ripple {
    opacity: 1;
    transform: scale(2);
    transition: none;
}

/* Hide when dismissed */
#pwa-wf-fab.pwa-fab-dismissed {
    animation: pwa-fab-exit 0.3s ease forwards;
}

@keyframes pwa-fab-exit {
    to {
        opacity: 0;
        transform: scale(0.7) translateY(10px);
    }
}

/* Responsive – smaller on mobile */
@media (max-width: 480px) {
    #pwa-wf-fab {
        font-size: 13px;
        padding: 10px 16px 10px 12px;
        gap: 8px;
    }
    .pwa-wf-fab-icon {
        width: 22px;
        height: 22px;
    }
    .pwa-wf-fab-ps-icon {
        width: 18px;
        height: 18px;
    }
}

/* =====================
   FAB TOOLTIP
   ===================== */
#pwa-wf-fab-tooltip {
    position: fixed;
    z-index: 100000;
    max-width: 280px;
    background: #1a2332;
    color: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    opacity: 0;
    transform: translateY(8px) scale(.97);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
#pwa-wf-fab-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
#pwa-wf-fab-tooltip strong {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #fff;
}
#pwa-wf-fab-tooltip ol {
    margin: 0;
    padding-left: 18px;
}
#pwa-wf-fab-tooltip ol li {
    margin-bottom: 5px;
}
#pwa-wf-fab-tooltip p {
    margin: 0;
    color: rgba(255,255,255,.85);
}
/* Arrow – default: tooltip is ABOVE the FAB, arrow points DOWN */
#pwa-wf-fab-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    border: 8px solid transparent;
    border-bottom: none;
    border-top-color: #1a2332;
}
/* Arrow – .arrow-up: tooltip is BELOW the FAB, arrow points UP */
#pwa-wf-fab-tooltip.arrow-up::after {
    bottom: auto;
    top: -8px;
    border-top: none;
    border-bottom: 8px solid #1a2332;
}
/* Warning variant for ios-other mode */
#pwa-wf-fab-tooltip.pwa-wf-tooltip-warn {
    background: #1e1209;
    border: 1px solid rgba(255, 160, 0, 0.4);
}
#pwa-wf-fab-tooltip.pwa-wf-tooltip-warn::after {
    border-top-color: #1e1209;
}
#pwa-wf-fab-tooltip.pwa-wf-tooltip-warn.arrow-up::after {
    border-top-color: transparent;
    border-bottom-color: #1e1209;
}
