/* PWA Installation Dialog Styles */
.pwa-install-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-install-dialog.pwa-dialog-show {
  opacity: 1;
  visibility: visible;
}

.pwa-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.pwa-dialog-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.pwa-dialog-show .pwa-dialog-content {
  transform: translateY(0);
}

.pwa-dialog-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.pwa-app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

.pwa-app-icon svg {
  width: 100%;
  height: 100%;
}

.pwa-app-info h3 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.pwa-app-info p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.pwa-close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.pwa-close-btn:hover {
  background: #e5e7eb;
}

.pwa-dialog-body {
  margin-bottom: 24px;
}

.pwa-dialog-body p {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #374151;
  line-height: 1.5;
}

.pwa-benefits {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.pwa-benefit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  color: #475569;
}

.pwa-benefit-icon {
  font-size: 16px;
}

.pwa-safari-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  color: #475569;
}

.pwa-step-number {
  width: 24px;
  height: 24px;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.pwa-share-icon,
.pwa-home-icon {
  font-size: 16px;
  margin-left: 4px;
}

.pwa-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
}

.pwa-btn-primary {
  background: #3b82f6;
  color: white;
}

.pwa-btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.pwa-btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
}

.pwa-btn-secondary:hover {
  background: #e5e7eb;
}

/* Адаптивность для планшетов */
@media (min-width: 768px) {
  .pwa-dialog-content {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    max-height: 600px;
  }
  
  .pwa-dialog-show .pwa-dialog-content {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Скрытие диалога на десктопе */
@media (min-width: 1024px) {
  .pwa-install-dialog {
    display: none;
  }
}

/* Update Availability Banner (стиль личного кабинета) */
.pwa-update-banner {
  position: fixed;
  bottom: 24px;
  background: #111827; /* тёмный фон как в шапке ЛК */
  color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 16px;
  z-index: 9999;
  animation: pwa-update-slide-in 240ms ease-out;
}

/* Мобильная версия - по центру, кнопки под текстом */
@media (max-width: 767px) {
  .pwa-update-banner {
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    width: calc(100% - 32px);
  }
  
  .pwa-update-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .pwa-update-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .pwa-update-actions .pwa-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
  }
  
  @keyframes pwa-update-slide-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  
  @keyframes pwa-update-slide-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(8px); }
  }
}

/* Десктопная версия - правый нижний угол, кнопки под текстом */
@media (min-width: 768px) {
  .pwa-update-banner {
    right: 24px;
    max-width: 420px;
    width: auto;
    min-width: 320px;
  }
  
  .pwa-update-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .pwa-update-actions {
    display: flex;
    gap: 8px;
  }
  
  .pwa-update-actions .pwa-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
  }
  
  @keyframes pwa-update-slide-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
  }
  
  @keyframes pwa-update-slide-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(8px); }
  }
}

.pwa-update-hide {
  animation: pwa-update-slide-out 200ms ease-in forwards;
}

.pwa-update-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-update-text strong {
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
}

.pwa-update-text span {
  font-size: 12px;
  color: #d1d5db; /* серая подпись */
}
