/* Style untuk row */
.rowcard {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around; /* Membuat card memiliki jarak yang merata */
  gap: 20px; /* Jarak antara card */
  padding: 20px; /* Padding untuk row */
}

/* Style untuk card */
.card {
  flex: 1 1 18rem; /* Flex-grow, flex-shrink, dan flex-basis */
  max-width: 25rem; /* Lebar maksimum card */
  border: 1px solid #ddd; /* Border card */
  border-radius: 8px; /* Border radius card */
  overflow: hidden; /* Memastikan gambar tidak keluar dari card */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Shadow untuk card */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Animasi hover */
}

/* Hover effect untuk card */
.card:hover {
  transform: translateY(-5px); /* Mengangkat card sedikit saat hover */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Shadow lebih besar saat hover */
}

/* Style untuk gambar di dalam card */
.card-img-top {
  width: 100%; /* Gambar mengisi lebar card */
  height: auto; /* Tinggi gambar menyesuaikan */
}

/* Style untuk body card */
.card-body {
  padding: 15px; /* Padding untuk body card */
}

/* Style untuk judul card */
.card-title {
  font-size: 1.25rem; /* Ukuran font judul */
  margin-bottom: 10px; /* Jarak bawah judul */
}

/* Style untuk teks card */
.card-text {
  font-size: 0.875rem; /* Ukuran font teks */
  color: #555; /* Warna teks */
  margin-bottom: 15px; /* Jarak bawah teks */
}

/* Style untuk tombol di dalam card */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: #fff;
  background-color: #007bff;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.card-content {
  display: flex;
  flex-direction: column; /* default: vertikal */
  align-items: center; /* tengah secara horizontal */
  gap: 15px;
}

.card-img {
  width: 100%; /* gambar full lebar card */
  height: auto;
  border-radius: 8px;
}

/* Hover effect untuk tombol */
.btn:hover {
  background-color: #0056b3;
}

@media (max-width: 400px) {
  .rowcard {
    /* display: flex; */
    /* flex-direction: column; */
    align-items: center; /* card di tengah horizontal */
    gap: 20px;
    padding: 10px; /* padding dikurangi agar card bisa lebih lebar */
    width: 100%; /* pastikan rowcard lebar penuh */
    box-sizing: border-box; /* agar padding tidak keluar */
  }

  .card {
    /* flex: none; */
    width: 100%; /* supaya card mengisi penuh container */
    max-width: none; /* hilangkan batas max-width */
    margin: 0;
    box-sizing: border-box;
  }
}

/* Awal posisi card sebelum terlihat */
.card {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.3s ease;
}

/* Saat card terlihat di layar */
.card.visible {
  opacity: 1;
  transform: scale(1);
}

/* Hover lebih smooth */
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Stagger animasi biar muncul bergiliran */
.card:nth-child(1) {
  transition-delay: 0s;
}
.card:nth-child(2) {
  transition-delay: 0.1s;
}
.card:nth-child(3) {
  transition-delay: 0.2s;
}
.card:nth-child(4) {
  transition-delay: 0.3s;
}

/* Saat mobile atau layar kecil */
/* Mobile: gambar kiri, teks kanan */
@media (max-width: 600px) {
  .card-content {
    flex-direction: row; /* ubah jadi horizontal */
    align-items: center; /* gambar di tengah vertikal */
  }

  .card-img {
    width: 40%; /* gambar ambil 40% */
    flex-shrink: 0;
  }

  .card-body {
    width: 60%; /* teks ambil 60% */
  }
}

