* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: linear-gradient(to bottom, #0f2027, #132a33, #203a43, #2c5364);
  color: white;
}

/* NAVBAR */
.navbar {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;

  padding: 30px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

/* .nav-logo {
  width: 130px;
  padding-top: 20px;
  position: relative;
  animation:
    floatLogo 5s ease-in-out infinite,
    glowLogo 4s ease-in-out infinite alternate;
  transition: 0.5s ease;
} */

.nav-logo {
  width: 100px;
  height: auto;
  position: static; /* penting */
  padding-top: 0;
  padding-left: 5px;
  animation: none; /* matikan animasi */
  filter: none; /* hilangkan glow */
}

@media (max-width: 768px) {
  .nav-logo {
    width: 50px;
    padding-left: 5px;
  }

  .navbar {
    padding: 15px 20px;
  }
}

/* Floating up-down */
/* @keyframes floatLogo {
  0% {
    transform: translateY(0px) rotateY(0deg);
  }
  50% {
    transform: translateY(-20px) rotateY(8deg);
  }
  100% {
    transform: translateY(0px) rotateY(0deg);
  }
} */

/* Glow breathing effect */
/* @keyframes glowLogo {
  from {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3))
      drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  }
  to {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6))
      drop-shadow(0 0 35px rgba(255, 255, 255, 0.4));
  }
} */

/* Hover effect (lebih cinematic) */
.nav-logo:hover {
  transform: scale(1.1) rotateY(15deg);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.navbar nav a {
  margin-left: 25px;
  text-decoration: none;
  color: white;
  opacity: 0.8;
  transition: 0.3s;
}

.navbar nav a:hover {
  opacity: 1;
}

/* HERO */
/* .hero {
  position: relative;
  height: 80vh;
  background: url("https://picsum.photos/1600/900?blur=1") center/cover
    no-repeat;
  display: flex;
  align-items: center;
  padding: 0 60px;
  overflow: hidden;
  padding-top: 120px; /* agar teks tidak ketutup navbar */
/* } */
*/

/* Background zoom animation */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  animation: zoomHero 20s infinite alternate ease-in-out;
  z-index: -1;
}

@keyframes zoomHero {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2));
}

.hero-content {
  position: relative;
  max-width: 500px;
  animation: fadeUp 1s ease forwards;
  opacity: 1;
  min-height: 45vh; /* jarak titel sehasta atas bawah */
}

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

.hero h1 {
  font-size: clamp(32px, 5vw, 60px);
  margin-bottom: 20px;
}

.hero h2 {
  font-weight: 400;
  opacity: 0.8;
  margin-bottom: 70px;
}

.hero-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 34px;
  letter-spacing: 3px;
  opacity: 0.9;
  padding-top: 40px;
  padding-bottom: 70px;
}

.hero p {
  opacity: 0.8;
  margin-bottom: 25px;
  line-height: 1.6;
}

.hero-buttons button {
  padding: 12px 22px;
  border: none;
  border-radius: 30px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: bold;
}

.btn-primary {
  background: white;
  color: black;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* TRENDING */
.trending {
  padding: 40px 60px;
}

.trending h2 {
  margin-bottom: 20px;
}

/* CARD GRID */
.card-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 kolom */
  gap: 30px;
}

/* Square cards */
.card {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 30px;
  transition: 0.4s ease;
  cursor: pointer;
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  opacity: 0;
}

.card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.card:hover::after {
  opacity: 1;
}

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

/* RESPONSIVE */
@media (max-width: 768px) {
  .navbar {
    padding: 20px;
  }

  .hero {
    padding: 100px 20px 40px 20px; /* ← tambah padding-top besar agar ada ruang setelah navbar */
    min-height: 100vh; /* ubah jadi 100vh biar lebih natural di hp, atau hapus saja */
  }

  .hero-content {
    padding-top: 80px; /* tambahan safety ruang di atas judul Sehasta */
    padding-bottom: 100px; /* tambahan safety ruang di bawah tombol */
    min-height: auto; /* hapus atau ubah biar tidak memaksa tinggi berlebih */
  }

  .trending {
    padding: 0px 10px;
  }
}

@media (max-width: 768px) {
  .card {
    border-radius: 10px; /* ← kotak agak membulat (soft corner), terlihat lebih modern */
    /* atau border-radius: 0;   ← benar-benar persegi / tajam */
    /* atau border-radius: 8px;  ← sangat tipis membulat */
  }

  .card-container {
    grid-template-columns: repeat(
      2,
      1fr
    ); /* bonus: 2 kolom di mobile agar lebih rapi */
    gap: 20px; /* kurangi jarak antar card */
  }

  /* Opsional: agar card tidak terlalu besar di hp */
  .card {
    aspect-ratio: 1 / 1; /* sedikit lebih tinggi dari lebar, kalau mau */
  }
}

/* ============================= */
/* QURAN SECTION */
/* ============================= */

.quran-section {
  padding: 120px 60px;
  position: relative;
  overflow: hidden;
}

.quran-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 34px;
  letter-spacing: 3px;
  opacity: 0.9;
}

/* Slider */
.quran-slider {
  position: relative;
  max-width: 1000px;
  margin: auto;
  min-height: 220px;
}

.quran {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(50px);
  transition: 1s ease;
  text-align: center;
}

.quran.active {
  opacity: 1;
  transform: translateY(0);
}

/* Arabic */
.quran .arabic {
  font-size: clamp(32px, 3vw, 42px);
  line-height: 2;
  margin-bottom: 25px;
  font-weight: 500;
  letter-spacing: 1px;
}

/* Translation */
.quran .translation {
  font-size: 24px;
  opacity: 0.85;
  margin-bottom: 15px;
}

