/**
 * PWA Installation Modal Styles
 * پنجره نصب برنامه (PWA)
 */

/* ============================================================
   PWA Modal Container Styles
   ============================================================ */

.pwa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.pwa-modal.pwa-modal-visible {
  opacity: 1;
  pointer-events: all;
}

/* Overlay Background */
.pwa-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1;
}

/* Modal Container */
.pwa-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 2;
  max-width: 500px;
  width: calc(100% - 40px);
  max-height: 90vh;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pwa-modal.pwa-modal-visible .pwa-modal-container {
  transform: translate(-50%, -50%) scale(1);
}

/* Content Box */
.pwa-modal-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 24px;
  padding: 30px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  direction: rtl;
}

/* Close Button */
.pwa-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
  font-size: 20px;
}

.pwa-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.pwa-modal-close:active {
  transform: scale(0.95) rotate(90deg);
}

/* Header with Logo */
.pwa-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.pwa-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.2);
  animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Modal Title and Subtitle */
.pwa-modal-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 20px 0 10px 0;
  text-align: center;
}

.pwa-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-bottom: 20px;
}

/* Benefits Grid */
.pwa-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 24px 0;
}

.pwa-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
}

.pwa-benefit i {
  font-size: 20px;
  color: #fbbc04;
  min-width: 24px;
}

/* Buttons Container */
.pwa-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* Primary Button */
.pwa-btn-primary {
  background: linear-gradient(135deg, #fbbc04 0%, #ffd700 100%);
  color: #1a1a1a;
  border: none;
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.3);
}

.pwa-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(251, 191, 36, 0.4);
}

.pwa-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.pwa-btn-primary i {
  font-size: 18px;
}

/* Secondary Button */
.pwa-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pwa-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.pwa-btn-secondary:active {
  transform: scale(0.98);
}

.pwa-btn-secondary i {
  font-size: 16px;
}

/* iOS Hint Box */
.pwa-ios-hint {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.5;
}

.pwa-ios-hint p {
  margin: 0;
}

.pwa-ios-hint strong {
  color: #a78bfa;
}

.pwa-ios-hint i {
  color: #a78bfa;
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 768px) {
  .pwa-modal-content {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .pwa-modal-content h2 {
    font-size: 22px;
  }

  .pwa-logo {
    width: 70px;
    height: 70px;
  }

  .pwa-benefits {
    gap: 10px;
    margin: 18px 0;
  }

  .pwa-benefit {
    padding: 12px 14px;
    font-size: 13px;
  }

  .pwa-btn-primary,
  .pwa-btn-secondary {
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* ============================================================
   iOS Installation Guide Styles
   ============================================================ */

.pwa-ios-guide {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  background:
    radial-gradient(circle at 30% 20%, rgba(251, 191, 36, 0.08), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.08), transparent 50%),
    rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.pwa-ios-guide.pwa-ios-guide-visible {
  opacity: 1;
  pointer-events: all;
}

.pwa-ios-guide-content {
  background: linear-gradient(160deg, #1f1f23 0%, #161618 60%, #0f0f11 100%);
  border-radius: 28px;
  padding: 36px 26px 30px;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  position: relative;
}

.pwa-ios-guide-content::-webkit-scrollbar {
  width: 6px;
}

.pwa-ios-guide-content::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.3);
  border-radius: 10px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close Button */
.pwa-ios-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
  font-size: 18px;
}

.pwa-ios-close:hover {
  background: rgba(255, 80, 80, 0.15);
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff6b6b;
  transform: rotate(90deg);
}

.pwa-ios-close:active {
  transform: scale(0.92) rotate(90deg);
}

/* Header */
.pwa-ios-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  margin-top: 6px;
}

.pwa-ios-header i {
  font-size: 38px;
  background: linear-gradient(135deg, #fbbc04 0%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.35));
}

.pwa-ios-header h3 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -0.3px;
}

/* Steps */
.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.step {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.step::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.step:hover {
  border-color: rgba(251, 191, 36, 0.25);
  transform: translateX(-2px);
}

.step:hover::before {
  opacity: 1;
}

.step-num {
  min-width: 38px;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #fbbc04 0%, #ffd700 100%);
  color: #1a1a1a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.25);
  position: relative;
  z-index: 1;
}

.step-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.step-text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14.5px;
  line-height: 1.5;
}

.step-text strong {
  color: #fbbc04;
  font-weight: 700;
}

.step-text i {
  font-size: 19px;
  color: #fbbc04;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 9px;
}

/* Light theme overrides */
:root.light-theme .pwa-ios-guide {
  background:
    radial-gradient(circle at 30% 20%, rgba(251, 191, 36, 0.1), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.08), transparent 50%),
    rgba(255, 255, 255, 0.4);
}

:root.light-theme .pwa-ios-guide-content {
  background: linear-gradient(160deg, #ffffff 0%, #f7f7f8 100%);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

:root.light-theme .pwa-ios-header h3 {
  color: #1a1a1a;
}

:root.light-theme .pwa-ios-close {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.06);
  color: rgba(26, 26, 26, 0.6);
}

:root.light-theme .step {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

:root.light-theme .step-text p {
  color: rgba(26, 26, 26, 0.88);
}

/* iOS Buttons */
.pwa-ios-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.pwa-ios-dismiss-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.pwa-ios-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

.pwa-ios-dismiss-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.06);
}

.pwa-ios-dismiss-btn i {
  font-size: 16px;
}

:root.light-theme .pwa-ios-dismiss-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(26, 26, 26, 0.7);
}

:root.light-theme .pwa-ios-dismiss-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}

@media (max-width: 480px) {
  .pwa-ios-guide-content {
    padding: 28px 18px 24px;
    border-radius: 22px;
  }

  .pwa-ios-header h3 {
    font-size: 20px;
  }

  .step {
    padding: 14px 14px;
    gap: 12px;
  }

  .step-num {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .step-text p {
    font-size: 13.5px;
  }

  .pwa-ios-buttons {
    gap: 10px;
    margin-top: 18px;
  }

  .pwa-ios-dismiss-btn {
    padding: 12px 14px;
    font-size: 13px;
  }
}