/* =========================
   UPGRADED FULL CSS (MOBILE + MODERN + HOVER IMAGE)
   ========================= */

/* Theme tokens */
:root {
  --card-radius: 18px;
  --soft-border: rgba(0, 0, 0, .06);

  /* added */
  --container: 1120px;
  --pad: 16px;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-lift: 0 10px 28px rgba(0, 0, 0, .10);
  --focus-ring: rgba(59, 130, 246, .45);
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: #f6f7f9;
  color: #111827;
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Optional container helper */
.container {
  width: min(var(--container), calc(100% - (var(--pad) * 2)));
  margin-inline: auto;
}

/* A11y focus */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Topbar */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--soft-border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(6px);
}

.brand {
  font-weight: 800;
  letter-spacing: .3px;
}

/* Nav pills wrapper */
.navbar-pills {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .4rem;
  scrollbar-width: none;
}

.navbar-pills::-webkit-scrollbar {
  display: none;
}

/* Nav pill button */
.nav-pill-btn {
  border-radius: 999px;
  padding: .6rem 1rem;
  border: 1px solid var(--soft-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow: var(--shadow-soft);
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}

.nav-pill-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.nav-pill-btn:active {
  transform: translateY(0px);
}

.nav-pill-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .22);
}

/* Hero */
.hero {
  border-radius: var(--card-radius);
  min-height: 340px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, 0) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2.2rem;
  max-width: 720px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 .25rem 0;
  line-height: 1.05;
}

.hero-subtitle {
  color: rgba(255, 255, 255, .88);
  font-size: 1.15rem;
  margin: 0;
}

/* Soft cards */
.soft-card {
  background: #fff;
  border: 1px solid var(--soft-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
  transition: box-shadow .18s ease, transform .18s ease;
}

.soft-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

/* Stats */
.stat-card {
  padding: 1.4rem 1.2rem;
  text-align: center;
  height: 100%;
  min-height: 120px;
  transition: transform .25s ease, box-shadow .25s ease;
}

.stat-icon {
  font-size: 1.8rem;
  opacity: .9;
  margin-bottom: .4rem;
}

.stat-value {
  font-weight: 800;
  font-size: 2.2rem;
  margin: 0;
  line-height: 1.1;
}

.stat-label {
  color: #6b7280;
  margin: .15rem 0 0;
  font-size: .95rem;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .12);
}

/* Section */
.section-title {
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.section-title i {
  opacity: .9;
}

.muted {
  color: #6b7280;
}

/* KV table */
.kv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.kv-key {
  width: 55%;
  color: #6b7280;
}

.kv-val {
  width: 45%;
  text-align: right;
  color: #111827;
  font-weight: 600;
}

/* =========================
   POTENSI IMAGE (HOVER MODERN)
   ========================= */
.potensi-img {
  border-radius: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--soft-border);
  aspect-ratio: 16 / 9;
  height: auto;

  /* added modern hover */
  position: relative;
  cursor: pointer;
  transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
}

/* dark overlay */
.potensi-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .45), rgba(0, 0, 0, .05) 60%);
  opacity: 0;
  transition: opacity .35s ease;
}

/* shine effect */
.potensi-img::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent);
  transition: left .6s ease;
  opacity: .9;
}

/* hover actions */
.potensi-img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 35px rgba(0, 0, 0, .18);
  filter: saturate(1.05);
}

.potensi-img:hover::after {
  opacity: 1;
}

.potensi-img:hover::before {
  left: 120%;
}

/* Optional label inside image */
.potensi-label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  opacity: 0;
  transform: translateY(6px);
  transition: all .3s ease;
  z-index: 2;
  text-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.potensi-img:hover .potensi-label {
  opacity: 1;
  transform: translateY(0);
}

/* Badges */
.badge-soft {
  background: #eef2f7;
  color: #111827;
  border: 1px solid rgba(0, 0, 0, .05);
  font-weight: 600;
  padding: .35rem .6rem;
  border-radius: 999px;
  margin-right: .35rem;
  margin-top: .35rem;
  display: inline-block;
  font-size: .85rem;
}

/* Person card */
.person-card {
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
}

.person-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .12);
}

.person-avatar {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  transition: transform .3s ease, box-shadow .3s ease;
}

.person-card:hover .person-avatar {
  transform: scale(1.08);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
}

.person-avatar i {
  font-size: 2.3rem;
  color: #111827;
}

.person-name {
  font-weight: 800;
  margin: 0;
}

.person-role {
  color: #6b7280;
  margin: .15rem 0 0;
}

/* Footer */
.footer-bar {
  color: #6b7280;
  text-align: center;
  padding: 1.6rem 0;
}

/* Help FAB */
.help-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .18);
  cursor: pointer;
  z-index: 999;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}

.help-fab:hover {
  opacity: .92;
  transform: translateY(-1px);
}

.help-fab:active {
  transform: translateY(0px);
}

/* =========================
   MOBILE RESPONSIVE
   ========================= */
@media (max-width: 640px) {
  :root {
    --pad: 14px;
  }

  .hero {
    min-height: 260px;
  }

  .hero-content {
    padding: 1.4rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .stat-card {
    padding: 1.1rem 1rem;
  }

  .stat-value {
    font-size: 1.9rem;
  }
}

/* Disable hover effects on touch-only devices */
@media (hover: none) {

  .potensi-img:hover,
  .soft-card:hover,
  .person-card:hover,
  .stat-card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
    filter: none;
  }

  .potensi-img:hover::after {
    opacity: 0;
  }

  .potensi-img:hover::before {
    left: -120%;
  }
}

/* Reduce motion (accessibility) */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =========================
   TOPBAR MOBILE REFINEMENT
   ========================= */
@media (max-width: 640px) {

  /* topbar lebih ringkas */
  .topbar {
    padding: 10px var(--pad);
    border-bottom: 1px solid var(--soft-border);
  }

  /* kalau topbar kamu dibungkus container */
  .topbar .container {
    width: 100%;
  }

  /* brand/judul jangan kegedean */
  .brand {
    font-size: 8px;
    line-height: 1;
    letter-spacing: .2px;
    display: block;
    margin-bottom: 8px;
    /* jarak ke pills */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* kalau kepanjangan */
  }

  /* nav pills: scroll halus + snap */
  .navbar-pills {
    gap: 8px;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 8px;
  }

  .navbar-pills>* {
    scroll-snap-align: start;
  }

  /* tombol pill lebih compact */
  .nav-pill-btn {
    padding: 10px 12px;
    font-size: 12.5px;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  }

  /* active lebih “calm” */
  .nav-pill-btn.active {
    box-shadow: 0 10px 18px rgba(15, 23, 42, .18);
  }

  /* indikator ujung (biar user tau bisa digeser) */
  .topbar {
    position: sticky;
  }

  .topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: transparent;
    pointer-events: none;
  }

  /* fade kanan-kiri untuk area pills */
  .navbar-pills {
    -webkit-mask-image: linear-gradient(90deg,
        transparent 0,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%);
    mask-image: linear-gradient(90deg,
        transparent 0,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%);
  }
}

/* HP kecil banget */
@media (max-width: 360px) {
  .brand {
    font-size: 10px;
  }

  .nav-pill-btn {
    padding: 9px 11px;
    font-size: 12px;
  }
}