/* Pastikan semua elemen gunakan Poppins */
* {
  font-family: 'Poppins', sans-serif !important;
  box-sizing: border-box;
}

/* Tema warna */
:root {
  --utama:#00695c;        /* hijau teal profesional */
  --utama-hover:#004d40;  /* hover hijau pekat */
  --aksen:#1976d2;        /* biru KPM */
  --bg-gradient:linear-gradient(135deg, #004d40, #00695c, #1976d2);
  --border:#d9e2ec;
  --text:#2f3e46;
}

/* Pusatkan layout */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 20px;
}
.header img {
  display: block;
  margin: 0 auto 12px;
  width: 90px;
}
.header h1 {
  color: #ffffff;              /* putih terang */
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.35); /* bagi timbul */
}
.header h3 {
  color: #e3f2fd;              /* biru lembut */
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}


/* Container */
.container {
  max-width: 680px;
  width: 100%;
  padding: 20px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  border-radius: 12px;
  border: 1.5px solid var(--border);
}

/* Grid */
.baris {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width:640px) {
  .baris { grid-template-columns: 1fr 1fr; }
}

/* Kotak input */
.kotak {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--utama);
  margin-bottom: 6px;
  text-transform: uppercase;
}
input[type="search"], select {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #d0d0d0;
  border-radius: 10px;
  outline: none;
  font-size: 15px;
  background: #fff;
}
select option { font-family: 'Poppins', sans-serif !important; }
input[type="search"]:focus, select:focus {
  border-color: var(--utama);
  box-shadow: 0 0 0 3px var(--border);
}

/* Butang */
.actions { display: flex; gap: 8px; margin-top: 8px; }
.btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
  background: #f9f9f9;
  color: var(--utama);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: #f1f1f1; }

.btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: var(--utama);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: background .3s ease;
}
.btn-primary:hover { background: var(--utama-hover); }

/* Hasil carian */
.selected-hadis {
  margin-top: 12px;
  padding: 12px;
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
}
.hasil {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  font-size: 14px;
}
.chip b { color: var(--aksen); }
.chip button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d0d0d0;
  background: #f4fdf5;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--utama);
}
.chip button:hover { background: #e8f5e9; }

/* Footer */
footer {
  text-align: center;
  margin-top: 24px;
  color: #eee;
  font-size: 13px;
}
footer .counter { margin-top: 8px; font-size: 12px; }
footer .counter a {
  text-decoration: none;
  color: #ccc;
  font-weight: 600;
}
.mini { font-size: 12px; color: #cfd8dc; margin-top: 6px; }

/* Popup Sambutan */
.popup {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.popup-content {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: fadeIn .4s ease;
}
.popup-content h2 {
  margin: 0 0 10px;
  color: var(--utama);
  font-weight: 700;
}
.popup-content p {
  margin: 0 0 16px;
  font-size: 15px;
  color: #444;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* 📱 Mobile */
@media (max-width: 480px) {
  body { padding: 10px; }
  .container { padding: 12px; border-width: 1.5px; }
  .header img { width: 70px; }
  .header h1 { font-size: 18px; }
  .header h3 { font-size: 12px; }
  label { font-size: 11px; }
  input[type="search"], select { font-size: 14px; padding: 10px; }
  .btn, .btn-primary { font-size: 14px; padding: 10px; }
  .selected-hadis { font-size: 14px; padding: 10px; }
  .chip { font-size: 13px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .chip button { width: 100%; }
}

/* Kontena paparan PDF */
.viewer {
  max-width: 980px;
  width: 100%;
  margin-top: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  padding: 14px;
}
.viewer h4 { margin: 0 0 10px; color: var(--utama); font-weight: 700; }
.viewer iframe {
  width: 100%;
  height: 70vh;
  border: 0;
  border-radius: 10px;
  background: #000; /* ketika loading */
}
.viewer-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

@media (max-width: 480px) { .viewer iframe { height: 60vh; } }


