/* HouseDaddyAI PWA install prompt + push nudge banners */

#hdai-install-banner,
#hdai-ios-banner,
#hdai-ios-nonsafari-banner,
#hdai-android-howto-banner,
#hdai-desktop-banner,
#hdai-push-nudge {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 99999;
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 184, 0, 0.15);
  color: #f0f0f0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  animation: hdaiSlideUp 0.25s ease;
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 14px;
}
@keyframes hdaiSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hdai-pb-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hdai-pb-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
}
.hdai-pb-text {
  flex: 1;
  min-width: 0;
}
.hdai-pb-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffb800;
  margin-bottom: 2px;
}
.hdai-pb-sub {
  font-size: 0.82rem;
  color: #cfcfcf;
  line-height: 1.35;
}
.hdai-pb-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 8px;
  border: 0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.hdai-pb-install {
  background: #ffb800;
  color: #0a0a0a;
}
.hdai-pb-install:hover { filter: brightness(1.08); }
.hdai-pb-close {
  background: transparent;
  color: #999;
  padding: 4px 8px;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
}
.hdai-pb-close:hover { color: #fff; }

/* Hide banners when running as an installed PWA */
.is-pwa-installed #hdai-install-banner,
.is-pwa-installed #hdai-ios-banner,
.is-pwa-installed #hdai-ios-nonsafari-banner,
.is-pwa-installed #hdai-android-howto-banner,
.is-pwa-installed #hdai-desktop-banner,
.is-pwa-installed .hdai-install-cta {
  display: none !important;
}

/* Sidebar Install App button — use highest specificity to beat sidebar defaults */
button.sidebar-link.hdai-install-cta,
.hdai-install-cta {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-direction: row !important;
  gap: 10px !important;
  margin: 6px 10px 14px 10px !important;
  padding: 10px 12px !important;
  min-height: 44px !important;
  width: auto !important;
  background: linear-gradient(135deg, #ffb800 0%, #ff8a00 100%) !important;
  color: #0b0b0b !important;
  border: 0 !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  text-align: left !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(255,138,0,0.35) !important;
  white-space: nowrap !important;
}
button.sidebar-link.hdai-install-cta:hover,
.hdai-install-cta:hover { filter: brightness(1.08); }
button.sidebar-link.hdai-install-cta svg,
.hdai-install-cta svg {
  flex-shrink: 0 !important;
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
}
button.sidebar-link.hdai-install-cta span,
.hdai-install-cta span { color: #0b0b0b !important; font-weight: 700 !important; }

/* Compact install button for the landing page hero */
.hdai-install-cta-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #ffb800 0%, #ff8a00 100%);
  color: #0b0b0b !important;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.hdai-install-cta-inline:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hdai-install-cta-inline svg { width: 18px; height: 18px; }

/* ===== Install Instruction Modal ===== */
#hdai-install-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hdaiFadeIn 0.2s ease;
}
@keyframes hdaiFadeIn { from{opacity:0;} to{opacity:1;} }
.hdai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
}
.hdai-modal-card {
  position: relative;
  background: linear-gradient(155deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(255,184,0,0.4);
  border-radius: 18px;
  padding: 24px 22px 20px 22px;
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  color: #eaeaea;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,184,0,0.2);
  text-align: left;
  z-index: 1;
}
.hdai-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #aaa;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
.hdai-modal-close:hover { color: #fff; }
.hdai-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin: 0 auto 12px auto;
  display: block;
}
.hdai-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffb800;
  text-align: center;
  margin-bottom: 8px;
}
.hdai-modal-p {
  font-size: 0.95rem;
  color: #d0d0d0;
  text-align: center;
  margin: 8px 0 20px 0;
  line-height: 1.5;
}
.hdai-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  counter-reset: hdai-step;
}
.hdai-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.hdai-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb800, #ff8a00);
  color: #0b0b0b;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hdai-step-text {
  flex: 1;
  font-size: 0.95rem;
  color: #eaeaea;
  line-height: 1.4;
}
.hdai-step-text b { color: #ffb800; }
.hdai-share-icon {
  margin-top: 8px;
  padding: 10px;
  background: rgba(255,184,0,0.08);
  border: 1px dashed rgba(255,184,0,0.4);
  border-radius: 8px;
  display: inline-block;
}
.hdai-modal-hint {
  text-align: center;
  color: #ffb800;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 8px;
  animation: hdaiBounce 1.6s ease-in-out infinite;
}
@keyframes hdaiBounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.hdai-modal-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  border: 0;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.hdai-modal-primary {
  background: linear-gradient(135deg, #ffb800, #ff8a00);
  color: #0b0b0b;
}

/* Safe area for iPhone home bar */
@supports (padding: env(safe-area-inset-bottom)) {
  #hdai-install-banner,
  #hdai-ios-banner,
  #hdai-push-nudge {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
