/**
 * PWA Styles - Botón de instalación y modal
 */

/* ===================================
   BOTÓN FIJO DE INSTALACIÓN
   =================================== */

.pwa-install-fixed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pwa-install-fixed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.pwa-install-fixed i {
    font-size: 18px;
}

.pwa-install-fixed.hidden {
    display: none;
}

/* Botón flotante (versión alternativa para dashboard) */
.pwa-install-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #30d2ff 0%, #3a47d5 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(48, 210, 255, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pwa-install-btn.show {
  transform: translateY(0);
  opacity: 1;
}

.pwa-install-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(48, 210, 255, 0.6);
}

.pwa-install-btn:active {
  transform: translateY(-1px) scale(1.02);
}

/* Contenido del botón */
.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon {
  font-size: 24px;
  animation: pulse 2s infinite;
}

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

.pwa-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.pwa-text strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  display: block;
}

.pwa-text small {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 2px;
  display: block;
}

/* Botón de cerrar */
.pwa-install-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f56565;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  padding: 0;
}

.pwa-install-close:hover {
  background: #e53e3e;
  transform: rotate(90deg);
}

/* ===================================
   MODAL DE INSTRUCCIONES iOS
   =================================== */

.pwa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pwa-modal.show {
  opacity: 1;
}

.pwa-modal-content {
  background: white;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pwa-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #f7fafc;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #4a5568;
  transition: all 0.2s ease;
  z-index: 1;
}

.pwa-modal-close:hover {
  background: #e2e8f0;
  transform: rotate(90deg);
}

.pwa-modal-header {
  text-align: center;
  padding: 40px 30px 20px;
  border-bottom: 2px solid #f7fafc;
}

.pwa-modal-header h3 {
  margin: 15px 0 0 0;
  font-size: 24px;
  font-weight: 700;
  color: #2d3748;
}

.pwa-modal-body {
  padding: 30px;
}

.pwa-modal-body > p {
  color: #4a5568;
  margin-bottom: 20px;
  font-size: 15px;
}

.install-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.install-steps li {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  align-items: flex-start;
}

.step-icon {
  background: linear-gradient(135deg, #30d2ff 0%, #3a47d5 100%);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.step-text {
  flex: 1;
  color: #4a5568;
  line-height: 1.6;
  padding-top: 8px;
}

.step-text strong {
  color: #2d3748;
  font-weight: 600;
}

.install-hint {
  background: #f0f9ff;
  border-left: 4px solid #3b82f6;
  padding: 15px;
  border-radius: 8px;
  margin-top: 25px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: #1e40af;
}

.install-hint i {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.pwa-modal-footer {
  padding: 20px 30px 30px;
  text-align: center;
}

.btn-understand {
  background: linear-gradient(135deg, #30d2ff 0%, #3a47d5 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-understand:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(48, 210, 255, 0.4);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 576px) {
  .pwa-install-btn {
    bottom: 15px;
    right: 15px;
    padding: 10px 16px;
  }
  
  .pwa-icon {
    font-size: 20px;
  }
  
  .pwa-text strong {
    font-size: 13px;
  }
  
  .pwa-text small {
    font-size: 10px;
  }
  
  .pwa-modal-content {
    margin: 10px;
  }
  
  .pwa-modal-header {
    padding: 30px 20px 15px;
  }
  
  .pwa-modal-header h3 {
    font-size: 20px;
  }
  
  .pwa-modal-body {
    padding: 20px;
  }
  
  .install-steps li {
    gap: 12px;
    margin-bottom: 20px;
  }
  
  .step-icon {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .step-text {
    font-size: 14px;
  }
}

/* ===================================
   ANIMACIONES ADICIONALES
   =================================== */

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.pwa-install-btn.show {
  animation: bounce 1s ease 0.5s;
}