/* ============ Alat Tanpa Daftar — styles.css ============ */
/* Web3 aesthetic: mesh gradient, glassmorphism, dark default + light mode, mobile-first */

:root {
  --bg: #0b1220;
  --bg-soft: rgba(255, 255, 255, 0.04);
  --card: rgba(255, 255, 255, 0.05);
  --card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e8eefc;
  --text-dim: #93a0c0;
  --text-faint: #5d6b8f;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-grad: linear-gradient(135deg, #38bdf8, #818cf8);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --glow: 0 0 40px rgba(56, 189, 248, 0.15);
}

[data-theme="light"] {
  --bg: #eef4fb;
  --bg-soft: rgba(11, 18, 32, 0.03);
  --card: rgba(255, 255, 255, 0.75);
  --card-hover: rgba(255, 255, 255, 0.95);
  --border: rgba(11, 18, 32, 0.1);
  --border-strong: rgba(11, 18, 32, 0.2);
  --text: #0f1c33;
  --text-dim: #43547a;
  --text-faint: #7a88ab;
  --shadow: 0 8px 28px rgba(30, 60, 120, 0.12);
  --glow: 0 0 30px rgba(56, 189, 248, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Blob mesh background */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 12% 8%, rgba(56, 189, 248, 0.16), transparent 70%),
    radial-gradient(38% 34% at 88% 14%, rgba(129, 140, 248, 0.14), transparent 70%),
    radial-gradient(50% 46% at 50% 100%, rgba(14, 165, 233, 0.10), transparent 72%),
    var(--bg);
}

[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(42% 38% at 12% 8%, rgba(56, 189, 248, 0.22), transparent 70%),
    radial-gradient(38% 34% at 88% 14%, rgba(129, 140, 248, 0.18), transparent 70%),
    radial-gradient(50% 46% at 50% 100%, rgba(14, 165, 233, 0.14), transparent 72%),
    var(--bg);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: 0.2px; }
.brand-text small { font-size: 11px; color: var(--text-faint); letter-spacing: 1px; text-transform: uppercase; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }

[data-theme="dark"] .ic-sun { display: inline; }
[data-theme="dark"] .ic-moon { display: none; }
[data-theme="light"] .ic-sun { display: none; }
[data-theme="light"] .ic-moon { display: inline; }

/* ============ Hero ============ */
.hero { padding: 44px 0 26px; text-align: center; }

.hero h1 {
  font-size: clamp(26px, 5.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.18;
  margin-bottom: 12px;
}

.grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto 24px;
}

.hero-sub b { color: var(--text); }

/* Search */
.search-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto 16px;
}

.search-wrap input {
  width: 100%;
  padding: 14px 46px 14px 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18), var(--glow);
}

.search-wrap input::placeholder { color: var(--text-faint); }

.search-ic {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.7;
  pointer-events: none;
}

.btn-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  display: none;
}

.btn-clear.visible { display: grid; place-items: center; }

.hero-stats {
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.3px;
}

.hero-stats span { color: var(--text-dim); font-weight: 600; }

/* ============ Kategori ============ */
.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 14px;
  margin: 0 -16px;
  scrollbar-width: none;
  justify-content: flex-start;
}

.cats::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

.cat-chip:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }

.cat-chip.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  font-weight: 600;
}

/* ============ Toolbar ============ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 16px;
}

.result-count { font-size: 13px; color: var(--text-faint); }

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.sort-wrap select {
  padding: 8px 30px 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2393a0c0' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ============ Grid & Kartu ============ */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-bottom: 40px;
}

@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  background: var(--card-hover);
}

.card:hover::before { opacity: 0.06; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-transform: uppercase;
}

.card-badge.hot { background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(129,140,248,0.18)); color: var(--accent); border-color: rgba(56,189,248,0.3); }

.card-desc {
  font-size: 13px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: auto;
  flex-wrap: wrap;
}

.card-meta .meta-item { display: inline-flex; align-items: center; gap: 3px; }

.card-meta .stars { color: #fbbf24; font-weight: 600; }

/* ============ Empty / Loading ============ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-ic { font-size: 44px; margin-bottom: 12px; }
.empty h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; color: var(--text-faint); }

.loading {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-dim);
}

.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 34px;
  text-align: center;
  background: var(--bg-soft);
}

.site-footer p { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-meta { font-size: 12px !important; color: var(--text-faint) !important; }

/* ============ Prev/Next nav (aksesibilitas) ============ */
.skip-nav {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 10px 0;
  text-decoration: none;
  font-size: 13px;
  z-index: 200;
}

.skip-nav:focus { left: 0; }

/* Scrollbar halus */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ SVG sizing (ikon inline) ============ */
svg { display: block; }

.brand-logo svg { width: 26px; height: 26px; color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.search-ic svg { width: 16px; height: 16px; }
.btn-clear svg { width: 13px; height: 13px; }
.empty-ic svg { width: 44px; height: 44px; color: var(--text-faint); }

.card-badge { display: inline-flex; align-items: center; gap: 3px; }
.card-badge svg { width: 10px; height: 10px; }

.meta-item { display: inline-flex; align-items: center; gap: 3px; }
.meta-item svg { width: 11px; height: 11px; }
.card-meta .stars svg { color: #fbbf24; }

.cat-chip { display: inline-flex; align-items: center; gap: 5px; }
.cat-chip svg { width: 12px; height: 12px; }
.cat-chip.active svg { color: #fff; }

/* ============ Modal detail ============ */
[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 20, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close svg { width: 14px; height: 14px; }

.modal-head h2 { font-size: 20px; font-weight: 800; margin: 0 36px 6px 0; line-height: 1.3; }
.modal-desc { font-size: 14px; line-height: 1.6; color: var(--text-dim); margin: 0; }

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-dim);
}

.modal-meta li { display: inline-flex; align-items: center; gap: 5px; }
.modal-meta svg { width: 12px; height: 12px; color: var(--accent); }

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.modal-similar { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-similar h3 { font-size: 13px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; }

.similar-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.sim-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sim-chip:hover { border-color: var(--accent); color: var(--accent); }