/* ==========================================================================
   PWA Atalho Celular - Estilos
   Design moderno e responsivo para todos os dispositivos
   ========================================================================== */

/* Popup Principal */
.pwa-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
  z-index: 999999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px 20px 0 0;
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.pwa-popup[style*="flex"] {
  display: flex !important;
  transform: translateY(0);
}

/* Conteúdo do Popup */
.pwa-popup-content {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.4s ease-out;
}

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

/* Ícone do App */
.pwa-popup-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  padding: 4px;
}

.pwa-popup-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

/* Texto do Popup */
.pwa-popup-text {
  text-align: center;
}

.pwa-popup-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pwa-popup-description {
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.pwa-popup-description strong {
  font-weight: 600;
  color: #ffffff;
}

/* Instruções Manuais */
.pwa-manual-instructions {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pwa-manual-instructions h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.pwa-manual-instructions ol,
.pwa-manual-instructions ul {
  margin: 8px 0;
  padding-left: 24px;
}

.pwa-manual-instructions li {
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.95);
}

.pwa-manual-instructions strong {
  color: #ffffff;
  font-weight: 600;
}

.pwa-manual-instructions code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* Ações do Popup */
.pwa-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* Botões */
.pwa-btn {
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
  position: relative;
  overflow: hidden;
}

.pwa-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.pwa-btn:active::before {
  width: 300px;
  height: 300px;
}

/* Botão Primário */
.pwa-btn-primary {
  background: #ffffff;
  color: #667eea;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pwa-btn-primary:hover {
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

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

/* Botão Secundário */
.pwa-btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.pwa-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.pwa-btn-secondary:active {
  background: rgba(255, 255, 255, 0.05);
}

/* Ícone do Botão */
.pwa-btn-icon {
  font-size: 20px;
  line-height: 1;
}

/* Floating Action Button (FAB) */
.pwa-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999998;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: scale(0);
}

.pwa-fab[style*="block"] {
  opacity: 1;
  transform: scale(1);
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.pwa-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

.pwa-fab:active {
  transform: scale(0.95);
}

.pwa-fab svg {
  width: 24px;
  height: 24px;
}

/* Responsividade para tablets */
@media (min-width: 768px) {
  .pwa-popup {
    left: 50%;
    right: auto;
    transform: translate(-50%, 100%);
    max-width: 480px;
    border-radius: 20px;
    bottom: 20px;
  }
  
  .pwa-popup[style*="flex"] {
    transform: translate(-50%, 0);
  }
  
  .pwa-popup-content {
    padding: 28px 24px 24px;
  }
  
  .pwa-popup-actions {
    flex-direction: row;
  }
  
  .pwa-btn {
    flex: 1;
  }
}

/* Responsividade para desktops */
@media (min-width: 1024px) {
  .pwa-fab {
    width: 64px;
    height: 64px;
    bottom: 24px;
    right: 24px;
  }
  
  .pwa-fab svg {
    width: 28px;
    height: 28px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .pwa-manual-instructions {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
  }
}

/* Acessibilidade */
.pwa-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.pwa-fab:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.5);
  outline-offset: 4px;
}

/* Prevenção de seleção acidental */
.pwa-popup,
.pwa-fab {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Loading State */
.pwa-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.pwa-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Animação de saída */
.pwa-popup.hiding {
  animation: slideDown 0.3s ease-in forwards;
}

@keyframes slideDown {
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* Scroll suave para instruções longas */
.pwa-manual-instructions {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.pwa-manual-instructions::-webkit-scrollbar {
  width: 6px;
}

.pwa-manual-instructions::-webkit-scrollbar-track {
  background: transparent;
}

.pwa-manual-instructions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.pwa-manual-instructions::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
