/* ==========================================================
   Beranda bisagratis.com (glassmorphism)
   ========================================================== */

.hub-hero {
  position: relative;
  text-align: center;
  padding: clamp(40px, 8vw, 84px) 16px 18px;
  max-width: 820px;
  margin: 0 auto;
}
.hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 18px;
}
.hub-hero h1 {
  font-size: clamp(32px, 7vw, 60px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.04;
}
.hub-hero h1 span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hub-sub {
  margin: 18px auto 0 !important;
  color: var(--muted);
  font-size: clamp(15.5px, 2.2vw, 18px);
  max-width: 600px;
}
.trust {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: #0F5132;
  font-size: 13.5px;
  font-weight: 600;
}
.trust li .icon { color: var(--brand); }

.search {
  position: relative;
  display: block;
  margin: 30px auto 0;
  max-width: 560px;
}
.search .icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1; /* di atas latar kotak input */
}
.search input {
  width: 100%;
  font-size: 16px;
  padding: 16px 18px 16px 50px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
.search input:focus { outline: 2px solid rgba(16, 185, 129, .45); outline-offset: 2px; }

#sponsor-home {
  max-width: 560px;
  margin: 18px auto 0;
}
#sponsor-home .sponsor-open,
#sponsor-home .sponsor-zone {
  width: 100%;
  margin: 0;
}

.hub-tools { max-width: 1140px; margin: 0 auto; padding: 22px 16px 32px; }
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 2px 16px;
  justify-content: center;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  transition: background .2s, color .2s;
}
.chip:hover { background: rgba(255, 255, 255, .9); }
.chip[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tool-sections { display: flex; flex-direction: column; gap: 26px; }
.tool-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
}
.tool-group-title .icon { width: 18px; height: 18px; color: #7c3aed; }

/* Koleksi (prompt & script) dipisah dari alat */
.hub-koleksi { max-width: 1140px; margin: 0 auto; padding: 22px 16px 0; }
.hub-koleksi[hidden] { display: none; }
.hub-koleksi .tool-group-title { margin-bottom: 4px; font-size: 18px; }
.koleksi-sub { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.hub-tools-title { font-size: 18px; margin-bottom: 4px; }
.hub-tools { border-top: 0; }
@media (min-width: 601px) {
  .hub-koleksi .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hub-koleksi { padding: 14px 16px 0; }
  .koleksi-sub { font-size: 12.5px; }
}

.tool-card.is-ai {
  background: linear-gradient(145deg, rgba(245, 243, 255, .82), rgba(236, 253, 245, .78));
  border-color: rgba(124, 58, 237, .28);
}
.tool-card.is-ai::before {
  background: radial-gradient(circle, rgba(124, 58, 237, .22), transparent 70%);
}
a.tool-card.is-ai:hover {
  border-color: rgba(124, 58, 237, .55);
  box-shadow: 0 22px 44px -18px rgba(124, 58, 237, .35);
}
.tool-card.is-ai .tool-ic {
  background: linear-gradient(135deg, #7c3aed, #0fbf91);
  box-shadow: 0 10px 20px -10px rgba(124, 58, 237, .75);
}
.tool-card .tag-ai {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s;
  overflow: hidden;
}
/* Kilau halus di sudut kartu */
.tool-card::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .18), transparent 70%);
  pointer-events: none;
  transition: opacity .25s;
  opacity: .6;
}
a.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, .45);
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 22px 44px -18px rgba(16, 185, 129, .45);
}
a.tool-card:hover::before { opacity: 1; }
.tool-ic {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(16, 185, 129, .9);
}
.tool-ic .icon { width: 24px; height: 24px; }
.tool-card h3 { font-size: 17px; margin-top: 6px; }
.tool-card p { color: var(--muted); font-size: 13.5px; margin: 0; flex: 1; line-height: 1.55; }
.tool-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 14px;
}
.tool-card .go .icon { transition: transform .2s; }
a.tool-card:hover .go .icon { transform: translateX(3px); }
.tool-card .tag {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .85);
  color: #fff;
}
.tool-card.soon { opacity: .62; }
.tool-card.soon .tool-ic { background: #CBD5E1; box-shadow: none; }
.tool-card.soon .tag { background: rgba(148, 163, 184, .3); color: #475569; }
.tool-card.soon .go { color: var(--muted); }
.empty { text-align: center; padding: 20px 0; }

.hub-why {
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}
.hub-why h2 { font-size: clamp(22px, 3.5vw, 28px); text-align: center; margin-bottom: 18px; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.why-grid > div,
.hub-guides a {
  display: block;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
  color: inherit;
  text-decoration: none;
}
.why-ic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-soft);
  color: var(--brand-dark);
  margin-bottom: 12px;
}
.why-ic .icon { width: 22px; height: 22px; }
.why-grid h3 { font-size: 16px; margin-bottom: 6px; }
.why-grid p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.6; }
.hub-guides a { transition: transform .2s, border-color .2s; }
.hub-guides a:hover { transform: translateY(-3px); border-color: rgba(16, 185, 129, .45); }
.hub-guides h3 { color: var(--brand-dark); }

