/* =============================================
   SaveClips — PWA Install Banner Styles
   File: assets/css/pwa.css
   ============================================= */

/* ── Banner container ───────────────────────────────────────── */
#pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9995;
  padding: 0 16px 16px;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  pointer-events: none;
}

#pwa-banner.pwa-banner-show {
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Inner card ─────────────────────────────────────────────── */
.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 -4px 32px rgba(37, 99, 235, 0.12),
              0  8px 24px rgba(0, 0, 0, 0.12);
  max-width: 520px;
  margin: 0 auto;
}

/* Dark mode */
[data-theme="dark"] .pwa-banner-inner {
  background: #18181b;
  border-color: #1e3a8a;
  box-shadow: 0 -4px 32px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
}

/* ── App icon ───────────────────────────────────────────────── */
.pwa-banner-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-banner-icon img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
}

.pwa-banner-icon-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #2563eb;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ── Text ───────────────────────────────────────────────────── */
.pwa-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pwa-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  display: block;
}

[data-theme="dark"] .pwa-banner-text strong {
  color: #fafafa;
}

#pwa-banner-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  display: block;
}

[data-theme="dark"] #pwa-banner-sub {
  color: #a1a1aa;
}

/* ── Action buttons ─────────────────────────────────────────── */
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-btn-install {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pwa-btn-install:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.pwa-btn-install:active {
  transform: translateY(0);
}

.pwa-btn-dismiss {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

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

[data-theme="dark"] .pwa-btn-dismiss {
  border-color: #3f3f46;
  color: #71717a;
}

[data-theme="dark"] .pwa-btn-dismiss:hover {
  background: #27272a;
  color: #a1a1aa;
}

/* ── Adjust position if cookie banner is also visible ───────── */
#cookie-banner.show ~ #pwa-banner,
body:has(#cookie-banner.show) #pwa-banner {
  bottom: 70px;
}

/* ── Tablet / Desktop — float it as a card bottom-right ─────── */
@media (min-width: 600px) {
  #pwa-banner {
    left: auto;
    right: 20px;
    bottom: 20px;
    padding: 0;
    max-width: 380px;
  }
  .pwa-banner-inner {
    border-radius: 16px;
    padding: 16px 18px;
  }
}

/* ── Reduce motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #pwa-banner {
    transition: opacity 0.2s ease;
    transform: translateY(0);
    opacity: 0;
  }
  #pwa-banner.pwa-banner-show {
    opacity: 1;
  }
}
