/* PWA Auto Install - Mobile First Responsive */
.pwa-install-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: pwaFadeIn 0.3s ease-out;
  padding: 15px;
  box-sizing: border-box;
}

.pwa-install-modal {
  background: white;
  padding: 25px 20px;
  border-radius: 16px;
  max-width: 95%;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: pwaSlideIn 0.4s ease-out;
  border: 2px solid #007646;
  position: relative;
}

/* Header */
.pwa-modal-header {
  margin-bottom: 20px;
  padding: 0 10px;
}

.pwa-modal-header h2 {
  color: #007646;
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.3;
}

.pwa-modal-header p {
  color: #666;
  font-size: 14px;
  margin: 0;
  line-height: 1.4;
}

/* Steps */
.pwa-instruction-steps {
  text-align: left;
  margin: 20px 0;
  padding: 20px 15px;
  background: linear-gradient(135deg, #f8fff8 0%, #f0f8f0 100%);
  border-radius: 12px;
  border-left: 4px solid #48a74a;
}

.pwa-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 118, 70, 0.1);
}

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

.pwa-step-number {
  background: #007646;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}

.pwa-step-content {
  flex: 1;
}

.pwa-step-content p {
  margin: 0;
  color: #333;
  line-height: 1.4;
  font-size: 14px;
}

.pwa-step-content strong {
  color: #007646;
  font-weight: 600;
}

/* Buttons */
.pwa-modal-footer {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-install-button {
  background: linear-gradient(135deg, #E75810, #ff7b3a);
  color: white;
  padding: 14px 25px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(231, 88, 16, 0.3);
  transition: all 0.3s ease;
  width: 100%;
}

.pwa-install-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 88, 16, 0.4);
}

.pwa-close-button {
  background: transparent;
  color: #666;
  padding: 10px 20px;
  border: 2px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
  font-size: 14px;
}

.pwa-close-button:hover {
  border-color: #E75810;
  color: #E75810;
}

/* Benefits */
.pwa-benefits {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #f8f8ff 0%, #f0f0ff 100%);
  border-radius: 12px;
  border-left: 3px solid #48a74a;
}

.pwa-benefits h4 {
  color: #007646;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.pwa-benefits ul {
  text-align: left;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pwa-benefits li {
  padding: 6px 0;
  color: #333;
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.4;
}

.pwa-benefits li:before {
  content: "✓";
  color: #48a74a;
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 6px;
}

/* Loading */
.pwa-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007646;
  border-radius: 50%;
  animation: pwaSpin 1s linear infinite;
  margin: 15px auto;
}

/* Success */
.pwa-success-message {
  background: linear-gradient(135deg, #48a74a, #5cb85c);
  color: white;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  margin: 15px 0;
  animation: pwaBounceIn 0.5s ease;
  font-size: 14px;
  font-weight: 500;
}

/* Animations */
@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pwaSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

/* Mobile Landscape */
@media (max-width: 767px) and (orientation: landscape) {
  .pwa-install-modal {
    max-height: 80vh;
    padding: 20px 15px;
  }
  
  .pwa-step {
    padding: 8px;
    margin-bottom: 10px;
  }
  
  .pwa-step-number {
    width: 22px;
    height: 22px;
    font-size: 12px;
    margin-right: 8px;
  }
  
  .pwa-step-content p {
    font-size: 12px;
  }
}

/* Tablets and larger phones */
@media (min-width: 768px) {
  .pwa-install-modal {
    padding: 30px;
    max-width: 500px;
  }
  
  .pwa-modal-header h2 {
    font-size: 28px;
  }
  
  .pwa-step-content p {
    font-size: 15px;
  }
  
  .pwa-modal-footer {
    flex-direction: row;
  }
  
  .pwa-install-button,
  .pwa-close-button {
    width: auto;
    flex: 1;
  }
}

/* Very small devices */
@media (max-width: 320px) {
  .pwa-install-modal {
    padding: 15px;
    border-radius: 12px;
  }
  
  .pwa-modal-header h2 {
    font-size: 20px;
  }
  
  .pwa-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .pwa-step-number {
    margin-right: 0;
    margin-bottom: 8px;
  }
}

/* Prevent body scroll when modal is open */
body.pwa-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
  .pwa-install-button,
  .pwa-close-button {
    min-height: 44px; /* Minimum touch target size */
  }
  
  .pwa-step {
    padding: 15px;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  .pwa-install-modal {
    border: 3px solid #000;
  }
  
  .pwa-step {
    border: 2px solid #000;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pwa-install-modal,
  .pwa-success-message {
    animation: none;
  }
  
  .pwa-loading-spinner {
    animation-duration: 2s;
  }
}
