body {
  font-family: Arial, sans-serif;
  background:#fff;
  color:#202124;
  margin:0;
}

/* === Logo === */
.logo {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 8vw, 4rem);
  text-align: center;
  margin: 40px 0 20px;
  letter-spacing: 4px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  color: inherit;
  white-space: nowrap;
}
.logo span { display: inline-block; }
.logo .n { background: linear-gradient(to bottom, #ffd700, #ff8c00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo .e { background: linear-gradient(to bottom, #1e90ff, #000080); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo .t { background: linear-gradient(to bottom, #00fa9a, #006400); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo .b { background: linear-gradient(to bottom, #9932cc, #4b0082); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo .a { background: linear-gradient(to bottom, #dc143c, #8b0000); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo .h { background: linear-gradient(to bottom, #dcdcdc, #696969); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* === Search Box === */
.search-box {
  max-width:400px; margin:auto; display:flex;
  border:1px solid #dfe1e5; border-radius:50px; padding:5px 10px;
  box-shadow:0 2px 6px rgba(0,0,0,0.1);
}
.search-box input {
  flex:1; border:none; padding:12px 16px;
  font-size:1rem; outline:none;
}
.search-box button {
  border:none; background:#4285f4; color:white;
  padding:0 25px; border-radius:25px;
  cursor:pointer; font-size:1rem;
  transition: background 0.3s;
}
.search-box button:hover { background:#3367d6; }

/* === Tabs === */
.tabs { text-align:center; margin:20px 0; }
.tabs a {
  margin: 0 5px;           /* jarak kiri kanan lebih rapat */
  padding: 4px 10px;       /* kecilkan butang */
  font-size: 0.70rem;      /* kecilkan teks */
  border-radius: 15px;     /* rounded kecil */
}

.tabs a.active { background:#4285f4; color:white; }

/* === Results === */
.results { max-width:800px; margin:20px auto; }
.result-item { padding:15px 0; border-bottom:1px solid #ddd; }
.result-item h5 { margin:0 0 6px; font-size:1rem; }
.result-item h5 a { color:#1a0dab; text-decoration:none; }
.result-item h5 a:hover { text-decoration:underline; }
.url { font-size:0.85rem; color:#006621; margin-bottom:4px; display:block; }
.snippet { font-size:0.9rem; color:#444; margin:5px 0; }
.thumb { max-width:200px; margin:10px 0; border-radius:8px; }
iframe { margin-top:10px; max-width:100%; height:315px; border:none; border-radius:8px; }

/* Results wrapper */
.results {
  max-width: 900px;         /* paparan tak lebih 900px */
  margin: 20px auto;        /* tengah */
  padding: 0 15px;          /* ruang kiri kanan */
  display: flex;
  flex-direction: column;
  align-items: center;      /* semua item ke tengah */
}

/* Result list item */
.results-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-item {
  width: 100%;
  max-width: 650px;         /* ✅ adjustable card size */
  margin: 12px auto;
  padding: 15px 18px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: left;         /* teks tetap rata kiri */
}

.result-item h5 {
  font-size: 1rem;
  margin: 0 0 6px;
  line-height: 1.4;
}

.result-item h5 a {
  color: #1a0dab;
  text-decoration: none;
}

.result-item h5 a:hover {
  text-decoration: underline;
}

.url {
  font-size: 0.85rem;
  color: #006621;
  display: block;
  margin-bottom: 4px;
  word-break: break-word;
}

.snippet {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
}

/* Mobile adjustment */
@media (max-width: 768px) {
  .result-item {
    max-width: 95%;   /* ✅ ikut skrin, tapi masih ada ruang kiri kanan */
    padding: 12px 14px;
  }
}


/* URL + snippet tetap rapi */
.result-item h5, .url, .snippet {
  text-align: left;
}

/* Image grid tengah */
.image-grid, .video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  justify-content: center; /* ✅ grid berada di tengah */
  margin: 20px auto;
  max-width: 900px;
}


/* === Image Grid === */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  max-width: 1000px;
  margin: 20px auto;
}
.image-item { text-align: center; }
.image-item img {
  width: 100%; height: 150px; object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.image-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.image-item p {
  font-size: 0.8rem; margin-top: 6px; color: #444;
}
[data-theme="dark"] .image-item p { color: #bbb; }

/* === Dictionary Section === */
.dict-section {
  max-width: 800px;
  margin: 30px auto;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dict-box {
  display: flex; justify-content: center;
  margin: 0 auto 20px; flex-wrap: wrap;
}
.dict-box input[type="text"] {
  flex: 1; min-width: 200px; max-width: 300px;
  padding: 10px 14px;
  border: 1px solid #dfe1e5;
  border-radius: 25px 0 0 25px;
  font-size: 1rem; outline: none;
}
.dict-box button {
  padding: 10px 18px; border: none;
  background: #4285f4; color: white;
  border-radius: 0 25px 25px 0;
  font-size: 0.95rem; cursor: pointer;
  transition: background 0.3s;
}
.dict-box button:hover { background:#3367d6; }

.dictionary-results {
  max-width: 600px; margin: 0 auto;
  font-size: 0.9rem; line-height: 1.4;
}
.dictionary-results h3 {
  text-align: center; margin-bottom: 6px; font-size: 1.2rem;
  color: #1a0dab;
}
.dictionary-results p { text-align: center; margin: 4px 0; }
.dictionary-results ul { padding-left: 20px; margin: 5px 0; }
.dictionary-results li { margin-bottom: 5px; }

/* === Copy All Button === */
.copy-all { text-align: right; margin: 8px 0 12px; }
.copy-all button {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; color: #4285f4;
}
.copy-all button:hover { color:#3367d6; }

/* === Toast Notification === */
.toast {
  visibility: hidden;
  min-width: 200px;
  background: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: fixed;
  z-index: 9999;
  right: 20px;
  bottom: 20px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.5s, bottom 0.5s;
}
.toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 40px;
}
[data-theme="dark"] .toast {
  background: #e8eaed;
  color: #202124;
}

/* === Mobile Responsive === */
@media screen and (max-width: 600px) {
  .dict-box { flex-direction: column; align-items: center; }
  .dict-box input[type="text"], .dict-box button {
    width: 90%; border-radius: 25px; margin: 5px 0;
  }
}

/* === Pagination === */
.pagination { text-align:center; margin:25px 0; }
.pagination a {
  display:inline-block;
  margin:0 4px;
  padding:6px 12px; border-radius:6px;
  background:#f1f1f1; color:#202124;
  text-decoration:none; font-size:0.9rem;
  transition: all 0.3s ease;
}
.pagination a:hover { background:#4285f4; color:white; }
.pagination a.active { background:#4285f4; color:white; font-weight:bold; }
[data-theme="dark"] .pagination a { background:#303134; color:#e8eaed; }
[data-theme="dark"] .pagination a:hover,
[data-theme="dark"] .pagination a.active { background:#8ab4f8; color:#202124; }

/* === Dark Mode === */
[data-theme="dark"] body { background:#202124; color:#e8eaed; }
[data-theme="dark"] .search-box { background:#303134; border-color:#5f6368; }
[data-theme="dark"] .search-box input { background:#303134; color:#e8eaed; }
[data-theme="dark"] .result-item { border-color:#5f6368; }
[data-theme="dark"] .result-item h5 a { color:#8ab4f8; }
[data-theme="dark"] .url { color:#81c995; }
[data-theme="dark"] .snippet { color:#bdc1c6; }
[data-theme="dark"] .dict-section { background:#303134; color:#e8eaed; }
[data-theme="dark"] .dict-box input[type="text"] { background:#202124; color:#e8eaed; border:1px solid #5f6368; }
[data-theme="dark"] .dict-box button { background:#8ab4f8; color:#202124; }
[data-theme="dark"] .dict-box button:hover { background:#5c9dff; color:#fff; }
[data-theme="dark"] .dictionary-results h3 { color:#8ab4f8; }
[data-theme="dark"] .dictionary-results li { color:#ccc; }

/* === Footer === */
footer {
  text-align:center; padding: 6px 5px; margin-top:20px;
  background:#f5f5f5; font-size:0.75rem; color:#777; line-height:1.4;
}
[data-theme="dark"] footer { background:#121212; color:#888; }
footer a {
  color:#1a0dab; text-decoration:none; margin:0 4px; font-size:0.75rem;
}
[data-theme="dark"] footer a { color:#8ab4f8; }
footer a:hover { text-decoration:underline; }
.controls {
  position: fixed;
  bottom: 80px;
  right: 80px; /* bukan betul-betul di dinding */
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 999;
}
.footer-controls {
  margin-top: 10px;
  display: flex;
  justify-content: center;   /* tengah */
  align-items: center;
  gap: 15px;
}

#google_translate_element {
  position: static !important; /* ikut flow, bukan floating */
}

.theme-toggle {
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  background: #f1f3f4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
  z-index: 10; /* pastikan boleh klik */
}
[data-theme="dark"] .theme-toggle {
  background:#303134;
  color:#e8eaed;
}


[data-theme="dark"] .theme-toggle {
  background:#303134;
  color:#e8eaed;
}
.suggestions-box {
  border: 1px solid #ccc;
  background: #fff;
  position: absolute;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  width: 250px;
}
.suggestions-box div {
  padding: 8px;
  cursor: pointer;
}
.suggestions-box div:hover {
  background: #f0f0f0;
}



