/* PWA Styles pour Facturo */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-top: 1px solid #4f7bff;
    box-shadow: 0 -4px 20px rgba(79, 123, 255, 0.2);
    z-index: 1050;
    padding: 15px 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.pwa-install-banner .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pwa-install-banner .btn-primary {
    background: linear-gradient(135deg, #4f7bff 0%, #6c5ce7 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(79, 123, 255, 0.3);
}

.pwa-install-banner .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 123, 255, 0.4);
}

.pwa-install-banner .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Ajuster le padding du body quand le banner est visible */
body.pwa-banner-visible {
    padding-bottom: 80px;
}

/* Styles pour l'état installé */
.pwa-installed-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(79, 123, 255, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: fadeInRight 0.5s ease-out;
}

/* Contrôles de fenêtre PWA pour desktop */
@media (display-mode: standalone) {
    body {
        padding-top: 0;
        /* Masquer les éléments de gestion des mots de passe */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    .pwa-install-banner {
        display: none !important;
    }
    
    /* Masquer les éléments d'extension et de gestion des mots de passe */
    input[type="password"] {
        -webkit-text-security: disc;
        -moz-text-security: disc;
        text-security: disc;
    }
    
    /* Désactiver les suggestions de mots de passe */
    input[type="password"]::-webkit-credentials-auto-fill-button {
        display: none !important;
    }
    
    input[type="password"]::-webkit-strong-password-auto-fill-button {
        display: none !important;
    }
    
    /* Masquer les icônes d'extension */
    .extension-icons,
    .password-manager-icons,
    .browser-controls {
        display: none !important;
    }
}

/* Styles spécifiques pour la fenêtre PWA desktop */
@media (display-mode: standalone) and (min-width: 768px) {
    /* Interface plus propre pour desktop */
    body {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }
    
    /* Masquer les éléments de navigateur */
    ::-webkit-scrollbar {
        width: 8px;
    }
    
    ::-webkit-scrollbar-track {
        background: #1a1a1a;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #4f7bff;
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #6c5ce7;
    }
    
    /* Interface native pour les formulaires */
    .form-control {
        border-radius: 8px;
        border: 1px solid #333;
        background: #2d2d2d;
        color: white;
    }
    
    .form-control:focus {
        border-color: #4f7bff;
        box-shadow: 0 0 0 0.2rem rgba(79, 123, 255, 0.25);
    }
}

@keyframes fadeInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pwa-install-banner {
        padding: 12px 0;
    }
    
    .pwa-install-banner .col-md-8,
    .pwa-install-banner .col-md-4 {
        text-align: center;
    }
    
    .pwa-install-banner .col-md-4 {
        margin-top: 10px;
    }
    
    .pwa-install-banner h6 {
        font-size: 14px;
    }
    
    .pwa-install-banner p {
        font-size: 12px;
    }
}

/* Styles pour les notifications PWA */
.pwa-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(79, 123, 255, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1060;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Styles pour le mode standalone */
@media (display-mode: standalone) {
    body {
        padding-top: 0;
    }
    
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    .pwa-install-banner {
        display: none !important;
    }
}
