/* ============================================
   PWA INSTALLER STYLES
   Place this in /public/css/pwa-styles.css
   ============================================ */

/* ============ INSTALL BUTTON ============ */
.pwa-install-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  
  display: flex;
  align-items: center;
  gap: 8px;
  
  padding: 12px 20px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
}

.pwa-install-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.pwa-install-button svg {
  width: 20px;
  height: 20px;
}

/* ============ INSTALL BANNER ============ */
.pwa-install-banner {
  position: fixed;
  bottom: -200px;
  left: 0;
  right: 0;
  z-index: 9999;
  
  background: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-banner.visible {
  bottom: 0;
}

[data-theme="dark"] .pwa-install-banner {
  background: #1E293B;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

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

.pwa-banner-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
}

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

.pwa-banner-text strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 4px;
}

[data-theme="dark"] .pwa-banner-text strong {
  color: #F1F5F9;
}

.pwa-banner-text p {
  font-size: 14px;
  color: #64748B;
  margin: 0;
}

[data-theme="dark"] .pwa-banner-text p {
  color: #94A3B8;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-btn-install {
  padding: 10px 24px;
  background: #6366F1;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-btn-install:hover {
  background: #4F46E5;
  transform: translateY(-1px);
}

.pwa-btn-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: #64748B;
  cursor: pointer;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-btn-close:hover {
  color: #0F172A;
}

[data-theme="dark"] .pwa-btn-close:hover {
  color: #F1F5F9;
}

/* ============ iOS BANNER ============ */
.pwa-ios-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  
  background: #007AFF;
  color: white;
  padding: 16px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

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

.pwa-ios-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pwa-ios-text p {
  font-size: 13px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}

.pwa-ios-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pwa-ios-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============ MODAL ============ */
.pwa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  
  transition: all 0.3s ease;
  pointer-events: none;
}

.pwa-modal.visible {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  pointer-events: all;
}

.pwa-modal-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.pwa-modal.visible .pwa-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

[data-theme="dark"] .pwa-modal-content {
  background: #1E293B;
  color: #F1F5F9;
}

.pwa-modal-content h3 {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
}

[data-theme="dark"] .pwa-modal-content h3 {
  color: #F1F5F9;
}

.pwa-instructions {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 24px 0;
}

.pwa-instructions li {
  counter-increment: step;
  padding: 16px;
  background: #F8FAFC;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #334155;
}

[data-theme="dark"] .pwa-instructions li {
  background: #0F172A;
  color: #CBD5E1;
}

.pwa-instructions li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #6366F1;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.pwa-instructions li svg {
  width: 16px;
  height: 16px;
  color: #6366F1;
}

.pwa-modal-close {
  width: 100%;
  padding: 14px;
  background: #6366F1;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pwa-modal-close:hover {
  background: #4F46E5;
}

/* ============ UPDATE NOTIFICATION ============ */
.pwa-update-notification {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  
  background: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  
  transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-update-notification.visible {
  top: 20px;
}

[data-theme="dark"] .pwa-update-notification {
  background: #1E293B;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pwa-update-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pwa-update-content p {
  margin: 0;
  font-size: 14px;
  color: #0F172A;
}

[data-theme="dark"] .pwa-update-content p {
  color: #F1F5F9;
}

.pwa-update-btn {
  padding: 8px 16px;
  background: #10B981;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.pwa-update-btn:hover {
  background: #059669;
}

/* ============ TOAST ============ */
.pwa-toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  
  display: flex;
  align-items: center;
  gap: 12px;
  
  background: #10B981;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  font-weight: 500;
  
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-toast.visible {
  bottom: 20px;
}

.pwa-toast svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 768px) {
  .pwa-install-button {
    top: auto;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .pwa-install-button span {
    display: none;
  }
  
  .pwa-banner-content {
    flex-wrap: wrap;
  }
  
  .pwa-banner-icon {
    width: 48px;
    height: 48px;
  }
  
  .pwa-banner-text strong {
    font-size: 15px;
  }
  
  .pwa-banner-text p {
    font-size: 13px;
  }
  
  .pwa-banner-actions {
    width: 100%;
    margin-top: 12px;
  }
  
  .pwa-btn-install {
    flex: 1;
  }
  
  .pwa-modal-content {
    padding: 24px;
  }
  
  .pwa-modal-content h3 {
    font-size: 18px;
  }
  
  .pwa-instructions li {
    font-size: 13px;
    padding: 12px;
  }
}

/* ============ STANDALONE MODE STYLES ============ */
@media (display-mode: standalone) {
  /* Hide elements that don't make sense in standalone mode */
  .pwa-install-button,
  .pwa-install-banner,
  .pwa-ios-banner {
    display: none !important;
  }
  
  /* Add safe area padding for notched devices */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}