/*==================== 📢 POPUP IKLAN UMUM ====================*/
/* ➕ Popup kecil di kanan bawah, muncul otomatis atau dipanggil via JavaScript */
.popup-ad {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 320px;
  width: 90%;
  background-color: var(--container-color);
  border: 2px solid var(--first-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 1rem;
  z-index: 9999;
  display: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

/* 🟢 Saat popup aktif */
.popup-ad.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/*==================== 💰 MODAL PEMBAYARAN ====================*/
/* 💳 Modal khusus untuk pembayaran (posisi dan animasi mirip popup biasa) */
.popup-ad#payment-modal {
  /* sama seperti .popup-ad, tapi ditinggikan z-index */
  z-index: 10001;
  overflow-y: auto;
}

/* Saat modal pembayaran aktif */
.popup-ad#payment-modal.show-modal {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/*==================== 📦 ISI POPUP ====================*/
.popup-ad-content {
  position: relative;
  text-align: center;
  padding: 1.5rem;
}

/*==================== ❌ TOMBOL TUTUP ====================*/
.popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 20px;
  font-weight: bold;
  color: var(--first-color);
  background: transparent;
  border: none;
  cursor: pointer; /* ubah dari 'none' ke 'pointer' */
  line-height: 1;
  transition: transform 0.3s ease;
  z-index: 10002;
}

.popup-close:hover {
  transform: scale(1.2);
  color: red;
}

/*==================== 📝 TEKS POPUP ====================*/
.popup-ad h2,
.popup-ad .popup-heading {
  font-size: 1.1rem;
  color: var(--title-color);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.popup-ad p {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

/*==================== 🔘 TOMBOL AKSI ====================*/
.popup-ad-content .button {
  display: inline-block;
  width: 100%;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.popup-ad-content .button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.popup-ad-content .button:active {
  transform: scale(0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/*==================== ☑️ CHECKBOX ====================*/
.popup-ad-content input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 0.5rem;
  cursor: pointer;
}

.popup-ad-content label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
}

/*==================== 🎆 EMOJI PETASAN ====================*/
.firework-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.4rem;
}

.emoji-firework {
  font-size: 1.8rem;
  position: relative;
  animation: popExplosion 1.5s ease-in-out infinite;
}

.firework-star {
  position: absolute;
  font-size: 0.7rem;
  opacity: 0;
  color: gold;
  pointer-events: none;
  animation: starBurst 1.5s ease-out infinite;
}

/* Posisi & delay tiap bintang */
.firework-star:nth-child(1) { top: -10px; left: -10px; animation-delay: 0s; }
.firework-star:nth-child(2) { top: -10px; left: 50%; animation-delay: 0.2s; }
.firework-star:nth-child(3) { top: -10px; right: -10px; animation-delay: 0.4s; }
.firework-star:nth-child(4) { bottom: -10px; left: -10px; animation-delay: 0.6s; }
.firework-star:nth-child(5) { bottom: -10px; right: -10px; animation-delay: 0.8s; }

/* 💥 Animasi bintang */
@keyframes starBurst {
  0%   { transform: scale(0.2) translate(0, 0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scale(1.5) translate(20px, -20px); opacity: 0; }
}

/* 🎆 Animasi emoji petasan */
@keyframes popExplosion {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25%      { transform: scale(1.3) rotate(10deg); }
  50%      { transform: scale(1.1) rotate(-10deg); }
  75%      { transform: scale(1.2) rotate(6deg); }
}

/*==================== ✨ ANIMASI MASUK ====================*/
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/*==================== ✅ FORM PEMBAYARAN ====================*/
#payment-modal label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

#payment-modal #btnToPayment {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--first-color);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

#payment-modal #btnToPayment:disabled {
  background: gray;
  cursor: not-allowed;
}


/*==================== 🧠 CHATBOT - TOMBOL PROMO ====================*/
/* Tombol berkilau (utama) dan tombol sekunder */

.option-btn.glow {
  background: linear-gradient(to right, #4facfe, #00f2fe);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 0 10px #00f2feaa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.option-btn.glow:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #00f2fecc;
}

.option-btn.secondary {
  background: #f0f0f0;
  color: #444;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
}

.option-btn.secondary:hover {
  background: #e0e0e0;
  transform: scale(1.02);
}

.bubble .highlight {
  color: #0078ff;
  font-weight: 600;
}

.option-btn:focus,
.popup-close:focus {
  outline: 2px solid var(--first-color);
  outline-offset: 3px;
}

.popup-ad.show {
  animation: fadeInScale 0.4s ease forwards;
}

.animate-text {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

@media (prefers-color-scheme: dark) {
  .popup-ad {
    background-color: #222;
    border-color: #00f2fe;
  }

  .popup-ad h2,
  .popup-ad p,
  .popup-title-text {
    color: #eee;
  }

  .popup-close {
    color: #00f2fe;
  }

  .option-btn.secondary {
    background-color: #333;
    color: #ccc;
    border-color: #444;
  }
}


@media screen and (max-width: 480px) {
  .popup-ad {
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    bottom: 15px;
  }

  .popup-ad-content {
    padding: 1.2rem;
  }

  .popup-ad-content .button,
  #payment-modal #btnToPayment {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }
}
