/* V2: scoped list layout. The existing theme and detail styles stay in style.css. */
.topbar.sticky {
  position: sticky;
  top: 0;
  z-index: 20; /* Below the existing menu overlay (24) and sidebar (30). */
}

.brand-capsule { flex-shrink: 0; }
.topbar-title { min-width: 0; }
.brand-capsule img.datzon-logo {
  object-fit: cover;
  object-position: center;
  aspect-ratio: 1;
  border-radius: 50%;
  flex-shrink: 0;
}
.footer-logo-row img.datzon-logo {
  object-fit: cover;
  object-position: center;
  aspect-ratio: 1;
  border-radius: 15px;
  flex-shrink: 0;
}

#searchArea { scroll-margin-top: 64px; }
#results {
  --masonry-columns: 1;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
  min-width: 0;
  padding: 14px clamp(10px, 3vw, 26px) 20px;
  overflow-anchor: none;
}

#results.is-masonry { display: block; }
#results.is-masonry > .card { position: absolute; }
#results > .card {
  container-type: inline-size;
  container-name: result-card;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

#results .card-top,
#results .skeleton-card .skeleton-card-top {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) minmax(0, 146px) !important;
  gap: 8px !important;
  padding: 11px 10px 10px;
  align-items: start !important;
}

#results .avatar,
#results .skeleton-card .avatar-skeleton {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

#results .byline { font-size: .75rem; }
#results .byline strong {
  font-size: .8125rem;
  line-height: 1.2 !important;
}
#results .byline small {
  font-size: .75rem;
  line-height: 1.3;
  overflow-wrap: anywhere !important;
}

#results .card .badges,
#results .skeleton-card .skeleton-badges {
  grid-column: auto;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0;
  justify-self: stretch !important;
}

#results .badge-row {
  display: flex;
  flex-wrap: wrap !important;
  gap: 5px;
  width: 100% !important;
  min-width: 0 !important;
  justify-content: flex-end !important;
}

#results .status-badge,
#results .rating,
#results .downloads,
#results .version-badge {
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 27px;
  padding: 5px 7px;
  gap: 4px;
  font-size: .75rem;
  line-height: 1.2;
  border-radius: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#results .badges svg { width: 12px; height: 12px; flex: 0 0 12px; }
#results .badge-skeleton { height: 27px; max-width: 100%; }
#results .badge-skeleton.small { width: 45px; }
#results .badge-skeleton.medium { width: 70px; }
#results .badge-skeleton.wide { width: 80px; }

#results .thumb-wrap,
#results .thumb { width: 100%; min-width: 0; max-width: 100%; }
#results .thumb { height: auto; aspect-ratio: 16 / 9; }
#results .type-badge {
  right: 9px;
  bottom: 9px;
  max-width: calc(100% - 18px);
  font-size: .75rem;
  padding: 5px 8px;
  overflow-wrap: anywhere;
}
#results .card-body { min-width: 0; padding: 11px 12px 13px; }
#results .tags { gap: 5px; margin-bottom: 9px; }
#results .tags span { max-width: 100%; font-size: .75rem; padding: 3px 7px; }
#results .tags span,
#results .card h3,
#results .card p { overflow-wrap: anywhere; word-break: normal; }
#results .card h3 { font-size: clamp(1rem, .85rem + .7vw, 1.0625rem); line-height: 1.25; }
#results .card p { font-size: .8125rem; line-height: 1.5; margin-bottom: 12px; }
#results .download-card-btn { width: 100%; min-height: 40px; font-size: .8125rem; }

/* At narrow card widths metadata moves to a compact wrapping row. */
@container result-card (max-width: 330px) {
  #results .card-top,
  #results .skeleton-card .skeleton-card-top {
    grid-template-columns: 32px minmax(0, 1fr) !important;
  }
  #results .card .badges,
  #results .skeleton-card .skeleton-badges {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  #results .badge-row { display: contents; }
}

