/**
 * Styles PWA pour RDP
 * Rassemblement pour la Démocratie et le Progrès
 */

/* Bannière d'installation PWA */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.pwa-install-banner .pwa-icon {
    width: 48px;
    height: 48px;
    background: #fbbf24;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-install-banner .pwa-icon span {
    font-size: 24px;
    font-weight: bold;
    color: #1e40af;
}

.pwa-install-banner .pwa-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.pwa-install-banner .pwa-text p {
    font-size: 13px;
    margin: 0;
    opacity: 0.9;
}

.pwa-install-banner .pwa-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pwa-install-banner .btn-install {
    background: #fbbf24;
    color: #1e40af;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-banner .btn-install:hover {
    background: #f59e0b;
    transform: scale(1.02);
}

.pwa-install-banner .btn-close {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-banner .btn-close:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* Indicateur de mise à jour disponible */
.pwa-update-banner {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #fbbf24;
    z-index: 9998;
    max-width: 320px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-update-banner.show {
    transform: translateX(0);
}

.pwa-update-banner h4 {
    color: #1e40af;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.pwa-update-banner p {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 12px 0;
}

.pwa-update-banner .btn-update {
    background: #1e40af;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-update-banner .btn-update:hover {
    background: #1e3a8a;
}

/* Indicateur hors ligne */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc2626;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

.offline-indicator.online {
    background: #16a34a;
}

/* Animation de chargement pour PWA */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e40af 0%, #fbbf24 50%, #1e40af 100%);
    background-size: 200% 100%;
    animation: pwa-loading 1.5s infinite linear;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-loading.active {
    opacity: 1;
}

@keyframes pwa-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Style pour standalone mode */
@media (display-mode: standalone) {
    body {
        /* Ajustements pour l'app installée */
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Cacher certains éléments en mode app */
    .hide-in-app {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .pwa-install-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .pwa-install-banner .pwa-content {
        flex-direction: column;
    }
    
    .pwa-install-banner .pwa-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .pwa-install-banner .btn-install,
    .pwa-install-banner .btn-close {
        width: 100%;
    }
    
    .pwa-update-banner {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Toast notifications */
.pwa-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9997;
    opacity: 0;
    transition: all 0.3s ease;
}

.pwa-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-toast.success {
    background: #16a34a;
}

.pwa-toast.error {
    background: #dc2626;
}

