/* JAPA EXPLOITS - PWA Styles */

/* PWA Install Prompt */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(239, 68, 68, 0.2);
  padding: 20px;
  max-width: 380px;
  z-index: 9999;
  animation: pwa-slide-up 0.4s ease-out;
  backdrop-filter: blur(20px);
}

@media (max-width: 480px) {
  .pwa-install-prompt {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

.pwa-install-prompt.pwa-fade-out {
  animation: pwa-fade-out 0.3s ease-out forwards;
}

@keyframes pwa-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pwa-fade-out {
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

.pwa-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pwa-prompt-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-close-btn:hover {
  color: #ef4444;
}

.pwa-prompt-content {
  margin: 16px 0;
  font-size: 14px;
  color: #d4d4d8;
  line-height: 1.6;
}

.pwa-prompt-content p {
  margin: 0 0 12px 0;
}

.pwa-prompt-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.pwa-prompt-content li {
  margin: 6px 0;
  color: #a1a1aa;
}

.pwa-prompt-content strong {
  color: #ef4444;
  font-weight: 600;
}

.pwa-prompt-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.pwa-prompt-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pwa-prompt-btn.pwa-primary {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.pwa-prompt-btn.pwa-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.pwa-prompt-btn.pwa-primary:active {
  transform: translateY(0);
}

.pwa-prompt-btn.pwa-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #d4d4d8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pwa-prompt-btn.pwa-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* PWA Toast Notifications */
.pwa-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  z-index: 10000;
  animation: pwa-toast-in 0.3s ease-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  max-width: 360px;
}

@media (max-width: 480px) {
  .pwa-toast {
    right: 10px;
    left: 10px;
    top: auto;
    bottom: 20px;
  }
}

.pwa-toast.pwa-fade-out {
  animation: pwa-toast-out 0.3s ease-out forwards;
}

@keyframes pwa-toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pwa-toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.pwa-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 14px;
}

.pwa-toast-success .pwa-toast-content {
  color: #10b981;
}

.pwa-toast-success .pwa-toast-content i {
  color: #10b981;
}

.pwa-toast-error .pwa-toast-content {
  color: #ef4444;
}

.pwa-toast-error .pwa-toast-content i {
  color: #ef4444;
}

.pwa-toast-warning .pwa-toast-content {
  color: #f59e0b;
}

.pwa-toast-warning .pwa-toast-content i {
  color: #f59e0b;
}

.pwa-toast-info .pwa-toast-content {
  color: #3b82f6;
}

.pwa-toast-info .pwa-toast-content i {
  color: #3b82f6;
}

/* PWA App Mode Styles */
.pwa-app-mode {
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-right: env(safe-area-inset-right);
  --safe-area-bottom: env(safe-area-inset-bottom);
  --safe-area-left: env(safe-area-inset-left);
}

.pwa-app-mode body {
  padding-top: var(--safe-area-top);
  padding-right: var(--safe-area-right);
  padding-bottom: var(--safe-area-bottom);
  padding-left: var(--safe-area-left);
}

/* Notch Support (iOS) */
@supports (padding: max(0px)) {
  .pwa-app-mode body {
    padding-top: max(var(--safe-area-top), 20px);
    padding-right: max(var(--safe-area-right), 20px);
    padding-bottom: max(var(--safe-area-bottom), 20px);
    padding-left: max(var(--safe-area-left), 20px);
  }
}

/* Responsivo para diferentes tamanhos */
@media (max-width: 768px) {
  .pwa-install-prompt {
    max-width: 320px;
  }

  .pwa-prompt-btn {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* Dark mode (já está por padrão, mas garantir) */
@media (prefers-color-scheme: dark) {
  .pwa-install-prompt {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  }

  .pwa-toast {
    background: #1a1a1a;
  }
}

/* Modo claro (se necessário) */
@media (prefers-color-scheme: light) {
  .pwa-install-prompt {
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
    border-color: rgba(239, 68, 68, 0.2);
  }

  .pwa-prompt-title {
    color: #000;
  }

  .pwa-close-btn {
    color: #666;
  }

  .pwa-close-btn:hover {
    color: #ef4444;
  }

  .pwa-prompt-content {
    color: #333;
  }

  .pwa-prompt-content li {
    color: #555;
  }

  .pwa-prompt-btn.pwa-secondary {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    border-color: rgba(0, 0, 0, 0.12);
  }

  .pwa-prompt-btn.pwa-secondary:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #000;
  }

  .pwa-toast {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
  }

  .pwa-toast-content {
    color: #333;
  }
}
