/*
 * Fichier : assets/css/pwa-install.css
 * Intervention : Ajustement de la position du bouton PWA pour les mobiles.
*/

#phcla-pwa-install-container {
    position: fixed;
    /* Position de base pour le desktop */
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: bottom 300ms ease-out; /* Ajout d'une transition pour un effet plus doux */
}

.phcla-pwa-btn {
    background-color: var(--phcla-primary, #2ecc71);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.phcla-pwa-btn:hover {
    background-color: var(--phcla-primary-dark, #27ae60);
    transform: translateY(-2px);
}

.phcla-pwa-btn svg {
    fill: white;
}

/* [INTERVENTION CHIRURGICALE]
 * Media Query pour les écrans mobiles (largeur max de 767px).
 * C'est ici que nous corrigeons la position du bouton.
*/
@media (max-width: 767px) {
    #phcla-pwa-install-container {
        /* La barre de navigation du bas a une hauteur de 64px + padding.
           Nous positionnons le bouton d'installation 16px au-dessus de cette barre.
           La variable 'env(safe-area-inset-bottom)' gère les "notches" sur les iPhones. */
        bottom: calc(64px + 16px + env(safe-area-inset-bottom));
    }
}


/* --- Le reste du fichier reste inchangé --- */

.phcla-pwa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: none; /* [Correction] S'assurer que la modale est cachée par défaut */
    align-items: center;
    justify-content: center;
}

.phcla-pwa-modal.active { /* [Nouveau] Classe pour afficher la modale */
    display: flex;
}


.phcla-pwa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.phcla-pwa-modal-content {
    position: relative;
    background-color: var(--phcla-bg-card, #fff);
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    z-index: 9999;
    color: var(--phcla-text); /* Ajout pour le mode sombre */
}

.phcla-pwa-modal-content h3 {
    margin-top: 0;
}

.phcla-pwa-modal-content ol {
    padding-left: 20px;
}

.phcla-pwa-modal-content li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.phcla-pwa-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--phcla-text-secondary, #666);
}

.phcla-pwa-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f1c40f;
    color: #1d2327;
    padding: 12px 20px;
    display: none; /* [Correction] Cacher par défaut */
    align-items: center;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: phclaSlideDown 300ms ease-out;
}

@keyframes phclaSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.phcla-pwa-offline-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.phcla-pwa-offline-text {
    font-weight: 600;
}

.phcla-pwa-offline-subtext {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-left: auto;
}

.phcla-btn--disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed !important;
    pointer-events: none; 
}