/* ==========================================================================
   PWA Adaptive Install Promotion Banner & iOS Tutorial Sheet
   JAGOTOPUP Mobile Experience (2026-10-01)
   ========================================================================== */

:root {
  --pwa-install-banner-height: 0px;
}

body:not(.komunitas-body) {
  padding-top: var(--pwa-install-banner-height, 0px);
}

.tema-2026 .tj-header {
  top: var(--pwa-install-banner-height, 0px);
  padding-top: max(0px, calc(env(safe-area-inset-top, 0px) - var(--pwa-install-banner-height, 0px)));
}

/* Top Slim Banner */
.pwa-banner-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: rgba(18, 22, 32, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  box-sizing: border-box;
  animation: pwaBannerSlideDown 0.28s ease-out;
}

@keyframes pwaBannerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-banner-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.pwa-banner-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  object-fit: cover;
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pwa-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.pwa-banner-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

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

.pwa-banner-wrap .pwa-install-btn {
  background-color: #f97316;
  background-image: none;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.pwa-banner-wrap .pwa-install-btn:hover {
  background-color: #ea580c;
  background-image: none;
}

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

.pwa-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.pwa-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* iOS Bottom Sheet Modal */
.pwa-ios-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.pwa-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: pwaFadeIn 0.2s ease-out;
}

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

.pwa-sheet-content {
  position: relative;
  z-index: 1;
  background: #141824;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px;
  padding-bottom: max(20px, calc(16px + env(safe-area-inset-bottom)));
  box-sizing: border-box;
  animation: pwaSheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaSheetSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.pwa-sheet-grabber {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  margin: 2px auto 10px auto;
}

.pwa-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pwa-sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.pwa-sheet-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
}

.pwa-sheet-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.pwa-sheet-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pwa-step-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.pwa-step-card-wide {
  grid-column: span 3;
  padding: 14px 12px;
}

.pwa-step-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: #f97316;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-step-icon {
  margin: 6px 0 10px 0;
  color: #f97316;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-step-add-preview {
  background: #ffffff;
  color: #0b0e14;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
}

.pwa-step-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  line-height: 1.35;
}

.pwa-fallback-copy-wrap {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.pwa-copy-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #ffffff;
  padding: 8px 10px;
  font-size: 12px;
}

.pwa-fallback-copy-wrap .pwa-copy-btn,
.pwa-copy-btn {
  background-color: #f97316;
  background-image: none;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.pwa-fallback-copy-wrap .pwa-copy-btn:hover,
.pwa-copy-btn:hover {
  background-color: #ea580c;
  background-image: none;
}
