/* ==========================================================================
   Students Parliament Nigeria - PWA & Web Share Styles
   ========================================================================== */

/* PWA Header Action Buttons */
.btn-pwa-action {
  background: rgba(205, 164, 52, 0.16);
  border: 1.5px solid var(--gold-accent, #cda434);
  color: #ffffff;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-pwa-action:hover {
  background: var(--gold-accent, #cda434);
  color: var(--primary-green-dark, #072a18);
  border-color: var(--gold-accent, #cda434);
  transform: none;
}

.btn-pwa-action svg {
  flex-shrink: 0;
}

/* Floating Bottom Bar / Banner (Shown when not standalone app) */
.pwa-install-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  max-width: 440px;
  width: calc(100% - 32px);
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

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

.pwa-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #072a18;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

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

.pwa-banner-title {
  display: block;
  font-weight: 800;
  font-size: 0.88rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.pwa-banner-desc {
  display: block;
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.2;
}

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

.btn-pwa-install-now {
  background: linear-gradient(135deg, #0b3d23 0%, #15803d 100%);
  color: #ffffff;
  border: 1px solid #cda434;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-pwa-install-now:hover {
  background: #14532d;
}

.btn-pwa-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-pwa-close:hover {
  color: #334155;
  background: #f1f5f9;
}

/* iOS Safari Install Instructions Modal */
.ios-install-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: pwaFadeIn 0.2s ease;
  box-sizing: border-box;
}

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

.ios-install-modal-card {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: pwaSlideUpIOS 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes pwaSlideUpIOS {
  from { transform: translateY(40px); }
  to { transform: translateY(0); }
}

.ios-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ios-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0b3d23;
}

.ios-step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ios-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #334155;
}

.ios-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0b3d23;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ios-icon-inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 2px 4px;
  color: #0284c7;
  margin: 0 2px;
}

.btn-ios-got-it {
  width: 100%;
  background: #0b3d23;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ios-got-it:hover {
  background: #15803d;
}

/* ==========================================================================
   PWA Portal Card & Mobile Responsive Controls
   ========================================================================== */

.portal-pwa-card {
  max-width: 900px;
  width: calc(100% - 40px);
  margin: 0 auto 40px;
  background: linear-gradient(135deg, #072a18 0%, #0b3d23 50%, #0d4a2b 100%);
  border: 1.5px solid var(--gold-accent, #cda434);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  color: #ffffff;
}

.portal-pwa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(205, 164, 52, 0.2);
  color: #fef08a;
  border: 1px solid rgba(205, 164, 52, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.portal-pwa-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.portal-pwa-info {
  flex: 1 1 300px;
}

.portal-pwa-info h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #ffffff;
}

.portal-pwa-info p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
  margin: 0;
}

.portal-pwa-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-pwa-portal-install {
  background: var(--gold-accent, #cda434);
  color: #072a18;
  border: 1px solid #fef08a;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-pwa-portal-share {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-pwa-portal-share:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #ffffff;
}

/* Responsive adjustment for mobile header actions */
@media (max-width: 768px) {
  .header-actions .btn-pwa-action {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 0.45rem 0.25rem;
    font-size: 0.78rem;
    gap: 0.25rem;
  }

  /* On generator page header, hide install button on mobile to avoid overcrowding; the floating banner handles it */
  body:not(.portal-body) .header-actions #btnPwaInstallHeader {
    display: none !important;
  }

  .portal-pwa-card {
    padding: 20px 16px;
  }

  .portal-pwa-buttons {
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .btn-pwa-portal-install,
  .btn-pwa-portal-share {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    padding: 11px 10px;
    font-size: 0.85rem;
    gap: 6px;
    box-sizing: border-box;
  }

  .btn-pwa-portal-install svg,
  .btn-pwa-portal-share svg {
    flex-shrink: 0;
  }
}


