/* =======================================
   RESET & BASE
======================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #111827;                 /* gray-900 */
  background: #f4f4f5;            /* zinc-100 */
}
a { color: inherit; text-decoration: none; }

/* Container utama untuk semua halaman */
.container {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;               /* biar peta full tanpa scroll body */
}

/* =======================================
   BACKGROUND (opsional per halaman)
======================================= */
.page-index .container {
  background: #05205200 url('../img/ASSESTS-01.png') no-repeat right bottom / cover;
}
.page-map .container {
  background: #05205200 url('../img/ASSESTS-02.png') no-repeat right bottom / cover;
}

/* =======================================
   SIDEBAR
   Catatan:
   - Desktop: sidebar tampil normal.
   - Mobile: slide-in/out via #sidebar-container.open
======================================= */
/* Wrapper sidebar (wadah untuk partial) */
#sidebar-container{
  position: relative;
  width: 300px;
  min-width: 280px;
  height: 100%;
  padding: 0;                      /* wrapper tanpa visual */
  background: transparent;
  border-right: none;
  backdrop-filter: none;
  z-index: 1500;                   /* di atas canvas Cesium */
}

/* Sidebar isi sebenarnya (di dalam partial) */
#sidebar-container .sidebar{
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #ffffffcc;           /* putih transparan */
  backdrop-filter: blur(6px);
  border-right: 1px solid #e5e7eb;
  padding: 16px;
  box-shadow: 2px 0 8px rgba(0,0,0,.06);
  overflow-y: auto;
}

