/* PWA Styles - Estilos para Progressive Web App */

/* Botão de instalação */
.install-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  z-index: 1000;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.install-btn:active {
  transform: translateY(0);
}

/* Status de rede */
.network-status {
  position: fixed;
  top: 20px;
  right: 20px;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 1002;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.network-status.online {
  background: #28a745;
}

.network-status.offline {
  background: #dc3545;
}

/* Notificação de atualização */
.update-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInDown 0.5s ease;
}

.update-notification button {
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.update-notification .btn-update {
  background: white;
  color: #28a745;
  border: none;
}

.update-notification .btn-update:hover {
  background: #f8f9fa;
}

.update-notification .btn-dismiss {
  background: transparent;
  color: white;
  border: 1px solid white;
}

.update-notification .btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Notificações gerais */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  z-index: 1003;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideInDown 0.5s ease;
  max-width: 400px;
  text-align: center;
}

.notification.success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.notification.warning {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #000;
}

.notification.info {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

/* Animações */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para modo PWA */
.pwa-mode {
  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);
}

.pwa-mode .install-btn {
  display: none !important;
}

/* Indicador de loading offline */
.offline-indicator {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 999;
  backdrop-filter: blur(5px);
}

/* Splash screen personalizada */
.pwa-splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: white;
}

.pwa-splash img {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.pwa-splash .loading-text {
  font-size: 16px;
  opacity: 0.8;
}

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

/* Responsividade */
@media (max-width: 768px) {
  .install-btn {
    bottom: 15px;
    right: 15px;
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .update-notification,
  .notification {
    left: 15px;
    right: 15px;
    transform: none;
    max-width: none;
  }
  
  .network-status {
    top: 15px;
    right: 15px;
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .update-notification .btn-update {
    background: #f8f9fa;
    color: #28a745;
  }
  
  .notification.warning {
    color: #000;
  }
}

/* Suporte para dispositivos com notch */
@supports (padding: max(0px)) {
  .pwa-mode {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}
