/* ============================================================
   EIVIRA LUXURY PROGRESSIVE WEB APP (PWA) STYLES
   Royal Obsidian & Gold Theme
   ============================================================ */

:root {
  --pwa-gold-primary: #d4af37;
  --pwa-gold-gradient: linear-gradient(135deg, #f5d77f 0%, #d4af37 50%, #aa820a 100%);
  --pwa-dark-bg: rgba(10, 12, 18, 0.94);
  --pwa-card-border: rgba(212, 175, 55, 0.25);
  --pwa-card-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(212, 175, 55, 0.12);
  --pwa-font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 1. Header Notification & Install Action Buttons */
.pwa-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pwa-notif-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: var(--pwa-gold-primary, #d4af37);
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.pwa-notif-btn svg.lucide {
  width: 18px;
  height: 18px;
  color: var(--pwa-gold-primary, #d4af37);
  stroke-width: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.pwa-notif-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: #ffd700;
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

.pwa-notif-btn:hover svg.lucide {
  color: #ffd700;
  transform: scale(1.12);
}

.pwa-notif-btn.is-active {
  background: rgba(212, 175, 55, 0.2);
  border-color: #ffd700;
  color: #ffd700;
}

.pwa-notif-btn.is-active svg.lucide {
  color: #ffd700;
}

.pwa-notif-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  display: none;
}

.pwa-notif-btn.is-active .pwa-notif-badge-dot {
  display: block;
}

.pwa-install-nav-btn {
  background: var(--pwa-gold-gradient);
  color: #0a0a0f !important;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.pwa-install-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
  filter: brightness(1.08);
}

/* 2. Floating Install Prompt Banner */
.pwa-install-banner {
  position: fixed;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  left: 24px;
  right: 24px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--pwa-dark-bg);
  border: 1px solid var(--pwa-card-border);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: var(--pwa-card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  direction: rtl;
  font-family: var(--pwa-font-family);
}

@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: 14px;
  flex: 1;
  min-width: 0;
}

.pwa-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(212, 175, 55, 0.25);
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  flex-shrink: 0;
}

.pwa-text-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.pwa-app-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-app-desc {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-btn-install {
  background: var(--pwa-gold-gradient);
  color: #090a0f;
  font-size: 13px;
  font-weight: 700;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.pwa-btn-install:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}

.pwa-btn-dismiss {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pwa-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* 3. Modal Overlay & Cards */
.pwa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  animation: pwaFadeIn 0.3s ease;
  direction: rtl;
  font-family: var(--pwa-font-family);
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pwa-modal-card {
  background: #0d0f17;
  border: 1px solid var(--pwa-card-border);
  border-radius: 22px;
  max-width: 380px;
  width: 100%;
  max-height: min(88vh, 560px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 18px 16px;
  box-shadow: var(--pwa-card-shadow);
  animation: pwaModalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-align: center;
  box-sizing: border-box;
}

.pwa-modal-card::-webkit-scrollbar {
  display: none;
}

.pwa-scroll-modal-card {
  max-width: 380px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.15);
  padding: 18px 16px;
}

.pwa-modal-close-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.pwa-modal-close-icon:hover {
  color: #ffffff;
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
  transform: rotate(90deg);
}

.pwa-scroll-modal-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 6px;
}

.pwa-scroll-modal-logo {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.35);
  object-fit: cover;
}

.pwa-scroll-modal-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pwa-gold-gradient);
  color: #0a0a0f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.pwa-scroll-modal-badge i {
  width: 10px;
  height: 10px;
}

.pwa-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0 12px;
  text-align: center;
}

.pwa-feature-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 10px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #e2e8f0;
  font-weight: 600;
}

.pwa-feature-pill i,
.pwa-feature-pill svg.lucide {
  color: #ffd700;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.pwa-scroll-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pwa-btn-primary-install {
  flex: 1;
  background: var(--pwa-gold-gradient);
  color: #0a0a0f;
  font-weight: 800;
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 12px rgba(212, 175, 55, 0.3);
  transition: all 0.2s ease;
}

.pwa-btn-primary-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
  filter: brightness(1.08);
}

.pwa-btn-secondary-dismiss {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-btn-secondary-dismiss:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.pwa-ios-instructions-box {
  text-align: right;
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}

.pwa-ios-instructions-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f5d77f;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pwa-ios-instructions-head i {
  width: 15px;
  height: 15px;
  color: #d4af37;
}

@keyframes pwaModalSlide {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-modal-header {
  margin-bottom: 12px;
}

.pwa-modal-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.pwa-modal-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 4px 0;
}

.pwa-modal-desc {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.pwa-steps-list {
  text-align: right;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwa-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.pwa-step-num {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.2);
  color: #ffd700;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-step-icon {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #38bdf8;
  font-weight: 600;
  font-size: 11px;
}

.pwa-modal-close-btn {
  width: 100%;
  background: var(--pwa-gold-gradient);
  color: #0a0a0f;
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.pwa-modal-close-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

/* 4. Network Status Offline / Online Toast */
.pwa-network-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999999;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-family: var(--pwa-font-family);
  direction: rtl;
  pointer-events: none;
}

.pwa-network-toast.show {
  transform: translateX(-50%) translateY(0);
}

.pwa-network-toast.offline {
  background: #1e1215;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pwa-network-toast.online {
  background: #0d1e18;
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* 5. Notification Opt-in Prompt Modal */
.pwa-notif-card {
  background: #0d0f17;
  border: 1px solid var(--pwa-card-border);
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--pwa-card-shadow);
  animation: pwaModalSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.pwa-notif-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #d4af37;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.pwa-notif-benefits {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwa-notif-benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #cbd5e1;
}

.pwa-notif-benefit-item i {
  color: #d4af37;
  flex-shrink: 0;
}

.pwa-notif-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.pwa-notif-btn-confirm {
  flex: 1;
  background: var(--pwa-gold-gradient);
  color: #0a0a0f;
  font-weight: 700;
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.pwa-notif-btn-confirm:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.pwa-notif-btn-cancel {
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.pwa-notif-btn-cancel:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .pwa-install-banner {
    bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    left: 12px;
    right: 12px;
    padding: 14px 16px;
    border-radius: 16px;
  }
  .pwa-app-icon {
    width: 44px;
    height: 44px;
  }
  .pwa-btn-install {
    padding: 7px 12px;
    font-size: 12px;
  }
}