.quran span {
  font-size: 14px;
  opacity: 0.6;
  letter-spacing: 1px;
}

/* Controls */
.quran-controls {
  margin-top: 60px;
  text-align: center;
}

.quran-controls button {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: white;
  padding: 10px 18px;
  margin: 0 10px;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
}

.quran-controls button:hover {
  background: white;
  color: black;
}

.quran-container {
  position: relative;
  z-index: 2;
}

/* ============================= */
/* HADITH SECTION */
/* ============================= */

.hadith-section {
  padding: 100px 60px;

  position: relative;
  overflow: hidden;
}

.hadith-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 34px;
  letter-spacing: 2px;
  opacity: 0.9;
}

/* Slider */
.hadith-slider {
  position: relative;
  max-width: 900px;
  margin: auto;
  min-height: 160px;
}

.hadith {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(40px);
  transition: 0.8s ease;
  text-align: center;
}

.hadith.active {
  opacity: 1;
  transform: translateY(0);
}

.hadith p {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.7;
  margin-bottom: 20px;
  font-weight: 300;
}

.hadith span {
  font-size: 14px;
  opacity: 0.7;
  letter-spacing: 1px;
}

/* Controls */
.hadith-controls {
  margin-top: 50px;
  text-align: center;
}

.hadith-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 10px 18px;
  margin: 0 10px;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
}

.hadith-controls button:hover {
  background: white;
  color: black;
}

/* Floating Light Effect */
.hadith-section::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04),
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatLight 15s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 0;
}

.hadith-container {
  position: relative;
  z-index: 1;
}

@keyframes floatLight {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(100px, 80px);
  }
}

.hero {
  position: relative;
  min-height: 70vh;
  background: url("images/sehasta-header.png") center/cover no-repeat;
  display: flex;
  align-items: center;
  padding: 0 60px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 100%,
    rgba(15, 32, 39, 0.8) 100%,
    #0f2027 100%
  );
  pointer-events: none;
}

/* --------------------------------------------------------------------------------------------------------------- */

/* Modal Overlay Fullscreen */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 39, 0.95); /* gelap sesuai tema gradient body */
  z-index: 2000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  backdrop-filter: blur(8px); /* efek blur cinematic */
  opacity: 0;
  transition: opacity 0.6s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  position: relative;
  max-width: 90%;
  width: 800px;
  background: linear-gradient(
    to bottom,
    rgba(32, 58, 67, 0.9),
    rgba(20, 42, 51, 0.95)
  );
  border-radius: 24px;
  padding: 40px 50px;
  color: #e0e0e0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.7);
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); /* animasi bouncy scale */
}

.modal-overlay.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  font-size: 48px;
  color: #aaa;
  cursor: pointer;
  transition: all 0.3s;
}

.close-modal:hover {
  color: white;
  transform: rotate(90deg);
}

.modal-header {
  text-align: center;
  margin-bottom: 40px;
}

.modal-header h1 {
  font-size: 48px;
  margin-bottom: 8px;
  letter-spacing: 4px;
}

.modal-header h2 {
  font-size: 24px;
  opacity: 0.8;
  font-weight: 300;
}

.modal-body p,
.modal-body li {
  line-height: 1.8;
  font-size: 18px;
  margin-bottom: 20px;
}

.modal-body h3 {
  font-size: 28px;
  margin: 40px 0 20px;
  color: #fff;
  letter-spacing: 1px;
}

.hadith-arabic {
  font-family:
    "Traditional Arabic", "Scheherazade", serif; /* ganti jika punya font arab */
  font-size: 28px;
  line-height: 2.2;
  direction: rtl;
  text-align: right;
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 16px;
  margin: 25px 0;
  border-right: 4px solid #4a90e2;
}

.reference {
  font-style: italic;
  opacity: 0.8;
  text-align: center;
  margin: 20px 0 40px;
}

.closing {
  font-size: 20px;
  text-align: center;
  margin-top: 50px;
  font-weight: bold;
  color: #d4af37; /* gold untuk penutup */
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    padding: 30px 25px;
    max-width: 95%;
  }

  .modal-header h1 {
    font-size: 36px;
  }
  .hadith-arabic {
    font-size: 24px;
  }
}

/* Fix text overflow & wrapping di modal */
.modal-body,
.modal-body p,
.modal-body li,
.modal-body blockquote,
.hadith-arabic {
  overflow-wrap: break-word; /* break kata panjang jika perlu (lebih aman daripada break-all) */
  word-break: break-word; /* fallback untuk browser lama, break di mana saja jika overflow */
  hyphens: auto; /* otomatis tambah hyphen jika bahasa support (opsional, bagus untuk Indo) */
  white-space: normal; /* pastikan spasi & line break normal */
  line-height: 1.8; /* sudah ada, tapi perkuat readability */
}

/* Khusus untuk teks Arab (RTL) agar tidak rusak shaping */
.hadith-arabic {
  font-size: 22px;
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext; /* penting untuk mixed LTR/RTL agar tidak kacau */
  overflow-wrap: anywhere; /* versi modern: break di mana saja tanpa hyphen */
  word-break: normal; /* jangan break-all di Arab, biar shaping huruf tetap bagus */
}

/* Pastikan modal bisa di-scroll jika konten panjang */
.modal-overlay {
  overflow-y: auto; /* sudah ada, tapi konfirmasi */
}

.modal-content {
  max-height: 90vh; /* batasi tinggi agar tidak full screen terlalu tinggi */
  overflow-y: auto; /* scroll vertikal jika teks sangat panjang */
  padding: 40px 50px; /* sudah ada, tapi bisa dikurangi jika perlu */
}

/* Opsional: Tambah ellipsis jika ingin potong dengan ... (bukan wrap) */
.truncate-text {
  /* jika ingin pakai di elemen tertentu */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
