/* assets/css/pwa_installer.css - Glassmorphic PWA Install Guide Styling */
:root {
  --pwa-primary: #10b981;
  --pwa-primary-hover: #059669;
  --pwa-gold: #d97706;
  --pwa-bg-glass: rgba(255, 255, 255, 0.92);
  --pwa-border: rgba(16, 185, 129, 0.2);
  --pwa-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.07);
}

/* 1. البنر العائم السفلي الذكي */
#pwaInstallBanner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 99999;
  background: var(--pwa-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--pwa-border);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: var(--pwa-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: pwaSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-family: inherit;
  direction: rtl;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.pwa-banner-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pwa-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.pwa-banner-desc {
  font-size: 12px;
  color: #64748b;
}

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

.btn-pwa-install {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.btn-pwa-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
}

.btn-pwa-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* 2. النافذة المنبثقة الإرشادية التفصيلية (Modal) */
.pwa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

.pwa-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.pwa-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.pwa-modal-overlay.active .pwa-modal-card {
  transform: scale(1);
}

.pwa-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pwa-modal-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

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

/* تبويبات الأجهزة (Tabs) */
.pwa-tabs {
  display: flex;
  background: #f8fafc;
  padding: 6px;
  border-bottom: 1px solid #e2e8f0;
  gap: 6px;
}

.pwa-tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.pwa-tab-btn.active {
  background: #ffffff;
  color: #10b981;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pwa-modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.pwa-tab-content {
  display: none;
}

.pwa-tab-content.active {
  display: block;
  animation: pwaFadeIn 0.3s ease;
}

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

/* خطوات الشرح (Steps) */
.pwa-steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pwa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #f8fafc;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
}

.pwa-step-num {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}

.pwa-step-text {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
}

.pwa-step-text strong {
  color: #0f172a;
}

.pwa-highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.pwa-modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.btn-pwa-done {
  width: 100%;
  background: #0f172a;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-pwa-done:hover {
  background: #1e293b;
}

/* الاستجابة للشاشات الصغيرة */
@media (max-width: 480px) {
  #pwaInstallBanner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }
  .pwa-banner-actions {
    justify-content: flex-end;
  }
  .btn-pwa-install {
    flex: 1;
    justify-content: center;
  }
}
