/* =============================================================
   PWA SECTION & UI COMPONENTS — Bontang Aquatik
   Tambahkan ke home.css (atau import sebagai pwa.css)
   Memakai variable theme yang sudah ada di global.css
   ============================================================= */

/* ============================================================
   SECTION LAYOUT
   ============================================================ */
#install-app {
  position: relative;
  overflow: hidden;
}
#install-app::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(22, 154, 196, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 106, 0, 0.07) 0%, transparent 40%);
  pointer-events: none;
}

.pwa-section-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ============================================================
   KONTEN (KIRI)
   ============================================================ */
.pwa-eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(22, 154, 196, 0.25);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.pwa-content h3 {
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: 18px;
  font-weight: 800;
}
.pwa-highlight {
  color: var(--color-accent);
  position: relative;
  display: inline-block;
}
.pwa-highlight::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 4px;
  height: 8px;
  background: rgba(255, 106, 0, 0.22);
  z-index: -1;
  border-radius: 4px;
}

.pwa-lead {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  max-width: 520px;
}

/* ============================================================
   FEATURES LIST
   ============================================================ */
.pwa-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pwa-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.pwa-feature:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pwa-feature-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, rgba(22, 154, 196, 0.18) 100%);
  border-radius: 10px;
  color: var(--color-primary);
}
.pwa-feature h4 {
  font-size: 14.5px;
  margin: 0 0 4px 0;
  color: var(--color-text-heading);
  font-weight: 700;
}
.pwa-feature p {
  font-size: 12.5px;
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ============================================================
   CTA BUTTON
   ============================================================ */
.pwa-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.pwa-install-btn {
  position: relative;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  overflow: hidden;
  isolation: isolate;
}
.pwa-install-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}
.pwa-install-btn:hover::before { opacity: 1; }
.pwa-install-btn:not(:disabled)::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: var(--color-accent);
  opacity: 0;
  z-index: -2;
  animation: pwaPulse 2.4s ease-in-out infinite;
}
@keyframes pwaPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%      { opacity: 0.18; transform: scale(1.06); }
}
.pwa-install-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.pwa-install-btn.pwa-installed {
  background: var(--color-success);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.30);
  cursor: default;
  opacity: 1;
  color: #fff;
}
.pwa-install-btn.pwa-installed::after { display: none; }
.pwa-btn-icon { font-size: 18px; line-height: 1; }
.pwa-install-status {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Badges kompatibilitas */
.pwa-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pwa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-main);
}

/* ============================================================
   VISUAL (KANAN) — PHONE MOCKUP
   ============================================================ */
.pwa-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
}

/* Decorative blobs */
.pwa-visual-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  z-index: 0;
}
.pwa-visual-blob-1 {
  width: 280px; height: 280px;
  top: 10%; left: 10%;
  background: radial-gradient(circle, rgba(22, 154, 196, 0.45) 0%, transparent 70%);
}
.pwa-visual-blob-2 {
  width: 240px; height: 240px;
  bottom: 8%; right: 8%;
  background: radial-gradient(circle, rgba(255, 106, 0, 0.32) 0%, transparent 70%);
}

/* Floating bubbles */
.pwa-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85) 0%, rgba(22, 154, 196, 0.4) 70%, transparent 100%);
  border: 1px solid rgba(22, 154, 196, 0.3);
  z-index: 1;
  pointer-events: none;
}
.pwa-bubble-1 {
  width: 36px; height: 36px;
  top: 12%; right: 18%;
  animation: pwaFloat 6s ease-in-out infinite;
}
.pwa-bubble-2 {
  width: 22px; height: 22px;
  bottom: 22%; left: 8%;
  animation: pwaFloat 7s ease-in-out infinite 1s;
}
.pwa-bubble-3 {
  width: 14px; height: 14px;
  top: 60%; right: 6%;
  animation: pwaFloat 5s ease-in-out infinite 0.5s;
}
@keyframes pwaFloat {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-18px) translateX(6px); }
}

/* Phone frame */
.pwa-phone {
  position: relative;
  width: 260px;
  height: 520px;
  background: linear-gradient(160deg, #1a1f24 0%, #0b0f12 100%);
  border-radius: 38px;
  padding: 12px 10px;
  box-shadow:
    0 30px 60px -20px rgba(15, 42, 68, 0.45),
    0 0 0 2px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 2;
  animation: pwaPhoneFloat 6s ease-in-out infinite;
}
@keyframes pwaPhoneFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-12px) rotate(-2deg); }
}
.pwa-phone-notch {
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  width: 70px; height: 18px;
  background: #000;
  border-radius: 999px;
  z-index: 3;
}
.pwa-phone-home {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 4px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
}
.pwa-phone-screen {
  width: 100%; height: 100%;
  background: var(--color-bg);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pwa-phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-heading);
}
.pwa-phone-status-icons {
  display: inline-flex;
  gap: 3px;
}
.pwa-phone-status-icons span {
  width: 4px; height: 4px;
  background: var(--color-text-heading);
  border-radius: 50%;
  display: inline-block;
}
.pwa-phone-hero {
  background: var(--gradient-hero);
  margin: 4px 10px 12px;
  padding: 18px 14px;
  border-radius: 16px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 154, 196, 0.3);
}
.pwa-phone-logo {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
}
.pwa-phone-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: -0.3px;
}
.pwa-phone-sub {
  font-size: 9px;
  opacity: 0.85;
  margin-bottom: 10px;
}
.pwa-phone-cta {
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(255, 106, 0, 0.4);
}
.pwa-phone-cards {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pwa-phone-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.pwa-phone-card-icon {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--color-primary-light);
  border-radius: 8px;
  font-size: 14px;
}
.pwa-phone-card-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pwa-phone-card-lines span {
  height: 5px;
  background: var(--color-border);
  border-radius: 999px;
  display: block;
}
.pwa-phone-card-lines span:first-child { width: 80%; background: var(--color-border-strong); }
.pwa-phone-card-lines span:last-child  { width: 55%; }

