/* Reset dan Dasar */
body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
}

/* Body untuk Halaman Sampul */
.cover-body {
  background-image: url("../img/background.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #fff;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cover-body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* Batik Desain */
.batik-top, .batik-bottom {
  background: url("../img/batik-pattern.webp") repeat-x;
  height: 100px;
  width: 100%;
}

/* Batik Desain */
.batik-top {
  background: url("../img/batik-pattern.webp") repeat-x;
  height: 150px; /* Tinggi disesuaikan, ubah sesuai ukuran asli gambar */
  width: 100%;
  background-size: auto; /* Menjaga proporsi asli gambar */
  background-position: center; /* Memusatkan pola */
  background-color: #8B4513;
}

.batik-bottom {
  background: url("../img/batik-pattern.webp") repeat-x;
  height: 150px; /* Tinggi disesuaikan, ubah sesuai ukuran asli gambar */
  width: 100%;
  background-size: auto; /* Menjaga proporsi asli gambar */
  background-position: center; /* Memusatkan pola */
  background-color: #5C4033;
  margin-top: auto;
}

/* Ikon Baris */
.icon-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
}

.cover-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

/* Konten Utama */
.cover-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.cover-title {
  font-size: 2rem;
  font-weight: 600;
  color: #FFD700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  margin-bottom: 10px;
}

.cta {
  display: inline-flex;
  padding: 10px 30px;
  font-size: 1.2rem;
  color: #fff;
  background-color: #8B4513;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s;
}

.cta:hover {
  background-color: #A0522D;
}

/* Body untuk Halaman Kamus (Dipertahankan dengan Penambahan Batik) */
.kamus-body {
  background-image: url("../img/batik-pattern.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.kamus-body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: -1;
}

.card {
  margin-bottom: 1.5rem;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.kamus-body .card {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

#results {
  min-height: 50vh;
}

#loader {
  display: none;
  text-align: center;
  padding: 20px;
}

#no-more-results {
  display: none;
  text-align: center;
  padding: 20px;
  color: #6c757d;
}

.wrapper {
  display: flex;
  justify-content: center;
}

.navbar .form-control {
  width: 300px;
}

.site-header {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.site-header .navbar {
  box-shadow: none !important;
}

.a11y-hidden {
  position: absolute;
  left: -1000in;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: polygon(0 0, 0 0);
}

.search {
  width: 100%;
  max-width: none;
  position: relative;
  margin: 0 auto;
}

.search .input-bar {
  align-items: center;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 4rem;
  box-sizing: border-box;
  box-shadow: 0 1rem 2rem -1.5rem rgba(0, 0, 0, 0.3125);
  display: inline-flex;
  height: 4rem;
  overflow: hidden;
  transition: box-shadow 0.5s;
  width: 100%;
}

.search .input-bar:focus-within {
  background: #fffffc;
  border: 2px solid #444;
  box-shadow: 0 1rem 2rem -1.5rem rgba(0, 0, 0, 0.4375);
}

.search .input-bar:hover {
  box-shadow: 0 1rem 2rem -1.5rem rgba(0, 0, 0, 0.4375);
}

.search .input-bar label {
  position: absolute;
  color: #888;
  left: 1.625rem;
  font-family: "Poppins", sans-serif;
  font-size: 1.25rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: calc(100% - 8rem);
  max-width: calc(100% - 8rem);
  display: flex;
  align-items: center;
  z-index: 0;
  pointer-events: none;
}

.search .input-bar label span {
  visibility: hidden;
  overflow: hidden;
  max-width: 0;
  display: inline-block;
  margin: 0 0.125rem;
  transition: max-width 1s, margin 0.125s;
}

.search .input-bar label span.show {
  visibility: visible;
  margin: 0 0.25rem;
  max-width: calc(100% - 8rem);
}

.search .input-bar input {
  background: transparent;
  border: 0;
  box-sizing: border-box;
  flex: 1;
  font-size: 1.25rem;
  margin-left: 0.5rem;
  min-width: 8rem;
  outline: none;
  padding-left: 1rem;
  position: relative;
  z-index: 1;
  font-family: "Poppins", sans-serif;
}

.search .input-bar input::-ms-clear, .search .input-bar input::ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.search .input-bar input::-webkit-search-decoration, .search .input-bar input::-webkit-search-cancel-button, .search .input-bar input::-webkit-search-results-button, .search .input-bar input::-webkit-search-results-decoration {
  display: none;
  width: 0;
  height: 0;
}

.search .input-bar button {
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #444;
  font-size: 1.25rem;
  margin: 0;
  outline: none;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  transition: background-color, color;
  transition-duration: 0.25s;
  box-shadow: 0 0 2rem transparent;
  margin-right: 0.5rem;
}

.search .input-bar button:hover {
  background: #eee;
}

.search .input-bar button:focus {
  background: #444;
  color: #fff;
}

.search .input-bar button:active, .search .input-bar button.active {
  background: #000;
  color: #fff;
}

.search .input-bar button#voiceSearchBtn {
  transform: scale(0);
  transition: transform 0.5s ease-in-out, background-color 0.3s ease-in-out, color 0.3s ease-in-out;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 50%;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
}

.voice-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  z-index: 1050;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.voice-popup p {
  margin: 0;
  font-size: 1.2rem;
  font-family: "Poppins", sans-serif;
}

.search .input-bar button#voiceSearchBtn.show {
  visibility: visible;
  transform: scale(1);
}