/* Header/logo di sidebar */
.sidebar .logo { position: relative; margin-bottom: 18px; text-align: center; }
.sidebar .logo img { width: 120px; height: auto; display: inline-block; }
.sidebar .logo h2 { font-size: 16px; margin-top: 8px; font-weight: 700; color: #111; }
.sidebar .logo p  { font-size: 12px; color: #6b7280; }

/* Menu */
.sidebar .menu { margin-top: 12px; display: grid; gap: 8px; }
.sidebar .menu a,
.sidebar .menu span {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: #111;
}
.sidebar .menu a:hover { background: #e5e7eb; }
.sidebar .menu a.active {
  background: rgba(0,0,0,.08);
  color: #111;
  box-shadow: inset 0 0 0 2px #111;
}
.sidebar .menu .submenu { display: grid; gap: 6px; margin-top: 4px; }
.sidebar .menu .submenu a { font-size: 14px; padding-left: 18px; background: #f3f4f6; }

/* Tombol close (×) di dalam sidebar — tampil di mobile */
.close-sidebar-btn {
  position: absolute; top: 10px; right: 10px;
  border: none; background: transparent; font-size: 24px; line-height: 1;
  cursor: pointer; display: none;
}

/* =======================================
   MAP AREA (Cesium)
======================================= */
.map-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}
#cesiumContainer {
  position: absolute;
  inset: 0;                 /* full cover parent */
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;               /* di bawah UI mengambang */
}

/* =======================================
   OVERLAY (untuk tutup sidebar di mobile)
======================================= */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 1400;
}
#overlay.active { display: block; }

/* =======================================
   CTA / TOGGLE LIST BUTTONS (floating)
======================================= */
.toggle-buttons {
  position: absolute;
  top: 24px; left: 64px;           /* beri ruang dari tombol ☰ */
  z-index: 1200;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 8px;
}
.toggle-buttons button {
  appearance: none; border: none; cursor: pointer;
  padding: 8px 12px; font-weight: 700; border-radius: 10px;
  background: #fff;
}
.toggle-buttons button:hover { background: #e5e7eb; }

/* =======================================
   FLOATING TABLE PANELS
======================================= */
.floating-panel {
  position: absolute;
  z-index: 1100;
  background: #ffffffcc;
  backdrop-filter: blur(6px);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 40vh;
  overflow: auto;
  width: 560px;
  display: none;                  /* default tersembunyi */
}
#table-bangunan-container { bottom: 72px; left: 12px; }
#table-persil-container   { bottom: 72px; right: 12px; }

/* Table style */
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f3f4f6; padding: 6px 8px; text-align: left;
  border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 6px 8px; border-bottom: 1px solid #eee; }
tbody tr:hover { background: #fef9c3; cursor: pointer; }

/* =======================================
   POPUP INFO CARD
======================================= */
#popup-info {
  position: absolute;
  top: 80px; right: 20px;
  width: 360px; max-width: 92vw;
  background: #fff; border-radius: 16px; border: 1px solid #e5e7eb;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
  z-index: 1300; padding: 16px; display: none;
  max-height: 80vh; overflow: auto;
}
.popup-card h2 { font-size: 18px; margin: 0 0 10px; font-weight: 700; }
.popup-card table { width: 100%; font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.popup-card table td:first-child { font-weight: 700; width: 120px; color: #374151; }
.popup-card img { width: 100%; border-radius: 8px; border: 1px solid #e5e7eb; }

/* =======================================
   HERO (untuk index)
======================================= */
.hero-section { flex: 1; padding: 80px; color: #fff; }
.hero-section h1 { font-size: 38px; line-height: 1.25; margin-bottom: 10px; }
.hero-section .tagline { font-size: 18px; font-style: italic; margin-bottom: 20px; color: #f0f0f0; }
.hero-section .cta {
  display: inline-block; background: #fff; color: #0a2a66;
  padding: 10px 20px; font-weight: 700; border-radius: 8px;
}
.hero-section .cta:hover { background: #e5e7eb; color: #111; }
.info-boxes { display: flex; gap: 20px; margin-top: 40px; flex-wrap: wrap; }
.info-card { width: 160px; text-align: center; padding: 16px; border-radius: 12px;
  background: rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.info-card img { width: 42px; margin-bottom: 10px; }
.info-card p { color: #fff; font-size: 14px; }

/* =======================================
   FOOTER
======================================= */
.footer {
  position: absolute; inset-inline: 0; bottom: 0;
  font-family: inherit; line-height: 1.2;
}
.footer-text {
  background: #0a2a66; color: #fff; text-align: center;
  padding: 6px 0; font-size: .9rem;
}
.footer-text a { color: #60a5fa; }
.footer-text a:hover { text-decoration: underline; }

/* =======================================
   HAMBURGER (☰) — tombol toggle sidebar
======================================= */
#toggleSidebar {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2001;                 /* di atas overlay dan canvas */
  background: #ffffffdd;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  font-size: 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  display: none;                  /* tampilkan di mobile */
}

/* =======================================
   THEME OVERRIDES (opsional halaman map)
======================================= */
.page-map .sidebar .menu a,
.page-map .sidebar .menu span,
.page-map .sidebar .logo h2 { color: #111 !important; }
.page-map .sidebar .logo p { color: #6b7280 !important; }
.page-map .sidebar .menu a.active {
  background: rgba(0,0,0,.08) !important; color: #111 !important;
  box-shadow: inset 0 0 0 2px #111 !important;
}
.page-map .sidebar .menu a:hover { background: rgba(0,0,0,.06) !important; }

/* =======================================
   RESPONSIVE
======================================= */
@media (max-width: 1200px){
  .hero-section { padding: 64px; }
}
@media (max-width: 1024px) {
  #sidebar-container { width: 280px; min-width: 260px; }
  .hero-section { padding: 48px; }
}
@media (max-width: 768px) {
  /* Sidebar jadi slide-in */
  #sidebar-container{
    position: fixed; top:0; left:0;
    height:100vh; width:85vw; max-width:320px;
    transform: translateX(-100%);
    transition: transform .28s ease-in-out;
    background: #ffffffcc;
    border-right: 1px solid #e5e7eb;
    box-shadow: 4px 0 12px rgba(0,0,0,.15);
    z-index: 1500;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #sidebar-container.open{ transform: translateX(0); }
  #sidebar-container .close-sidebar-btn{ display:block; }

  /* Tampilkan tombol ☰ */
  #toggleSidebar { display: block; }

  /* Pindahkan panel tombol agar tidak tabrakan dengan ☰ */
  .toggle-buttons { top: 60px; left: 12px; }

  /* Panel tabel responsif */
  .floating-panel {
    width: 92%;
    left: 4%; right: auto;
    bottom: 72px;
    max-width: 680px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }

  /* Popup menyesuaikan layar kecil */
  #popup-info { right: 4%; width: 92%; top: 64px; }

  /* Index hero padding lebih kecil */
  .hero-section { padding: 28px; }
}

/* =======================================
   ACCESSIBILITY & MOTION
======================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* =======================================
   HELPER (utilitas kecil)
======================================= */
.hidden { display: none !important; }
.block { display: block !important; }