/* Floating "Installed" badge */
.pwa-badge-float {
  position: absolute;
  bottom: 8%;
  right: -8px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 3;
  animation: pwaBadgeFloat 6s ease-in-out infinite 0.5s;
}
@keyframes pwaBadgeFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.pwa-badge-float-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--color-success);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(22, 113, 198, 0.4);
}
.pwa-badge-float strong {
  display: block;
  font-size: 12.5px;
  color: var(--color-text-heading);
  font-weight: 700;
}
.pwa-badge-float span {
  display: block;
  font-size: 10.5px;
  color: var(--color-text-secondary);
}

/* ============================================================
   FLOATING BANNER (auto-popup)
   ============================================================ */
.pwa-banner {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 40px);
  max-width: 460px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon body" "icon actions";
  gap: 6px 14px;
  align-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.3s ease;
}
.pwa-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.pwa-banner-close {
  position: absolute;
  top: 8px; right: 10px;
  background: transparent;
  border: none;
  width: 26px; height: 26px;
  font-size: 20px;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: var(--transition);
}
.pwa-banner-close:hover {
  background: var(--color-bg-section);
  color: var(--color-text-heading);
}
.pwa-banner-icon {
  grid-area: icon;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(22, 154, 196, 0.3);
}
.pwa-banner-body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 28px;
}
.pwa-banner-body strong {
  font-size: 14px;
  color: var(--color-text-heading);
  font-weight: 700;
}
.pwa-banner-body span {
  font-size: 12.5px;
  color: var(--color-text-secondary);
}
.pwa-banner-actions {
  grid-area: actions;
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.pwa-banner-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.pwa-banner-btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 106, 0, 0.25);
}
.pwa-banner-btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.pwa-banner-btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.pwa-banner-btn-ghost:hover {
  background: var(--color-bg-section);
  color: var(--color-text-heading);
}

/* ============================================================
   MODAL INSTRUKSI
   ============================================================ */
.pwa-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.pwa-modal-backdrop.show { opacity: 1; }
.pwa-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 28px 26px 22px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.pwa-modal-backdrop.show .pwa-modal { transform: translateY(0) scale(1); }
.pwa-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: none;
  width: 30px; height: 30px;
  font-size: 22px;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: var(--transition);
}
.pwa-modal-close:hover {
  background: var(--color-bg-section);
  color: var(--color-text-heading);
}
.pwa-modal-header {
  text-align: center;
  margin-bottom: 22px;
}
.pwa-modal-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
  animation: pwaBounce 2s ease-in-out infinite;
}
@keyframes pwaBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.pwa-modal-header h3 {
  font-size: 20px;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.pwa-modal-header p {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.pwa-modal-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 22px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-modal-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--color-text-main);
}
.pwa-modal-step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.pwa-modal-step-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 16px;
}
.pwa-modal-step-icon svg { display: block; }
.pwa-modal-step-text { line-height: 1.45; }

/* ============================================================
   UPDATE BANNER
   ============================================================ */
.pwa-update {
  position: fixed;
  bottom: 20px; left: 20px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 9997;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.3s ease;
  max-width: calc(100% - 40px);
}
.pwa-update.show {
  transform: translateY(0);
  opacity: 1;
}
.pwa-update-body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-heading);
}
.pwa-update-body span {
  display: block;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.pwa-update-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   OFFLINE INDICATOR
   ============================================================ */
.pwa-offline {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  background: var(--color-warning);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10002;
  transition: transform 0.3s ease;
}
.pwa-offline.show { transform: translateX(-50%) translateY(0); }
.pwa-offline-dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pwaBlink 1.4s ease-in-out infinite;
}
@keyframes pwaBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .pwa-section-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }
  .pwa-content h3 { font-size: 32px; }
  .pwa-visual { min-height: 480px; }
}

@media (max-width: 600px) {
  .pwa-content h3 { font-size: 26px; }
  .pwa-lead { font-size: 14.5px; }
  .pwa-features { grid-template-columns: 1fr; gap: 10px; }
  .pwa-feature { padding: 12px 14px; }
  .pwa-cta { gap: 12px; }
  .pwa-install-btn { width: 100%; justify-content: center; padding: 14px 24px; }
  .pwa-install-status { font-size: 12px; }
  .pwa-phone { width: 220px; height: 440px; }
  .pwa-visual { min-height: 440px; }
  .pwa-badge-float { right: -4px; padding: 8px 12px; }
  .pwa-badge-float strong { font-size: 11.5px; }
  .pwa-badge-float span { font-size: 10px; }

  .pwa-banner {
    grid-template-columns: 1fr;
    grid-template-areas: "icon" "body" "actions";
    text-align: center;
    padding: 18px 18px 16px;
  }
  .pwa-banner-icon { margin: 0 auto; }
  .pwa-banner-body { padding-right: 0; }
  .pwa-banner-actions { justify-content: center; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .pwa-phone,
  .pwa-badge-float,
  .pwa-bubble-1, .pwa-bubble-2, .pwa-bubble-3,
  .pwa-modal-emoji,
  .pwa-offline-dot,
  .pwa-install-btn:not(:disabled)::after {
    animation: none;
  }
}
