/* PWA Install Notification - Mobile Only, Top Sliding Banner */

.pwa-install-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998; /* Below cookie banner (2147483647) but above other content */
  background: white;
  backdrop-filter: blur(10px);
  color: #2e7d32;
  padding: 0.875rem 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-bottom: 3px solid #2e7d32;
  /* Hidden by default - shown via JavaScript */
  display: none;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visible state - triggered by JavaScript */
.pwa-install-notification.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Hide on desktop - mobile only */
/* Use hover capability as proxy for desktop vs mobile */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  .pwa-install-notification {
    display: none !important;
  }
}

/* Also hide on very large screens regardless of touch capability */
@media (min-width: 1280px) {
  .pwa-install-notification {
    display: none !important;
  }
}

.pwa-install-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.pwa-install-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-install-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #c41e3a;
  margin-bottom: 0.125rem;
  line-height: 1.3;
}

.pwa-install-description {
  font-size: 0.8rem;
  line-height: 1.3;
  margin: 0;
  color: #2e7d32;
}

.pwa-install-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.pwa-install-actions .btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.875rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pwa-btn-install {
  background: white;
  color: #2e7d32;
  border: 2px solid #2e7d32 !important;
}

.pwa-btn-install:hover {
  background: #2e7d32;
  color: white;
  border-color: #2e7d32;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.pwa-btn-dismiss {
  background: transparent;
  color: #2e7d32;
  border-color: #2e7d32;
  padding: 0.4rem 0.625rem;
}

.pwa-btn-dismiss:hover {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
  border-color: #2e7d32;
  transform: translateY(-2px);
}

.pwa-btn-dismiss i {
  font-size: 0.875rem;
}

/* Mobile Responsive - Optimize for limited screen space */
@media (max-width: 768px) {
  .pwa-install-notification {
    padding: 0.75rem 0.875rem;
  }
  
  .pwa-install-content {
    gap: 0.75rem;
  }
  
  .pwa-install-icon {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .pwa-install-title {
    font-size: 0.875rem;
  }
  
  .pwa-install-description {
    font-size: 0.75rem;
  }
  
  .pwa-install-actions .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Small mobile devices - Stack layout for very limited space */
@media (max-width: 480px) {
  .pwa-install-notification {
    padding: 0.625rem 0.75rem;
  }
  
  .pwa-install-content {
    gap: 0.625rem;
  }
  
  .pwa-install-icon {
    width: 2rem;
    height: 2rem;
  }
  
  .pwa-install-title {
    font-size: 0.8125rem;
  }
  
  .pwa-install-description {
    font-size: 0.7rem;
    line-height: 1.2;
  }
  
  .pwa-install-actions {
    gap: 0.375rem;
  }
  
  .pwa-install-actions .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.625rem;
  }
  
  .pwa-btn-dismiss {
    padding: 0.35rem 0.5rem;
  }
}

/* Extra small devices - Minimal padding */
@media (max-width: 360px) {
  .pwa-install-notification {
    padding: 0.5rem 0.625rem;
  }
  
  .pwa-install-content {
    gap: 0.5rem;
  }
  
  .pwa-install-icon {
    width: 1.875rem;
    height: 1.875rem;
  }
  
  .pwa-install-title {
    font-size: 0.75rem;
  }
  
  .pwa-install-description {
    font-size: 0.65rem;
  }
}

/* Animation for hiding */
.pwa-install-notification.hiding {
  animation: slideUpToTop 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUpToTop {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

/* Accessibility improvements */
.pwa-install-notification:focus-within {
  outline: 2px solid #ffd700;
  outline-offset: -2px;
}

.pwa-install-actions .btn:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

/* Ensure notification doesn't interfere with page content */
body.pwa-notification-visible {
  padding-top: 0;
}

/* Print styles - hide PWA notification when printing */
@media print {
  .pwa-install-notification {
    display: none !important;
  }
}

/* Coordinate with cookie banner - ensure proper stacking */
.cookie-consent-banner.visible ~ .pwa-install-notification {
  /* Cookie banner has higher z-index, so PWA notification appears below it */
  top: 0;
}

/* When both are visible, add slight spacing consideration */
body.cookie-banner-visible.pwa-notification-visible {
  /* Both notifications visible - they stack naturally due to z-index */
}