@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Poppins:wght@400;500&display=swap");

:root {
  --bg-dark: #0f172a;
  --text-light: #f9fafb;
  --card-bg: #1f2937;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --price-strike: #9ca3af;
  --label-free: #22c55e;
  --label-discount: #ef4444;
  --shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: 2.2rem;
  font-weight: 700;
  margin: 20px 0 30px;
  color: var(--text-light);
}

/* Container & Grid */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.ebook-grid {
  display: grid;
  grid-template-columns: 1fr; /* Default HP: 1 kolom */
  gap: 24px;
  justify-items: center;
}

/* Tablet: 2 kolom */
@media (min-width: 600px) {
  .ebook-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 kolom */
@media (min-width: 992px) {
  .ebook-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* eBook Card */
.ebook-card {
  width: 100%;
  max-width: 320px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ebook-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.ebook-thumb {
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  background-color: #1e293b; /* gelap, biar pas dengan dark mode */
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 8px;
}

.ebook-card:hover .ebook-thumb {
  transform: scale(1.02);
}

.ebook-content {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ebook-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-light);
}

.ebook-desc {
  font-size: 0.65rem;
  line-height: 1.4;
  color: #d1d5db; /* abu terang tapi lembut */
  margin: 6px 0 10px;
  font-weight: 400;
}

.ebook-price {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.price-strike {
  text-decoration: line-through;
  color: var(--price-strike);
  margin-right: 6px;
}

.ebook-labels {
  margin-bottom: 10px;
}

.label {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: white;
}

.label.free {
  background-color: var(--label-free);
}

.label.discount {
  background-color: var(--label-discount);
}

/* Button */
.btn-beli {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-beli:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Animasi */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInItem 1s forwards;
}

@keyframes fadeInItem {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-delay-1 {
  animation-delay: 0.2s;
}
.fade-delay-2 {
  animation-delay: 0.4s;
}
.fade-delay-3 {
  animation-delay: 0.6s;
}
.fade-delay-4 {
  animation-delay: 0.8s;
}
.fade-delay-5 {
  animation-delay: 1s;
}
.fade-delay-6 {
  animation-delay: 1.2s;
}

/* Responsive */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .ebook-price {
    font-size: 15px;
  }

  .btn-beli {
    font-size: 0.95rem;
    padding: 10px;
  }

  .ebook-title {
    font-size: 18px;
  }
}

.social-icons {
  margin-top: 30px;
}
.social-icons a {
  margin: 0 10px;
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s;
}
.social-icons img {
  width: 24px;
  height: 24px;
  opacity: 0.7;
  transition: all 0.3s ease;
}
.social-icons a:hover {
  transform: scale(1.2);
  opacity: 1;
}
.footer {
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--footer-color);
}

/* Tambahan styling untuk halaman baca ebook dan formulir */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.ebook-page {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.cta-box {
  background: var(--card-bg);
  padding: 24px;
  text-align: center;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.cta-box h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--text-light);
}

.btn-beli.cta {
  width: auto;
  display: inline-block;
  padding: 12px 24px;
  margin-top: 12px;
}

/* Input form styling */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"] {
  padding: 1rem;
  border-radius: 10px;
  border: none;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  margin-bottom: 1rem;
  font-size: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
/* Untuk layar HP (kurang dari 480px) */
@media (max-width: 480px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"] {
    max-width: 100%;
  }
}

/* Placeholder style */
input::placeholder {
  color: #aaa;
  font-size: 0.95rem;
}

/* Tombol submit di dalam form */
form button[type="submit"] {
  background-color: var(--primary);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

form button[type="submit"]:hover {
  background-color: var(--primary-hover);
}

/* Centered image style */
.center-image {
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  display: block;
}

.disclaimer {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text-light);
}
