
/* Styles spécifiques PWA */

/* Splash Screen */
#splash-screen {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Animation du splash */
@media (prefers-reduced-motion: reduce) {
  #splash-screen .splash-logo,
  #splash-screen .splash-loader {
    animation: none;
  }
}

/* Bouton d'installation PWA */
.pwa-install-btn {
  animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Loader du splash screen avec K animé */
.loader {
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.loader::before {
  content: 'K';
  font-family: 'Kalam', cursive;
  font-size: 72px;
  font-weight: 700;
  color: #FFF;
  animation: kPulse 1.5s ease-in-out infinite;
  transform-origin: center;
  line-height: 1;
}

@keyframes kPulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.15);
    opacity: 0.8;
  }
}

/* Mode standalone (app installée) */
.pwa-standalone {
  /* Ajuster le padding pour compenser la barre de statut sur mobile */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.pwa-standalone #pagefull {
  /* Ajustements spécifiques quand l'app est installée */
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* Splash screen style pour iOS */
@media (display-mode: standalone) {
  body {
    background-color: #a064e0;
  }
  
  /* Masquer la barre d'adresse fantôme */
  body::before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background-color: #a064e0;
    z-index: 10002;
  }
}

/* Message offline */
.offline-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff9800;
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10001;
  display: none;
  font-size: 14px;
  font-weight: 500;
}

.offline-message.show {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Badge de mise à jour disponible */
.update-available {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #2196F3;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10001;
  cursor: pointer;
  transition: transform 0.2s;
}

.update-available:hover {
  transform: translateY(-2px);
}

.update-available i {
  margin-right: 8px;
}
