/* --- FONT IMPORT --- */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Amiri:wght@700&display=swap");

/* --- THEME COLOR VARIABLES --- */
:root {
  --bg-color: #f8f5f2; /* Lighter, elegant off-white */
  --card-bg-color: #ffffff;
  --text-color: #2c2c2c; /* Softer black */
  --secondary-text-color: #7a7a7a;
  --accent-color: #c08261; /* Warna aksen coklat kayu */
  --border-color: #ebebeb;
  --shadow-color: rgba(99, 83, 60, 0.1);
}

body.dark-mode {
  --bg-color: #121212; /* Charcoal black */
  --card-bg-color: #1e1e1e;
  --text-color: #ccd6f6;
  --secondary-text-color: #8892b0;
  --accent-color: #64ffda; /* Mint Green / Cyan cerah */
  --border-color: #2a2a2a;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

/* --- ✨ ANIMATIONS ✨ --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate {
  opacity: 0; /* Mulai dari transparan */
  animation-fill-mode: forwards; /* Tetap di state akhir animasi */
}

.fade-in-up {
  animation-name: fadeInUp;
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
}
.fade-in-down {
  animation-name: fadeInDown;
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
}

/* --- GLOBAL STYLES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.7;
}

/* --- LANDING PAGE STYLES (index.html) --- */
/* (Tidak ada perubahan di bagian ini, sama seperti sebelumnya) */
.landing-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  padding: 20px;
}
.content-wrapper {
  max-width: 600px;
}
.landing-open {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0px;
}
.landing-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 10px;
}
.landing-subtitle {
  font-size: 1.5rem;
  color: var(--secondary-text-color);
  margin-bottom: 8px;
}
.landing-quote{
  font-size: 0.8rem;
  color: var(--secondary-text-color);
  margin-bottom: 25px;

}

.landing-form input {
  width: 100%;
  padding: 15px 20px;
  font-size: 0.8rem;
  border-radius: 50px;
  border: 2px solid var(--border-color);
  background-color: var(--card-bg-color);
  color: var(--text-color);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.landing-form input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 20%, transparent);
}
.cta-button {
  padding: 15px 40px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--card-bg-color);
  background-color: var(--accent-color);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px
    color-mix(in srgb, var(--accent-color) 30%, transparent);
}


/* --- QURAN PAGE STYLES (quran.html) --- */
.container {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 20px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}
.app-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 5px;
  font-family: "Amiri", serif;
}
.subtitle-wrapper {
  margin-top: 5px;
}
.user-greeting {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--accent-color);
  margin: 0;
}
.app-subtitle {
  font-size: 0.7rem;
  color: var(--secondary-text-color);
  margin-top: 4px;
  font-style: italic;
}
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input {
  display: none;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent-color);
}
input:checked + .slider:before {
  transform: translateX(24px);
}
.selection-box,
.surah-info-card,
.ayat-card {
  background-color: var(--card-bg-color);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 8px 30px var(--shadow-color);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
  transition: background-color 0.4s, border-color 0.4s;
}
#filter-surah-input {
  width: 100%;
  padding: 15px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}
#filter-surah-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 20%, transparent);
}
.search-results {
  display: none; /* Sembunyi secara default */
  position: absolute;
  top: 110%; /* Muncul di bawah search bar */
  left: 0;
  right: 0;
  background-color: var(--card-bg-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 20px var(--shadow-color);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
}
.result-item {
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}
.result-item:last-child {
  border-bottom: none;
}
.result-item:hover {
  background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
}
.result-item .arti-preview {
  font-size: 12px;
  color: var(--secondary-text-color);
  margin-left: 5px;
}

/* --- SURAH GRID STYLES (ELEGANT) --- */
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.surah-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background-color: var(--card-bg-color);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--shadow-color);
}
.surah-list-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent-color);
  box-shadow: 0 8px 25px color-mix(in srgb, var(--accent-color) 20%, transparent);
}
.surah-card-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.surah-number-icon {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
  border-radius: 10px;
  transition: background-color 0.4s;
}
.surah-number-icon span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-color);
  transition: color 0.4s;
}
.surah-name {
  font-weight: 600;
}
.surah-translation {
  font-size: 0.8rem;
  color: var(--secondary-text-color);
}
.surah-arabic-name {
  font-family: "Amiri", serif;
  font-size: 1.4rem;
  color: var(--accent-color);
}

.loader {
  display: none;
  margin: 40px auto;
  border: 5px solid var(--border-color);
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.surah-info-card {
  border-left: 5px solid var(--accent-color);
}
.surah-info-card h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}
.surah-info-card .arti {
  font-size: 14px;
  color: var(--secondary-text-color);
  font-style: italic;
}
.surah-info-card .deskripsi {
  margin-top: 11px;
  padding-top: 15px;
  font-size: 14px;
  border-top: 1px solid var(--border-color);
}
.ayat-search-form {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}
.ayat-search-form input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
}
.ayat-search-form button {
  padding: 8px 20px;
  border: none;
  background-color: var(--accent-color);
  color: var(--card-bg-color);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.ayat-search-form button:hover {
  opacity: 0.85;
}
.ayat-card {
  padding: 20px;
}
.ayat-header {
  background-color: color-mix(in srgb, var(--accent-color) 10%, transparent);
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--accent-color);
  display: inline-block;
  margin-bottom: 20px;
}
.ayat-ar {
  font-family: "Amiri", serif;
  font-size: 1.6rem;
  text-align: right;
  line-height: 2.2;
  margin-bottom: 20px;
}
.ayat-tr {
  font-style: italic;
  font-size: 13px;
  color: var(--secondary-text-color);
  margin-bottom: 8px;
}
.ayat-idn {
  color: var(--text-color);
  font-size: 14px;
}

/* --- BACK BUTTON --- */
.back-button {
  display: block;
  width: 100%;
  padding: 15px;
  margin-bottom: 30px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--card-bg-color);
  background-color: var(--accent-color);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* --- STYLE UNTUK AYAT YANG DISOROT --- */
.ayat-card.highlight {
  border-color: var(--accent-color);
  box-shadow: 0 0 15px color-mix(in srgb, var(--accent-color) 25%, transparent);
  transform: scale(1.02);
  transition: all 0.4s ease-in-out;
}
