/* Styles pour les prompts PWA et notifications push */

/* Prompt d'installation PWA */
#pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 10000;
    max-width: 400px;
    width: calc(100% - 40px);
    background: linear-gradient(135deg, var(--marketify-primary, #667eea) 0%, var(--marketify-primary-light, #764ba2) 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#pwa-install-prompt.pwa-prompt-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#pwa-install-prompt.pwa-prompt-animate {
    animation: pwaBounce 0.6s ease-out;
}

@keyframes pwaBounce {
    0% {
        transform: translateX(-50%) translateY(0) scale(0.9);
    }
    50% {
        transform: translateX(-50%) translateY(-10px) scale(1.02);
    }
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.pwa-prompt-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-prompt-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.pwa-prompt-text {
    flex: 1;
}

.pwa-prompt-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.pwa-prompt-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.pwa-prompt-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.pwa-prompt-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pwa-prompt-btn-install {
    background: white;
    color: var(--marketify-primary, #667eea);
}

.pwa-prompt-btn-install:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-prompt-btn-install:active {
    transform: translateY(0);
}

.pwa-prompt-btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.pwa-prompt-btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pwa-prompt-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.pwa-prompt-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Notification de succès d'installation */
#pwa-install-success,
#pwa-notification-success {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 350px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#pwa-install-success.pwa-success-visible,
#pwa-notification-success.pwa-success-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.pwa-success-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.pwa-success-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Notification de mise à jour */
#pwa-update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 350px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#pwa-update-notification.pwa-update-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pwa-update-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.pwa-update-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-update-btn-reload {
    background: white;
    color: #f5576c;
}

.pwa-update-btn-reload:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.pwa-update-btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pwa-update-btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Instructions d'installation */
#pwa-install-instructions {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#pwa-install-instructions.pwa-instructions-visible {
    opacity: 1;
    visibility: visible;
}

.pwa-instructions-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#pwa-install-instructions.pwa-instructions-visible .pwa-instructions-content {
    transform: scale(1);
}

.pwa-instructions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pwa-instructions-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.pwa-instructions-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    transition: all 0.2s ease;
}

.pwa-instructions-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.pwa-instructions-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pwa-instruction-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pwa-instruction-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--marketify-primary, #667eea) 0%, var(--marketify-primary-light, #764ba2) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.pwa-instruction-text {
    flex: 1;
    color: #333;
    line-height: 1.6;
}

.pwa-instruction-text strong {
    color: var(--marketify-primary, #667eea);
}

/* Responsive */
@media (max-width: 768px) {
    #pwa-install-prompt {
        bottom: 90px; /* Au-dessus du menu bottom mobile (80px) + marge */
        max-width: calc(100% - 20px);
        padding: 16px;
        left: 50%;
        right: auto;
    }

    .pwa-prompt-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .pwa-prompt-title {
        font-size: 16px;
    }

    .pwa-prompt-description {
        font-size: 13px;
    }

    #pwa-install-success,
    #pwa-notification-success,
    #pwa-update-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .pwa-instructions-content {
        padding: 20px;
    }
}

/* Animation pour les icônes */
@keyframes pwaPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.pwa-prompt-icon {
    animation: pwaPulse 2s ease-in-out infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pwa-instructions-content {
        background: #1a1a1a;
        color: white;
    }

    .pwa-instructions-title {
        color: white;
    }

    .pwa-instruction-text {
        color: #e0e0e0;
    }

    .pwa-instructions-close {
        background: #333;
        color: #e0e0e0;
    }

    .pwa-instructions-close:hover {
        background: #444;
    }
}

