/**
 * Styles pour la PWA (Progressive Web App)
 * Version 1.0
 */

/* Bouton d'installation */
.pwa-install-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  padding: 10px 15px;
  background-color: #7367f0;
  color: white;
  border: none;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s ease;
  display: none; /* Caché par défaut */
}

.pwa-install-button:hover {
  background-color: #5e50ee;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.pwa-install-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Informations d'installation */
#install-info {
  position: fixed;
  bottom: 80px;
  right: 20px;
  padding: 15px;
  background-color: white;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 5px;
  max-width: 300px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

/* Styles pour les appareils mobiles */
@media (max-width: 768px) {
  .pwa-install-button {
    bottom: 15px;
    right: 15px;
    padding: 8px 12px;
    font-size: 13px;
  }
  
  #install-info {
    bottom: 70px;
    right: 15px;
    padding: 12px;
    max-width: 250px;
  }
}

/* Styles pour le mode standalone (PWA installée) */
@media (display-mode: standalone) {
  /* Masquer les éléments qui ne sont pas nécessaires en mode app */
  .hide-in-pwa {
    display: none !important;
  }
  
  /* Ajuster le padding pour compenser l'absence de barre d'adresse */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Notification hors ligne */
.offline-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #ff9800;
  color: white;
  text-align: center;
  padding: 10px;
  z-index: 10000;
  font-weight: bold;
  display: none;
}

/* Animation de chargement pour les actions en attente de synchronisation */
.sync-pending {
  position: relative;
}

.sync-pending::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ff9800;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.8;
  }
}

/* Styles pour la page hors ligne */
.offline-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 20px;
  background-color: #f8f8f8;
}

.offline-container {
  max-width: 500px;
  padding: 30px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.offline-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  color: #7367f0;
}

.offline-title {
  color: #7367f0;
  margin-bottom: 15px;
}

.offline-message {
  margin-bottom: 20px;
  line-height: 1.6;
}

.offline-button {
  display: inline-block;
  background-color: #7367f0;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
}

.offline-button:hover {
  background-color: #5e50ee;
}

/* Support du mode sombre */
@media (prefers-color-scheme: dark) {
  .pwa-install-button {
    background-color: #7367f0;
    color: white;
  }
} 