/* PWA Specific Styles */

/* Install prompt styles */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #dc3545, #ff5722);
  color: white;
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1060;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.pwa-install-banner.show {
  transform: translateY(0);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.pwa-install-text {
  flex: 1;
  margin-right: 1rem;
}

.pwa-install-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.pwa-install-description {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

.pwa-install-actions {
  display: flex;
  gap: 0.5rem;
}

.pwa-install-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pwa-install-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-1px);
}

.pwa-dismiss-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.pwa-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Standalone mode adjustments */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .navbar {
    padding-top: calc(0.5rem + env(safe-area-inset-top));
  }
  
  /* Hide install button when in standalone mode */
  #pwa-install-btn {
    display: none !important;
  }
}

/* iOS Safari specific adjustments */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    .navbar {
      padding-top: calc(0.5rem + 44px); /* Status bar height */
    }
  }
}

/* Update notification styles */
.pwa-update-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 1070;
  max-width: 350px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.pwa-update-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.pwa-update-message {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.pwa-update-actions {
  display: flex;
  gap: 0.5rem;
}

.pwa-update-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.pwa-update-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* Offline indicator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffc107;
  color: #212529;
  text-align: center;
  padding: 0.5rem;
  z-index: 1080;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline-indicator.show {
  transform: translateY(0);
}

/* Loading states for offline content */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* PWA specific card enhancements */
.pwa-card {
  position: relative;
  overflow: hidden;
}

.pwa-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.pwa-card:hover::before {
  left: 100%;
}

/* Responsive PWA adjustments */
@media (max-width: 768px) {
  .pwa-install-content {
    flex-direction: column;
    text-align: center;
  }
  
  .pwa-install-text {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .pwa-install-actions {
    justify-content: center;
  }
  
  .pwa-update-notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Dark mode PWA adjustments */
@media (prefers-color-scheme: dark) {
  .loading-skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .pwa-install-banner {
    background: #000;
    border-top: 2px solid #fff;
  }
  
  .pwa-install-btn,
  .pwa-dismiss-btn {
    border-width: 2px;
  }
}