/**
 * Styles PWA — bannière d'installation, mise à jour, mode standalone
 */

.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0e3d78;
  color: #fff;
  padding: 14px 18px;
  box-shadow: 0 -4px 20px rgba(14, 61, 120, 0.25);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

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

.pwa-install-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-install-icon {
  flex-shrink: 0;
  display: flex;
  color: #fff;
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

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

.pwa-install-banner .btn-install {
  background: #fff;
  color: #1454a3;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-install-banner .btn-install:hover {
  background: #eef4fb;
}

.pwa-install-banner .btn-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.pwa-install-banner .btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
  .pwa-install-content {
    flex-wrap: wrap;
    gap: 10px;
  }

  .pwa-install-text {
    flex: 1 1 calc(100% - 50px);
  }

  .pwa-install-banner .btn-install {
    flex: 1;
  }

  .pwa-install-banner .btn-close {
    margin-left: auto;
  }
}

.pwa-update-notification {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #fff;
  border: 1px solid #d6e2f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(14, 61, 120, 0.15);
  padding: 14px 16px;
  z-index: 10000;
  max-width: 380px;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s ease-in-out;
}

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

.pwa-update-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pwa-update-content span {
  flex: 1 1 100%;
  font-size: 14px;
  font-weight: 500;
  color: #1a2b3c;
}

.pwa-update-notification .btn-update {
  background: #1454a3;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-update-notification .btn-later {
  background: transparent;
  border: 1px solid #c5d4e6;
  color: #4a5d73;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  .pwa-update-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .pwa-update-notification .btn-update,
  .pwa-update-notification .btn-later {
    flex: 1;
  }
}

.pwa-success-message {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #0d7a4f;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 14px 16px;
  z-index: 10000;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s ease-in-out;
}

.pwa-success-message.show {
  transform: translateX(0);
}

.pwa-success-content span {
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .pwa-success-message {
    top: 10px;
    right: 10px;
    left: 10px;
  }
}

@media all and (display-mode: standalone) {
  .pwa-install-banner {
    display: none !important;
  }

  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
