/* ── PWA Install Banner ── */

.pwa-install-banner {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 420px;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: system-ui, -apple-system, sans-serif;
}

.pwa-install-banner.visible {
    bottom: 1.5rem;
}

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

.pwa-install-banner-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
}

.pwa-install-banner-icon img {
    width: 100%;
    height: 100%;
}

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

.pwa-install-banner-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.pwa-install-banner-desc {
    font-size: 0.8rem;
    color: #a0a0b0;
    line-height: 1.3;
}

.pwa-install-banner-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pwa-install-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

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

.pwa-install-btn-primary {
    background: #e94560;
    color: #fff;
}

.pwa-install-btn-primary:hover {
    background: #c73650;
}

.pwa-install-btn-dismiss {
    background: transparent;
    color: #a0a0b0;
    border: 1px solid #2a2a4a;
    flex: 0;
    white-space: nowrap;
}

.pwa-install-btn-dismiss:hover {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* iOS-specific instructions overlay */
.pwa-ios-instructions {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #0f3460;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #e0e0e0;
    line-height: 1.5;
}

.pwa-ios-instructions.visible {
    display: block;
}

.pwa-ios-instructions .step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.pwa-ios-instructions .step:last-child {
    margin-bottom: 0;
}

.pwa-ios-instructions .step-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e94560;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Turbo View Transitions ── */

/* Enable view transitions on Turbo navigations */
@view-transition {
    navigation: auto;
}

/* Forward navigation: slide vers la gauche (comme une appli mobile) */
::view-transition-old(root) {
    animation: slide-out-left 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

::view-transition-new(root) {
    animation: slide-in-right 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes slide-out-left {
    to {
        opacity: 0;
        transform: translateX(-60px);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
}

/* Back navigation: slide vers la droite */
html.back-transition ::view-transition-old(root) {
    animation: slide-out-right 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

html.back-transition ::view-transition-new(root) {
    animation: slide-in-left 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes slide-out-right {
    to {
        opacity: 0;
        transform: translateX(60px);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
}
