/**
 * Analytics Install Prompt Styles
 * 
 * Styles for PWA install prompts and iOS instructions.
 * Integrates with existing PWA install button.
 */

/* ============================================
   PWA Install Button (Android)
   ============================================ */

.pwa-install-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.pwa-install-button.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.pwa-install-button .install-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pwa-install-button .install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.pwa-install-button .install-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 15px rgba(102, 126, 234, 0.3);
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .pwa-install-button {
    bottom: 80px; /* Above mobile nav */
    right: 15px;
    left: 15px;
    right: auto;
  }

  .pwa-install-button .install-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 15px;
  }
}

/* ============================================
   iOS Install Instructions Modal
   ============================================ */

.ios-install-instructions {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

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

.ios-install-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

.ios-install-content h3 {
  margin: 0 0 15px 0;
  font-size: 24px;
  font-weight: 700;
  color: #2d3748;
  text-align: center;
}

.ios-install-content > p {
  text-align: center;
  color: #4a5568;
  font-size: 16px;
  margin-bottom: 25px;
  line-height: 1.6;
}

.ios-install-content .ios-icon {
  display: inline-block;
  font-size: 20px;
  margin: 0 5px;
  vertical-align: middle;
}

.ios-install-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  color: #a0aec0;
  cursor: pointer;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.ios-install-close:hover {
  background: #f7fafc;
  color: #2d3748;
}

.ios-steps {
  margin: 25px 0;
}

.ios-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 15px;
}

.ios-step:last-child {
  margin-bottom: 0;
}

.ios-step .step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.ios-step span:last-child {
  flex: 1;
  color: #4a5568;
  font-size: 15px;
  line-height: 1.5;
  padding-top: 6px;
}

.ios-install-dismiss {
  width: 100%;
  padding: 14px;
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.ios-install-dismiss:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

/* Mobile optimizations for iOS modal */
@media (max-width: 768px) {
  .ios-install-content {
    padding: 25px 20px;
    margin: 20px;
  }

  .ios-install-content h3 {
    font-size: 20px;
  }

  .ios-install-content > p {
    font-size: 15px;
  }

  .ios-step {
    margin-bottom: 18px;
  }

  .ios-step .step-number {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .ios-step span:last-child {
    font-size: 14px;
  }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .pwa-install-button,
  .ios-install-instructions,
  .ios-install-content {
    animation: none;
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .pwa-install-button .install-btn {
    border: 2px solid currentColor;
  }

  .ios-install-content {
    border: 2px solid #000;
  }
}
