/* PWA Installation Popup Styles */

/* Popup Container */
.pwa-install-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.pwa-install-popup.show {
  opacity: 1;
}

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

/* Popup Container */
.pwa-popup-container {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

/* Compact Popup Container */
.pwa-popup-container.compact {
  max-width: 380px;
  width: 92%;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

/* In-App Browser Block Popup */
.pwa-inapp-block-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pwa-inapp-block-popup.show {
  opacity: 1;
}

/* Blocking Overlay (Cannot Click) */
.pwa-popup-overlay-blocking {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  cursor: not-allowed;
}

/* Blocking Container */
.pwa-popup-container.blocking {
  position: relative;
  z-index: 10000;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

/* Warning Message */
.pwa-popup-warning {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  text-align: center;
}

.warning-text {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  line-height: 1.4;
}

/* Instructions */
.pwa-popup-instructions {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  text-align: left;
}

.instruction-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}

.instruction-list {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: #374151;
  line-height: 1.6;
}

.instruction-list li {
  margin: 4px 0;
}

/* Link Box */
.pwa-popup-link-box {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.pwa-link-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  color: #374151;
  background: #f9fafb;
  font-family: monospace;
  word-break: break-all;
}

.pwa-link-input:focus {
  outline: none;
  border-color: #4f46e5;
  background: white;
}

.pwa-btn-copy {
  padding: 10px 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pwa-btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.pwa-btn-copy:active {
  transform: translateY(0);
}

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

/* Close Button */
.pwa-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s ease;
  z-index: 10;
  border-radius: 8px;
}

.pwa-popup-close:hover {
  color: #1f2937;
  background: #f3f4f6;
}

/* Content */
.pwa-popup-content {
  padding: 40px 32px 32px;
  text-align: center;
}

/* Compact Content */
.pwa-popup-content.compact {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Icon */
.pwa-popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 16px;
  margin: 0 auto 24px;
}

.pwa-popup-icon.compact {
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 12px;
}

.pwa-popup-icon svg {
  color: white;
}

/* Title */
.pwa-popup-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px;
  line-height: 1.2;
}

.pwa-popup-title.compact {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}

/* Description */
.pwa-popup-description {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
}

.pwa-popup-description.compact {
  font-size: 12px;
  margin: 0;
  color: #6b7280;
  line-height: 1.4;
}

/* Popup Text Container */
.pwa-popup-text {
  text-align: left;
}

/* Logo Container */
.pwa-popup-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

.pwa-popup-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-popup-logo i {
  font-size: 32px;
  color: white;
}

.pwa-popup-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pwa-popup-brand-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

/* Steps */
.pwa-popup-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
  text-align: left;
}

.pwa-popup-steps.compact {
  gap: 8px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step.compact {
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #4f46e5;
  font-size: 14px;
}

.step.compact .step-number {
  width: 28px;
  height: 28px;
  font-size: 12px;
  margin: 0;
}

.step-text {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
}

.step-title {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px;
  font-size: 14px;
}

.step-desc {
  color: #6b7280;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

/* iOS Steps */
.ios-steps {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin: 24px 0;
}

.ios-steps .step {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.ios-steps .step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Benefits */
.pwa-popup-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.benefit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.benefit svg {
  color: #10b981;
  flex-shrink: 0;
}

.benefit span {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  text-align: center;
}

/* Actions */
.pwa-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.pwa-popup-actions.compact {
  gap: 8px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Buttons */
.pwa-btn-install,
.pwa-btn-later {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.pwa-btn-install.compact,
.pwa-btn-later.compact {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
}

.pwa-btn-install {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.pwa-btn-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

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

.pwa-btn-later {
  background: #f3f4f6;
  color: #374151;
}

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

.pwa-btn-later:active {
  background: #d1d5db;
}

/* Responsive Design */
@media (max-width: 640px) {
  .pwa-popup-container {
    width: 95%;
    max-height: 95vh;
    border-radius: 12px;
  }

  .pwa-popup-content {
    padding: 32px 20px 20px;
  }

  .pwa-popup-title {
    font-size: 20px;
  }

  .pwa-popup-description {
    font-size: 13px;
  }

  .pwa-popup-benefits {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .benefit {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
  }

  .benefit span {
    text-align: left;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .step-title {
    font-size: 13px;
  }

  .step-desc {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .pwa-popup-container {
    width: 98%;
  }

  .pwa-popup-content {
    padding: 28px 16px 16px;
  }

  .pwa-popup-icon {
    width: 64px;
    height: 64px;
  }

  .pwa-popup-icon svg {
    width: 32px;
    height: 32px;
  }

  .pwa-popup-title {
    font-size: 18px;
  }

  .pwa-popup-steps {
    gap: 12px;
  }

  .pwa-popup-benefits {
    gap: 6px;
  }

  .benefit {
    padding: 8px;
    font-size: 11px;
  }

  .pwa-btn-install,
  .pwa-btn-later {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .pwa-popup-container {
    background: #1f2937;
  }

  .pwa-popup-title {
    color: #f9fafb;
  }

  .pwa-popup-description {
    color: #d1d5db;
  }

  .step-number {
    background: #374151;
    color: #a78bfa;
  }

  .step-title {
    color: #f3f4f6;
  }

  .step-desc {
    color: #9ca3af;
  }

  .benefit {
    background: #374151;
  }

  .benefit span {
    color: #e5e7eb;
  }

  .pwa-btn-later {
    background: #374151;
    color: #f3f4f6;
  }

  .pwa-btn-later:hover {
    background: #4b5563;
  }

  .pwa-popup-close {
    color: #9ca3af;
  }

  .pwa-popup-close:hover {
    color: #f3f4f6;
    background: #374151;
  }

  .ios-steps {
    background: #374151;
  }

  .ios-steps .step {
    border-bottom-color: #4b5563;
  }
}

/* Print Styles */
@media print {
  .pwa-install-popup {
    display: none !important;
  }
}