@media (min-width: 760px) {
  #results { --masonry-columns: 2; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (min-width: 1100px) {
  #results { --masonry-columns: 3; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (min-width: 1440px) {
  #results { --masonry-columns: 4; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* Safe one-column metadata fallback on browsers without container queries. */
@supports not (container-type: inline-size) {
  #results .card-top { grid-template-columns: 32px minmax(0, 1fr) !important; }
  #results .card .badges { grid-column: 1 / -1; display: flex !important; flex-wrap: wrap; }
  #results .badge-row { display: contents; }
}

.load-more { padding: 0 16px 26px; text-align: center; }
.load-more .btn { min-height: 44px; min-width: min(100%, 210px); font-size: .875rem; }
.load-more [hidden] { display: none !important; }
.load-more button:disabled { cursor: wait; opacity: .7; }
.load-more p { margin: 12px 0 0; font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.load-more p:empty { display: none; }
.restoring-view { scroll-behavior: auto !important; }
#results .restored-card { opacity: 1; transform: none; animation: none; }
@media (prefers-reduced-motion: reduce) {
  #results .card.revealable { opacity: 1; transform: none; animation: none; }
}

/* V2 keyword autocomplete — pure text, tanpa thumbnail/metadata. */
.search-suggest-wrap {
  position: relative;
  z-index: 12;
  max-width: 780px;
  margin: 0 auto;
}
.search-suggest-wrap .search-bar {
  width: 100%;
  max-width: none;
  margin: 0;
}
.search-suggestion-panel {
  display: none;
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(390px, 48vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 7px;
  border: 1px solid rgba(28, 34, 42, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.985);

  overscroll-behavior: contain;
}
.search-suggestion-panel.show { display: block; }
.search-suggestion-row {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #20262f;
  display: flex;
  align-items: center;
  padding: 10px 13px;
  text-align: left;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggestion-row:hover,
.search-suggestion-row:focus-visible,
.search-suggestion-row.is-active {
  background: rgba(38, 179, 27, 0.10);
  color: #14870c;
  outline: none;
}
html[data-theme="dark"] .search-suggestion-panel {
  border-color: rgba(255,255,255,.12);
  background: rgba(23, 27, 33, 0.985);

}
html[data-theme="dark"] .search-suggestion-row { color: #f4f6f7; }
html[data-theme="dark"] .search-suggestion-row:hover,
html[data-theme="dark"] .search-suggestion-row:focus-visible,
html[data-theme="dark"] .search-suggestion-row.is-active {
  background: rgba(61, 207, 49, 0.13);
  color: #7ee174;
}
@media (max-width: 760px) {
  .search-suggest-wrap { max-width: 100%; }
  .search-suggestion-panel {
    top: calc(100% + 7px);
    max-height: 43vh;
    border-radius: 14px;
    padding: 6px;
  }
  .search-suggestion-row {
    min-height: 44px;
    padding: 9px 12px;
    font-size: 14px;
  }
}


/* === V2.2 autocomplete/history layout fix === */
/* Suggestion panel boleh melewati batas hero; ini memperbaiki daftar yang dulu kepotong oleh section Results. */
.hero { overflow: visible !important; }
.search-suggest-wrap { z-index: 120; }
.library { z-index: 2; }

.search-suggestion-panel {
  z-index: 180;
  max-height: min(510px, 58dvh);
  padding: 7px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.search-history-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 6px;
  color: #747c87;
  font-size: 12px;
  font-weight: 700;
}
.search-history-head button {
  border: 0;
  background: transparent;
  color: #178f10;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 5px 3px;
}

.search-suggestion-entry {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.search-suggestion-entry + .search-suggestion-entry {
  border-top: 1px solid rgba(30, 41, 59, 0.055);
}
.search-suggestion-row {
  min-height: 44px;
  padding: 9px 13px;
  padding-right: 13px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.3;
}
.search-suggestion-entry.is-history .search-suggestion-row {
  padding-right: 44px;
}
.search-history-remove {
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8b949f;
  font: 700 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
.search-history-remove:hover,
.search-history-remove:focus-visible {
  color: #15830e;
  background: rgba(38, 179, 27, 0.09);
  outline: none;
}

html[data-theme="dark"] .search-history-head { color: #aab2bd; }
html[data-theme="dark"] .search-history-head button { color: #7ee174; }
html[data-theme="dark"] .search-suggestion-entry + .search-suggestion-entry { border-top-color: rgba(255,255,255,.055); }
html[data-theme="dark"] .search-history-remove { color: #98a1ad; }

/* Footer: Datzon dibuat kotak rounded, sama bahasa bentuknya dengan logo MCPEDL. */
.footer-logo-row img,
.footer-logo-row img.datzon-logo {
  width: 54px;
  height: 54px;
  border-radius: 15px !important;
  object-fit: cover !important;
  object-position: center;
}

@media (max-width: 760px) {
  .search-suggestion-panel {
    top: calc(100% + 7px);
    max-height: min(490px, 58dvh);
    border-radius: 15px;
    padding: 6px;
  }
  .search-suggestion-row {
    min-height: 43px;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.25;
  }
  .search-suggestion-entry.is-history .search-suggestion-row { padding-right: 42px; }
  .search-history-head { padding-inline: 7px; }
  .footer-logo-row img,
  .footer-logo-row img.datzon-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px !important;
  }
}


/* === V2.2.3 interaction + stacking fixes === */
/* Header/sidebar harus selalu berada di atas kolom search saat halaman digulir. */
.topbar.sticky {
  z-index: 500 !important;
}
.menu-overlay {
  z-index: 700 !important;
}
.side-menu {
  z-index: 800 !important;
}
.search-suggest-wrap {
  z-index: 100 !important;
}
.search-suggestion-panel {
  z-index: 120 !important;
}

/* Target scroll setelah submit: langsung dekat item, tetap tidak ketutup header sticky. */
#results {
  scroll-margin-top: 76px;
}

/* Status feed: dot dan kalimat benar-benar satu garis/center, termasuk saat teks membungkus. */
.status {
  justify-content: center !important;
  align-items: center !important;
  min-height: 62px;
  gap: 14px !important;
  text-align: left;
  line-height: 1.38;
}
.status > span:first-child {
  width: 10px !important;
  height: 10px !important;
  flex: 0 0 10px !important;
  margin: 0 !important;
  align-self: center;

}

/* Badge tipe di You may also like: tipe mengikuti item masing-masing dan tetap rapi. */
.related-card .related-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 28px);
  min-height: 30px;
  margin: 10px 14px 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

@media (max-width: 760px) {
  #results { scroll-margin-top: 66px; }
  .status {
    min-height: 58px;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    gap: 13px !important;
  }
}


/* === V2.2.4 status + related-card polish === */
.status {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  text-align: left !important;
  line-height: 1.35 !important;
}

.status > .status-dot {
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  flex: 0 0 10px !important;
  display: inline-block !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: var(--green-2) !important;

  animation: none;
}

.status > .status-message {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;

  animation: none !important;
  color: inherit !important;
  text-align: left !important;
}

/* Related cards: badge sejajar persis dengan awal judul, tidak menempel border kartu. */
.related-card .related-type {
  align-self: flex-start !important;
  width: max-content !important;
  max-width: calc(100% - 24px) !important;
  margin: 10px 12px 0 !important;
  padding: 5px 9px !important;
  box-sizing: border-box !important;
}

.related-card > strong {
  padding: 0 12px 14px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px) {
  .status {
    gap: 8px !important;
  }
  .status > .status-dot {
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    flex-basis: 9px !important;

  }
  .related-card .related-type {
    margin-left: 12px !important;
    margin-right: 12px !important;
  }
}


/* === V2.2.6 FINAL PERFORMANCE PROFILE ===
   OFF permanently: blur/filter, large shadows, card motion, dot pulse, sticky topbar.
   ON permanently: decorative backgrounds, content images, full card volume, smooth scroll.
*/
.card,
.card *,
.related-card,
.related-card *,
.skeleton,
.skeleton-card {
  animation: none !important;
  transition: none !important;
}

.card,
.card.revealable,
.card.revealable.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

.card:hover,
.related-card:hover {
  transform: none !important;
}

.status-dot,
.status > .status-dot {
  animation: none !important;
  transform: none !important;
}

.topbar.sticky {
  position: relative !important;
  top: auto !important;
}

/* === V2.3.0 WEBSITE SIDEBAR + ALWAYS-VISIBLE HEADER === */
/* V2.2.6 mematikan sticky header demi performa. Diaktifkan lagi sesuai update V2.3.0. */
.topbar.sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 500 !important;
}

/* Website accordion mengikuti pola Addons/Maps, tetapi memakai item berikon seperti Activation Center. */
.side-category .side-category-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #9ba5b4;
}

.side-group.open > .website-category .side-category-icon {
  color: var(--green-2);
}

.side-keywords.website-links {
  padding: 0;
}

.side-keywords.website-links > .side-website-link {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 5px 14px 5px 30px;
  border: 0;
  border-left: 1px solid rgba(34, 179, 19, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
  color: #c8d0dc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.side-keywords.website-links > .side-website-link:first-child {
  margin-top: 4px;
}

.side-keywords.website-links > .side-website-link:last-child {
  margin-bottom: 10px;
  border-bottom: 0;
}

.side-keywords.website-links > .side-website-link:hover,
.side-keywords.website-links > .side-website-link:focus-visible {
  background: rgba(34, 179, 19, 0.08);
  color: #fff;
  outline: none;
}

.website-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(34, 179, 19, 0.14);
  color: #88d77e;
}

.website-link-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.website-link-icon svg.website-icon-fill {
  fill: currentColor;
  stroke: none;
}

.website-link-chevron {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #7f8998;
  transition: transform .18s ease, color .18s ease;
}

.side-website-link:hover .website-link-chevron,
.side-website-link:focus-visible .website-link-chevron {
  color: var(--green-2);
  transform: translateX(2px);
}

html[data-theme="light"] .side-category .side-category-icon {
  color: #536070 !important;
  stroke: currentColor !important;
}

html[data-theme="light"] .side-group.open > .website-category .side-category-icon {
  color: #167a08 !important;
}

html[data-theme="light"] .side-keywords.website-links > .side-website-link {
  color: #273241 !important;
  background: transparent !important;
  border-left-color: rgba(34, 179, 19, 0.34) !important;
  border-bottom-color: rgba(15, 23, 42, 0.055) !important;
}

html[data-theme="light"] .side-keywords.website-links > .side-website-link:hover,
html[data-theme="light"] .side-keywords.website-links > .side-website-link:focus-visible {
  color: #0f3b10 !important;
  background: rgba(34, 179, 19, 0.10) !important;
}

html[data-theme="light"] .website-link-icon {
  background: rgba(22, 122, 8, 0.12);
  color: #167a08;
}

html[data-theme="light"] .website-link-chevron {
  color: #687384;
}

@media (max-width: 760px) {
  .side-keywords.website-links > .side-website-link {
    min-height: 47px;
    padding-left: 28px;
  }
}


/* === V2.3.1 SIDEBAR CATEGORY ICONS + GLOBAL FOOTER/HEADER SYNC === */
/* Semua kategori utama memakai ikon SVG. Submenu tetap teks agar sidebar tidak jadi pohon Natal. */
.side-group.open > .side-category .side-category-icon {
  color: var(--green-2);
}

/* WhatsApp footer memakai glyph yang sama dengan Contact Person, tanpa kotak hijau. */
.footer-socials svg.footer-icon-fill {
  width: 22px;
  height: 22px;
  fill: currentColor !important;
  stroke: none !important;
}
.footer-socials svg.footer-icon-fill path {
  fill: currentColor !important;
  stroke: none !important;
}

/* Pastikan header Home, Detail, Privacy, Terms, About dan Contact tetap terlihat saat scroll. */
.topbar.sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 500 !important;
}

html[data-theme="light"] .side-group.open > .side-category .side-category-icon {
  color: #167a08 !important;
}
html[data-theme="light"] .footer-socials svg.footer-icon-fill,
html[data-theme="light"] .footer-socials svg.footer-icon-fill path {
  fill: currentColor !important;
  stroke: none !important;
}
