/* Reset dan font dasar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: #128C7E;
  line-height: 1.6;
  background-color: #F7F7F7;
}

/* Header */
header {
  background-color: #29A399;
  color: #3a2c1a;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky; /* Membuat header "lengket" */
  top: 0; /* Menempel di bagian paling atas */
  width: 100%;
  z-index: 999; /* Memastikan header di atas konten lain */
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin: auto;
}

/* Mengganti h1 menjadi .logo-container untuk flexbox */
.logo-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container a {
  text-decoration: none;
  color: inherit;
}

.logo-container span {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

nav ul {
  list-style: none;
  display: flex;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 300;
  transition: 0.3s;
}

nav ul li a:hover {
  color: #FFD47F;
}

.hamburger {
  display: none;
  cursor: pointer;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: #F7F7F7;
  transition: all 0.3s ease-in-out;
}

/* Hero Section */
.hero {
  background: url('images/header.png') center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 120px 20px;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(58, 44, 26, 0.5);
}

.hero-content {
  position: relative;
  z-index: 2;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 30px;
  border-radius: 10px;
  display: inline-block;
}

.hero h2 {
  /* Mengembalikan warna h2 di hero section menjadi putih */
  color: #fffaf3;
}

.btn {
  display: inline-block;
  margin-top: 15px;
  background-color: #128C7E;
  color: #fff;
  padding: 10px 25px;
  border-radius: 5px;
  border: none; /* Menghilangkan border */
  text-decoration: none;
  transition: 0.3s;
}

.btn:hover {
  background-color: #29A399;
}

/* Section umum */
section {
  padding: 60px 0;
}

.container {
  width: 90%;
  margin: auto;
  max-width: 1100px;
}

/* Menengahkan konten di dalam section donasi */
.donate .container {
  text-align: center;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #128C7E;
}

/* Program */
.program {
  /* Mengurangi jarak atas dari section sebelumnya */
  padding-top: 0px;
}

.program-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.card {
  background: #D1F297;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card h3 {
  padding: 15px;
  color: #128C7E;
}

.card p {
  padding: 0 15px 20px;
}

/* Mengurangi jarak atas section donasi */
.donate {
  padding-top: 0;
}

/* Form Donasi */
.donate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.donate-form input {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  border: 1px solid #31B1A7;
  border-radius: 5px;
  background-color: #fffaf3;
}

.wa-btn {
  display: inline-block;
  margin-top: 25px;
  background-color: #1DA851;
  color: #fff;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
}

.wa-btn:hover {
  background-color: #128C7E;
}

/* QRIS Section */
.qris-container {
  margin-top: 40px;
}

.qris-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; /* Jarak antara gambar dan tombol */
  margin-top: 15px;
}

.qris-image {
  max-width: 250px; /* Perkecil ukuran gambar */
  width: 100%;
  height: auto;
  /* margin tidak lagi diperlukan di sini */
}

.download-btn {
  background-color: #555; /* Warna berbeda untuk tombol download */
  margin-top: 0; /* Hapus margin atas karena sudah diatur oleh gap */
}

/* Footer */
footer {
  background-color: #29A399;
  color: #fff;
  text-align: center;
  padding: 25px 10px;
  font-size: 0.9em;
  font-weight: 300;
}

footer a {
  color: #fff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: none;
}

/* Promo Popup */
.promo-popup {
    /* Posisi diatur oleh container */
    position: absolute;
    bottom: 0;
    right: 0;
    background: #203D43;
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    max-width: 320px;
    width: calc(100vw - 40px); /* Lebar popup di mobile */
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.promo-popup.show {
    transform: translateY(0);
    opacity: 1;
}

.promo-popup p {
    margin-bottom: 1rem;
    line-height: 1.4;
}

#closePromo {
    background: #DC4E4E;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#closePromo:hover {
    background: #c74242; /* A slightly darker shade of primary */
}

.popup-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.popup-link {
    color: #F8C674;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.popup-link:hover {
    color: white;
    text-decoration: underline;
}

/* Sembunyikan tombol ke atas saat popup promo muncul */
.promo-popup.show + #toTopBtn.show {
    opacity: 0;
    pointer-events: none;
}

.promo-popup p {
    font-size: 14px;
    text-align: center;
}

/* Wadah untuk elemen fixed */
.fixed-elements-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    align-items: flex-start; /* Align items to the start for mobile */
  }

  .logo-container {
    width: 100%;
  }

  .hamburger {
    display: block; /* Show hamburger on mobile */
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  nav {
    position: fixed;
    right: -100%; /* Mulai dari luar layar sebelah kanan */
    top: 59px; /* Sesuaikan dengan tinggi header yang baru */
    gap: 0;
    flex-direction: column;
    background-color: #31B1A7; /* Samakan dengan warna header */
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    z-index: 100; /* Menempatkan navigasi di lapisan paling atas */
  }

  nav.active {
    right: 0; /* Geser masuk dari kanan */
  }

  nav ul {
    flex-direction: column;
    width: 100%;
  }

  nav ul li {
    margin: 16px 0;
  }

  .hero {
    padding: 80px 20px;
  }
}

/* Tombol Scroll to Top */
.to-top-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #29A399; /* Warna sama dengan footer */
  color: #fff; /* Warna panah */
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  z-index: 1000;
}

.to-top-btn.active {
  opacity: 1;
  visibility: visible;
}