/* ═══════════════════════════════════════════
   PWA Install Banner — iOS "Add to Home Screen"
═══════════════════════════════════════════ */

/* ── Floating install button (navbar) ── */
.pwa-install-btn {
    display: none; /* Shown via JS on iOS Safari only */
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--primary-text);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    flex-shrink: 0;
}
.pwa-install-btn:hover {
    background: rgba(255, 0, 110, 0.1);
    border-color: rgba(255, 0, 110, 0.25);
    color: var(--accent);
}
.pwa-install-btn .pwa-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pwaPulse 2s ease-in-out infinite;
}
@keyframes pwaPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

/* ── Bottom sheet banner ── */
.pwa-banner {
    display: none; /* Shown via JS */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 0;
    animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pwaSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pwa-banner.pwa-hiding {
    animation: pwaSlideDown 0.3s ease forwards;
}
@keyframes pwaSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

.pwa-banner-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    animation: pwaFadeIn 0.3s ease forwards;
}
@keyframes pwaFadeIn {
    to { opacity: 1; }
}

.pwa-banner-card {
    background: rgba(15, 18, 35, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 1.5rem 2rem;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

/* Drag handle */
.pwa-banner-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.pwa-banner-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    margin-top: 0.5rem;
}

.pwa-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #050710;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.pwa-banner-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.pwa-banner-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-text);
    margin: 0 0 0.15rem;
}
.pwa-banner-text p {
    font-size: 0.78rem;
    color: var(--secondary-text);
    margin: 0;
    line-height: 1.4;
}

/* ── Steps ── */
.pwa-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.pwa-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}
.pwa-step-num {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 0, 110, 0.1);
    border: 1px solid rgba(255, 0, 110, 0.2);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pwa-step-text {
    font-size: 0.82rem;
    color: var(--primary-text);
    line-height: 1.4;
}
.pwa-step-text .pwa-key {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--accent);
    vertical-align: middle;
}
.pwa-step-text .pwa-key svg {
    flex-shrink: 0;
}

/* ── Dismiss ── */
.pwa-banner-actions {
    display: flex;
    gap: 0.65rem;
}
.pwa-btn-dismiss {
    flex: 1;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--secondary-text);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.pwa-btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.06);
}
.pwa-btn-got-it {
    flex: 1;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--accent), #d4005a);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
}
.pwa-btn-got-it:hover {
    box-shadow: 0 6px 20px -4px rgba(255, 0, 110, 0.4);
}

/* ── Close button (top right) ── */
.pwa-banner-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 8px;
    color: var(--secondary-text);
    cursor: pointer;
    transition: all 0.2s;
}
.pwa-banner-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-text);
}

/* ── Standalone mode — hide banner if already installed ── */
@media (display-mode: standalone) {
    .pwa-install-btn,
    .pwa-banner,
    .pwa-banner-backdrop {
        display: none !important;
    }
}
