/* =========================================
   Install Prompt Styles
   ========================================= */
.install-prompt-overlay {
  position: fixed;
  font-family: 'Vazir', 'Vazirmatn', Tahoma, sans-serif !important;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  padding: 0;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.install-prompt {
  background: white;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 1.5rem;
  position: relative;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  margin-bottom: 0;
  direction: rtl;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* فلش اشاره‌گر به دکمه Share */
.share-button-pointer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: floatPointer 2s ease-in-out infinite;
}

@keyframes floatPointer {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-15px); }
}

.pointer-spotlight {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseSpotlight 2s ease-in-out infinite;
}

@keyframes pulseSpotlight {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(1.3); opacity: 0.4; }
}

.pointer-arrow {
  filter: drop-shadow(0 4px 12px rgba(255, 107, 157, 0.6));
  animation: bounceArrow 1.5s ease-in-out infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

.pointer-text {
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #FF6B9D, #FF8FA3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
  animation: wiggle 1s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #f5f5f5;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #666;
  z-index: 10;
}

.close-btn:hover { background: #e0e0e0; transform: rotate(90deg) scale(1.1); }
.close-btn:active { transform: rotate(90deg) scale(0.95); }

/* Header */
.prompt-header { text-align: center; margin-bottom: 1.5rem; padding-top: 0.5rem; }
.prompt-icon { font-size: 3.5rem; margin-bottom: 0.5rem; animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1); display: inline-block; }

@keyframes scaleIn {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.prompt-header h3 {
  font-size: 1.6rem; font-weight: 800; margin: 0.5rem 0;
  background: linear-gradient(135deg, #FF6B9D, #FF8FA3);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.prompt-header p { color: #666; font-size: 0.95rem; margin: 0; line-height: 1.5; }

/* iOS Steps */
.install-steps { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }
.step {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 2px solid transparent; position: relative; overflow: hidden;
}
.step::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 143, 163, 0.1));
  opacity: 0; transition: opacity 0.3s;
}
.step:hover::before { opacity: 1; }
.step:hover { transform: translateX(4px); border-color: rgba(255, 107, 157, 0.3); box-shadow: 0 4px 12px rgba(255, 107, 157, 0.15); }

/* تأکید روی مرحله اول */
.step-highlight {
  background: linear-gradient(135deg, #fff5f7 0%, #ffffff 100%);
  border: 2px solid rgba(255, 107, 157, 0.3);
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2);
  animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2); }
  50% { box-shadow: 0 6px 20px rgba(255, 107, 157, 0.35); }
}

.step-number {
  background: linear-gradient(135deg, #FF6B9D, #FF8FA3); color: white; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0; box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3); font-size: 1.1rem;
}
.step-number.pulse { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3); }
  50% { transform: scale(1.1); box-shadow: 0 6px 16px rgba(255, 107, 157, 0.5); }
}

.step-content { display: flex; align-items: center; gap: 0.75rem; flex: 1; font-size: 0.95rem; color: #333; line-height: 1.5; }
.share-icon-step, .home-icon, .check-icon { font-size: 1.5rem; display: inline-flex; align-items: center; flex-shrink: 0; }
.share-icon-step svg, .home-icon svg { filter: drop-shadow(0 2px 4px rgba(0, 122, 255, 0.2)); }
.highlight-text { color: #007AFF; font-weight: 700; background: rgba(0, 122, 255, 0.1); padding: 0.2rem 0.5rem; border-radius: 6px; }

/* Footer Badges */
.prompt-footer { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #eee; }
.feature-badges { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.badge {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%); color: #0066cc; padding: 0.5rem 1rem;
  border-radius: 20px; font-size: 0.85rem; font-weight: 600; border: 1px solid rgba(0, 102, 204, 0.2);
  display: inline-flex; align-items: center; gap: 0.25rem;
}

/* Android Install Button */
.install-btn {
  width: 100%; padding: 1.2rem; background: linear-gradient(135deg, #FF6B9D, #FF8FA3);
  color: white; border: none; border-radius: 16px; font-size: 1.15rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 6px 20px rgba(233, 30, 99, 0.35);
  position: relative; overflow: hidden;
}
.install-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent); opacity: 0; transition: opacity 0.3s;
}
.install-btn:hover::before { opacity: 1; }
.install-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(233, 30, 99, 0.45); }
.install-btn:active { transform: translateY(-1px); }

/* Features */
.features { display: flex; justify-content: space-around; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #eee; }
.feature { font-size: 0.85rem; color: #666; font-weight: 500; }

/* Desktop Styles */
.keyboard-shortcuts { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }
.shortcut {
  display: flex; align-items: center; gap: 1rem; padding: 1.2rem;
  background: linear-gradient(135deg, #93c5f4 0%, #f39494 100%);
  border-radius: 16px; justify-content: space-between; transition: all 0.3s; border: 2px solid transparent;
}
.shortcut:hover { border-color: rgba(255, 107, 157, 0.3); transform: translateX(-4px); }
.shortcut div { display: flex; gap: 0.5rem; align-items: center; }
.shortcut kbd {
  background: linear-gradient(135deg, #2c3e50, #34495e); color: white; padding: 0.5rem 1rem;
  border-radius: 8px; font-family: 'SF Mono', 'Monaco', monospace; font-size: 1rem; font-weight: 600;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.3); min-width: 45px; text-align: center;
}
.shortcut span { color: #666; font-size: 0.9rem; font-weight: 500; }

.or-divider { text-align: center; color: #999; font-size: 0.9rem; font-weight: 600; margin: 1.5rem 0; position: relative; }
.or-divider::before, .or-divider::after {
  content: ''; position: absolute; top: 50%; width: 35%; height: 2px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

.manual-steps {
  text-align: center; padding: 1.2rem; background: linear-gradient(135deg, #fff5e6 0%, #ffffff 100%);
  border-radius: 16px; border: 2px solid rgba(255, 193, 7, 0.3);
}
.manual-steps p { color: #f57c00; font-weight: 600; margin: 0; font-size: 1rem; }

/* Desktop Mode */
@media (min-width: 768px) {
  .install-prompt-overlay { align-items: center; padding: 2rem; }
  .install-prompt { border-radius: 24px; margin-bottom: 0; animation: scaleInBounce 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes scaleInBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
  }
  .share-button-pointer { display: none; }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .install-prompt { background: #1c1c1e; color: #ffffff; }
  .step { background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%); }
  .prompt-header p, .step-content, .feature, .shortcut span { color: #ebebf5; }
  .close-btn { background: #2c2c2e; color: #ebebf5; }
  .close-btn:hover { background: #3a3a3c; }
}