.search .input-bar button#voiceSearchBtn.active {
  background-color: #e0e0e0; /* Latar abu-abu saat aktif */
  color: #007bff; /* Ikon biru saat aktif */
  animation: pulse 1.5s infinite; /* Animasi pulsasi sebagai indikator */
}

.search .input-bar button#voiceSearchBtn.active i {
  display: inline; /* Pastikan ikon tetap muncul */
}

.search .input-bar button#voiceSearchBtn.active svg {
  display: block; /* Pastikan SVG tetap muncul jika digunakan */
}

/* Pastikan aturan untuk tombol refresh ada dan spesifik */
.search .input-bar button#refreshBtn {
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: rgb(13,110,253) !important; /* Pastikan warna biru diterapkan */
  font-size: 1.25rem;
  margin: 0;
  outline: none;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  transition: background-color, color;
  transition-duration: 0.25s;
  box-shadow: 0 0 2rem transparent;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center; /* Pastikan ikon berada di tengah */
}

.search .input-bar button#refreshBtn i, .search .input-bar button#refreshBtn .bi-arrow-clockwise { /* Target ikon secara eksplisit */
  color: #007bff !important; /* Pastikan ikon berwarna biru */
}

.search .input-bar button#refreshBtn:hover {
  background: #eee;
}

.search .input-bar button#refreshBtn:hover i, .search .input-bar button#refreshBtn:hover .bi-arrow-clockwise {
  color: #007bff; /* Tetap biru saat hover, ubah jika ingin kontras */
}

.search .input-bar button#refreshBtn:focus {
  background: #444;
  color: #fff !important;
}

.search .input-bar button#refreshBtn:focus i, .search .input-bar button#refreshBtn:focus .bi-arrow-clockwise {
  color: #fff !important; /* Ubah ke putih saat fokus */
}

.search .input-bar button#refreshBtn:active {
  background: #000;
  color: #fff !important;
}

.search .input-bar button#refreshBtn:active i, .search .input-bar button#refreshBtn:active .bi-arrow-clockwise {
  color: #fff !important; /* Ubah ke putih saat aktif */
}

/* Animasi Pulsasi */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

.search .input-bar button#voiceSearchBtn:hover {
  background: #eee;
}

.search .input-bar button#voiceSearchBtn:focus {
  background: #444;
  color: #fff;
}

.search .input-bar button#voiceSearchBtn:active {
  background: #000;
  color: #fff;
}

.search-placeholder {
  transition: height 0.3s ease-in-out;
  height: 0;
}

.search-container {
  z-index: 100;
  position: relative;
}

.search-container.is-sticky {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #f8f9fa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1029;
  margin-top: 0 !important;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.search .input-bar button#voiceSearchBtn.active svg {
  display: block;
}

@media (prefers-reduced-motion) {
  * {
    transition: none !important;
  }
}

.mic-icon {
  width: 1.25rem;
  height: 1.25rem;
  transition: filter 0.25s;
}

body.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

body.fade-in {
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 576px) {
  .navbar .form-control {
    width: 150px;
  }
}

/* Responsif Mobile */
@media (max-width: 768px) {
  .cover-title {
    font-size: 1.8rem;
    margin-top: -100px;
  }

  .cta {
    font-size: 1.2rem;
    padding: 8px 20px;
    margin-top: 40px;
  }

  .icon-row {
    gap: 10px;
  }

  .cover-icon {
    width: 40px;
    height: 40px;
  }
 .batik-top, .batik-bottom {
   height: 60px; /* Sesuaikan dengan kebutuhan mobile */
 }
}

/* Style untuk tombol speaker */
.speaker-btn {
  font-size: 2rem; /* Ukuran cukup besar */
  background-color: transparent;
  border: none;
  color: #007bff; /* Warna biru untuk ikon */
  cursor: pointer;
  transition: color 0.3s, transform 0.3s;
  padding: 2rem;
  border-radius: 50%; /* Box bulat */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto; /* Paling kanan */
  margin-top: auto;
  margin-bottom: auto; /* Tengah secara vertikal */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.speaker-btn:hover {
  color: #0056b3; /* Warna lebih gelap saat hover */
  transform: scale(1.1); /* Efek zoom saat hover */
}

.speaker-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25); /* Fokus ring */
}

.speaker-btn.playing {
  animation: pulse 1.5s infinite; /* Animasi pulsasi saat audio diputar */
}