.chip .chip-n {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: rgba(15, 23, 42, .07); font-size: 11.5px; font-weight: 700; color: #475569;
}
.chip[aria-selected="true"] .chip-n { background: rgba(255, 255, 255, .22); color: inherit; }

/* HP: tampilan ringkas ala aplikasi. Alat tampil 2 kolom supaya lebih banyak terlihat tanpa scroll panjang. */
@media (max-width: 600px) {
  .hub-hero { padding: 20px 16px 6px; }
  .hub-badge { font-size: 12px; padding: 6px 12px; margin-bottom: 12px; }
  .hub-hero h1 { font-size: 30px; }
  .hub-sub { margin-top: 10px !important; font-size: 14.5px; line-height: 1.55; }
  .trust {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 8px;
    margin: 14px -16px 0; padding: 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 30px), transparent 100%);
  }
  .trust::-webkit-scrollbar { display: none; }
  .trust li { flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }
  .search { margin-top: 16px; }
  .search input { padding: 13px 16px 13px 46px; }
  .search .icon { left: 16px; }
  #sponsor-home { margin-top: 12px; }
  #sponsor-home .sponsor-open { padding: 8px 12px; }
  #sponsor-home .sponsor-open > span:not(.sponsor-label):not(.sp-wa) { display: none; }

  .hub-tools { padding: 8px 16px 24px; }
  .tool-sections { gap: 18px; }
  .tool-group-title { font-size: 15px; margin-bottom: 10px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-card { padding: 14px; gap: 6px; border-radius: 16px; }
  .tool-card::before { display: none; }
  .tool-ic { width: 40px; height: 40px; border-radius: 12px; }
  .tool-ic .icon { width: 20px; height: 20px; }
  .tool-card h3 {
    font-size: 14.5px; line-height: 1.3; margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .tool-card p {
    font-size: 12.5px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .tool-card .go { display: none; }
  .tool-grid > .tool-card:only-child { grid-column: 1 / -1; }
  .tool-card .tag { top: 10px; right: 10px; font-size: 10px; padding: 3px 7px; }

  .hub-why { padding: 8px 16px 26px; }
  .hub-why h2 { font-size: 20px; margin-bottom: 12px; }
  .why-grid { grid-template-columns: 1fr; gap: 10px; }
  .why-grid > div, .hub-guides a { padding: 14px 16px; border-radius: 16px; }
  .why-ic { width: 36px; height: 36px; margin-bottom: 8px; }
  /* Panduan: kartu yang digeser ke samping */
  .hub-guides {
    display: flex; overflow-x: auto; gap: 10px; margin: 0 -16px; padding: 2px 16px 10px;
    scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .hub-guides::-webkit-scrollbar { display: none; }
  .hub-guides a { flex: 0 0 78%; scroll-snap-align: start; }
}

@media (max-width: 767px) {
  /* Kategori dibungkus ke beberapa baris: semua terlihat sekaligus, tanpa digeser */
  .chips {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    gap: 5px;
    padding: 4px 0 12px;
  }
  .chip { min-height: 34px; padding: 5px 10px; font-size: 12.5px; white-space: nowrap; }
  .chip .chip-n { margin-left: 4px; padding: 0 5px; font-size: 10.5px; }
}
