/* ========================================================
   PWA Install UI Styles - El-Eman Medical Lab
   ======================================================== */

:root {
  --pwa-brand: #cf397b;
  --pwa-dark: #9d1d55;
  --pwa-ink: #1f1b24;
  --pwa-soft: #fff3f8;
  --pwa-line: #f2dce6;
  --pwa-shadow: 0 20px 60px rgba(80, 27, 52, 0.22);
}

/* Hide all install prompts & buttons */
.pwa-banner,
.pwa-floating-btn,
.pwa-ios-overlay,
.pwa-nav-btn,
.pwa-mobile-item,
[data-pwa-install] {
  display: none !important;
}

/* Prompt Banner / Card */
.pwa-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  max-width: 460px;
  margin: 0 auto;
  z-index: 99999;
  background: #ffffff;
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: var(--pwa-shadow);
  border: 1px solid var(--pwa-line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  direction: rtl;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  transform: translateY(140%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s;
}

.pwa-banner.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.pwa-banner-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-banner-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(207, 57, 123, 0.2);
  flex-shrink: 0;
  background: transparent;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
}

.pwa-banner-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pwa-ink);
  margin: 0 0 4px;
  line-height: 1.3;
}

.pwa-banner-desc {
  font-size: 0.82rem;
  color: #6a6774;
  margin: 0;
  line-height: 1.5;
}

.pwa-banner-close {
  background: var(--pwa-soft);
  color: #8c828d;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.pwa-banner-close:hover {
  background: #ffe3ef;
  color: var(--pwa-dark);
}

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

.pwa-install-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--pwa-brand), var(--pwa-dark));
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(207, 57, 123, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.pwa-install-btn:hover {
  box-shadow: 0 10px 24px rgba(207, 57, 123, 0.45);
}

.pwa-install-btn:active {
  transform: scale(0.97);
}

.pwa-later-btn {
  background: transparent;
  color: #7b7582;
  border: none;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s;
}

.pwa-later-btn:hover {
  background: var(--pwa-soft);
  color: var(--pwa-ink);
}

/* Floating Install Trigger Button (when banner is dismissed) */
.pwa-floating-btn {
  position: fixed;
  bottom: 88px;
  left: 20px;
  z-index: 99990;
  background: linear-gradient(135deg, var(--pwa-brand), var(--pwa-dark));
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  box-shadow: 0 8px 24px rgba(207, 57, 123, 0.38);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  direction: rtl;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  animation: pwaPulse 2.5s infinite;
}

.pwa-floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(207, 57, 123, 0.5);
}

@keyframes pwaPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

/* iOS Safari Instructions Modal */
.pwa-ios-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 14, 20, 0.65);
  backdrop-filter: blur(5px);
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  direction: rtl;
  font-family: 'Cairo', sans-serif;
}

.pwa-ios-overlay.show {
  opacity: 1;
  visibility: visible;
}

.pwa-ios-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.3);
  text-align: center;
  position: relative;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.pwa-ios-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pwa-ink);
  margin: 12px 0 8px;
}

.pwa-ios-card p {
  color: #6a6774;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
  margin-bottom: 22px;
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pwa-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pwa-ink);
}

.pwa-ios-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pwa-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.pwa-ios-step i {
  color: var(--pwa-dark);
  font-size: 1.1rem;
}

.pwa-ios-close-btn {
  width: 100%;
  background: var(--pwa-ink);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 13px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
}

/* Safe Area adjustments for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pwa-banner {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .pwa-floating-btn {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 600px) {
  .pwa-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 16px;
    border-radius: 20px;
  }
  .pwa-banner-title {
    font-size: 0.98rem;
  }
  .pwa-banner-desc {
    font-size: 0.78rem;
  }
  .pwa-install-btn {
    padding: 11px 14px;
    font-size: 0.88rem;
  }
}

.pwa-nav-btn {
  background: linear-gradient(135deg, var(--pwa-brand), var(--pwa-dark));
  color: #fff !important;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(207, 57, 123, 0.28);
  transition: transform 0.2s, box-shadow 0.2s;
}
.pwa-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(207, 57, 123, 0.38);
}
.pwa-mobile-item {
  background: var(--pwa-soft) !important;
  color: var(--pwa-dark) !important;
  font-weight: 800 !important;
  border: 1px solid var(--pwa-line) !important;
}

