/* PWA Installation & Mobile UI Styles */

/* Safe Area Inset Support for notched phones */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* Floating Mobile PWA Install Banner */
.pwa-mobile-banner {
  position: fixed;
  bottom: calc(16px + var(--sab));
  left: 14px;
  right: 14px;
  max-width: 440px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #ccfbf1;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(13, 148, 136, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99998;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(8px);
}

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

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.pwa-app-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.pwa-app-icon img,
.pwa-app-icon svg {
  width: 26px;
  height: 26px;
}

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

.pwa-banner-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-text p {
  margin: 0;
  font-size: 0.76rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.pwa-btn-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0d9488;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
  font-family: inherit;
}

.pwa-btn-install:hover {
  background: #0f766e;
  transform: translateY(-1px);
}

.pwa-btn-dismiss {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.pwa-btn-dismiss:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Drawer / Sidebar In-App Install Button */
.pwa-drawer-install-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  color: #0d766e;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 10px;
  text-align: left;
}

.pwa-drawer-install-btn:hover {
  background: #ccfbf1;
  color: #042f2c;
  transform: translateY(-1px);
}

.pwa-drawer-install-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* iOS Safari Installation Instruction Modal */
.pwa-ios-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: pwaFadeIn 0.25s ease forwards;
}

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

.pwa-ios-modal {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px calc(24px + var(--sab));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  text-align: center;
}

.pwa-ios-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  text-align: left;
}

.pwa-ios-modal-head h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.pwa-ios-close-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
}

.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin: 16px 0 20px;
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.88rem;
  color: #334155;
}

.pwa-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0d9488;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pwa-ios-step svg {
  width: 18px;
  height: 18px;
  color: #0284c7;
  flex-shrink: 0;
}

.pwa-ios-ok-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #0d9488;
  color: #ffffff;
  font-weight: 700;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}
