/* =============================================
   Net-Teka RDC – PWA Styles
   Bannière d'installation, Toast, iOS prompt
   ============================================= */

/* ─── Bannière d'Installation ─── */
.pwa-install-banner {
    position: fixed;
    top: 10px;          /* Au dessus de la navbar */
    left: 0;
    right: 0;
    z-index: 1050;      /* Au dessus de la navbar sticky (1030) */
    padding: 0;
    transform: translateY(-150%);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.pwa-install-banner.show {
    transform: translateY(0);
    pointer-events: all;
}

.pwa-install-banner__inner {
    margin: 0.5rem 0.75rem 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(15, 15, 25, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 0 0 16px 16px;
    box-shadow:
        0 8px 32px rgba(124, 58, 237, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: pwa-glow 3s ease-in-out infinite alternate;
}

@keyframes pwa-glow {
    0% { box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }
    100% { box-shadow: 0 8px 40px rgba(124, 58, 237, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }
}

.pwa-install-banner__content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-install-banner__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(124, 58, 237, 0.3);
}

.pwa-install-banner__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-install-banner__text {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner__title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    margin: 0 0 0.2rem;
    line-height: 1.2;
}

.pwa-install-banner__desc {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    line-height: 1.3;
}

.pwa-install-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}

.pwa-install-btn:active {
    transform: scale(0.97);
}

.pwa-install-btn svg {
    width: 16px;
    height: 16px;
}

.pwa-dismiss-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pwa-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
}

/* ─── Toast de Mise à Jour ─── */
.pwa-update-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 10000;
    padding: 0.9rem 1.5rem;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.pwa-update-toast.show {
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.pwa-update-toast__text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 400;
}

.pwa-update-toast__text strong {
    color: #22c55e;
}

.pwa-update-btn {
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pwa-update-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.4);
}

/* ─── Instructions iOS ─── */
.pwa-ios-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.pwa-ios-prompt.show {
    transform: translateY(0);
    pointer-events: all;
}

.pwa-ios-prompt__inner {
    margin: 0.75rem;
    padding: 1.5rem;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
}

.pwa-ios-prompt__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pwa-ios-prompt__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.pwa-ios-prompt__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.pwa-ios-prompt__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-ios-prompt__title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.pwa-ios-prompt__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.pwa-ios-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.pwa-ios-step__num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-ios-step__icon {
    font-size: 1.5rem;
}

.pwa-ios-step__label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    max-width: 80px;
    line-height: 1.2;
}

.pwa-ios-arrow {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    margin-top: -1rem;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .pwa-install-banner {
        top: 10px;
    }

    .pwa-install-banner__inner {
        margin: 0;
        padding: 0.75rem 1rem;
        border-radius: 0;
    }

    .pwa-install-banner__content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pwa-install-banner__icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .pwa-install-banner__title {
        font-size: 0.85rem;
    }

    .pwa-install-banner__desc {
        font-size: 0.70rem;
    }

    .pwa-install-banner__actions {
        width: 100%;
        justify-content: stretch;
        margin-top: 0.25rem;
    }

    .pwa-install-btn,
    .pwa-dismiss-btn {
        flex: 1;
        justify-content: center;
    }

    .pwa-ios-prompt__steps {
        gap: 0.75rem;
    }
}

/* ─── Animation de la bannière installée ─── */
.pwa-install-banner.installed {
    animation: pwa-installed 0.6s ease forwards;
}

@keyframes pwa-installed {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(5px); opacity: 1; }
    100% { transform: translateY(-120%); opacity: 0; }
}

/* ─── Badge "Installable" sur le bouton ─── */
.pwa-install-btn::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pwa-pulse 2s ease-in-out infinite;
}

@keyframes pwa-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}
