/* ============================================================
   VIRTUAL TOUR CSS - STRICT REQUIREMENTS
   
   OBJECTIVE 1: Panorama 100% fullscreen (100vw x 100vh)
   OBJECTIVE 2: Footer hidden on load, visible on scroll
   OBJECTIVE 3: Mini map fixed bottom-right, always visible
   OBJECTIVE 4: Menu top-right, doesn't show without click
   OBJECTIVE 5: Responsive on all devices
============================================================ */

/* ========== GLOBAL BASE ========== */
html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto; /* enable scroll for footer */
  font-family: Arial, sans-serif;
  background: #000;
}

/* ========== OBJECTIVE 1: PANORAMA FULLSCREEN ========== */
#panorama {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: #000;
  overflow: hidden;
}

/* Pannellum container children - keep them inside panorama bounds */
.pnlm-container,
.pnlm-viewer,
.pnlm-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* ========== OBJECTIVE 2: FOOTER HIDDEN ON LOAD ========== */
footer, .footer {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  background: #1a1a1a;
  color: #fff;
  padding: 20px;
  margin-top: 0;
  z-index: 10;
}

/* ========== OBJECTIVE 3: MINI MAP - FIXED BOTTOM RIGHT ========== */
#miniMap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 180px;
  height: 170px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

#miniMap img,
#miniMap .map-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.miniMap-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-point {
  position: absolute;
  width: 12px;
  height: 12px;
  background: red;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.map-point::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px; /* smaller hit area to avoid overlapping neighbors */
  height: 20px;
  border-radius: 50%;
  background: transparent;
  pointer-events: none; /* do not capture pointer events on this pseudo-element */
}

.map-point.active {
  background: #22ef07;
  animation: miniMapPulse 1.5s infinite;
}

@keyframes miniMapPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(17, 235, 13, 0.7);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 0 8px rgba(0, 255, 0, 0);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
  }
}

/* ========== OBJECTIVE 4: WEBSITE MENU ========== */
.custom-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: transparent !important;
  backdrop-filter: none;
  border: none;
  z-index: 50 !important;
  padding: 10px 20px !important;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* When page is scrolled / in non-panorama contexts, apply a subtle background for readability */
.custom-navbar.scrolled {
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.navbar-brand img {
  height: 50px;
  width: auto;
  margin-left: 30px;
  transition: height 0.3s ease;
}

.custom-navbar.scrolled .navbar-brand img {
  height: 40px;
}

/* Navbar container - flex layout */
.custom-navbar .container-fluid,
.custom-navbar .container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 20px !important;
  max-width: 100%;
  width: 100%;
  gap: 10px;
}

/* Navbar toggler - hidden by default */
.navbar-toggler {
  display: none;
  background: transparent;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 60;
}

/* Fixed navbar-toggler at top right - hidden by default, shown on mobile */
.navbar-toggler-fixed {
  position: fixed;
  top: 15px;
  right: 20px;
  display: none;
  background: transparent;
  border: 2.5px solid #ffffff !important; 
  padding: 8px 12px;
  cursor: pointer;
  z-index: 150;
  transition: all 0.3s ease;
}

.navbar-toggler-fixed:hover {
  transform: scale(1.1);
}

.navbar-toggler-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: block;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* Navbar collapse - visible by default on desktop */
.navbar-collapse {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto !important;
}

/* Navigation links - overrides default */
.navbar-nav {
  display: flex;
  flex-direction: row;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-item.dropdown > .nav-link::after {
  content: '';
}

/* ===== MENU UTAMA ===== */
.nav-link {
  color: #ffffff !important;
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: #f1c40f !important; /* kuning gold */
}

/* Dropdown menu - Bootstrap default: hidden until clicked */
.dropdown-menu {
  background: rgba(0, 0, 0, 0.85) !important;
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  background: transparent !important;
  color: #ffffff !important;
  font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: rgba(255, 215, 0, 0.15) !important;
  color: #f1c40f !important;
}

/* ========== RESPONSIVE - TABLET (max 1024px) ========== */
/* Hanya berpengaruh pada tampilan Desktop (layar lebar) */
@media (min-width: 992px) {
    .custom-navbar .navbar-brand {
        /* Geser logo ke kanan. 
           Ubah angka 150px sesuai keinginan (semakin besar semakin ke kanan) */
        margin-left: 150px; 
        
        /* Memastikan logo tetap fleksibel */
        position: relative;
    }

    /* Opsional: Jika ingin menu tetap di pojok kanan tapi logo bergeser */
    .custom-navbar .container {
        justify-content: flex-start; /* Agar margin-left pada logo berfungsi */
    }

    .custom-navbar .collapse {
        flex-grow: 1; /* Agar menu tetap terdorong ke kanan */
    }
}

@media (max-width: 480px) {

  .navbar-brand img {
    height: 30px;
  }

}

/* ========== RESPONSIVE - MOBILE (max 768px) ========== */
@media (max-width: 768px) {
  .navbar-toggler-fixed {
    display: block !important;
  }

  /* Place the logo slightly right of center for mobile screens */
  .custom-navbar .container,
  .custom-navbar .container-fluid {
    justify-content: space-between !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .navbar-brand {
    position: absolute;
    left: 50%;
    top: 55%;               /* ⬅️ geser ke bawah (awal: 50%) */
    transform: translate(-50%, -50%);
    margin: 0 !important;
    z-index: 1050;
  }

  .navbar-brand img {
    margin-left: 0 !important;
    margin-right: 0 !important;
    height: 40px;
  }

  .navbar-collapse {
    display: none !important;
    position: fixed !important;
    top: 60px;
    right: 15px;
    left: auto !important;
    width: auto;
    min-width: 200px;
    background: rgba(0, 0, 0, 0.98);
    border-radius: 0 0 0 8px;
    padding: 0 !important;
    z-index: 140;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    flex-direction: column !important;
    margin-left: 0 !important;
  }

  .navbar-collapse.show {
    display: flex !important;
  }

  .navbar-nav {
    flex-direction: column;
    width: 100%;
    gap: 0 !important;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0;
  }

  .nav-link {
    padding: 12px 20px !important;
    text-align: left;
    font-size: 14px;
    display: block !important;
  }

  .dropdown-menu {
    position: static !important;
    background: rgba(30, 30, 30, 0.95) !important;
    border: none !important;
    border-left: 3px solid #c5ba1d !important;
    padding: 0 !important;
    margin: 0 !important;
    display: none !important;
    flex-direction: column;
    width: 100%;
  }

  .dropdown-menu.show {
    display: flex !important;
  }

  .dropdown-item {
    padding: 10px 20px !important;
    font-size: 13px;
  }

  #miniMap {
    width: 160px;
    height: 150px;
    bottom: 12px;
    right: 12px;
  }

  /* Mobile menu adjustments */
  .menu-toggle-btn {
    top: 70px;
    left: 10px;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  #sceneMenu {
    top: 115px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: calc(100% - 20px);
    max-height: 50vh;
  }
}

/* ========== RESPONSIVE - SMALL MOBILE (max 480px) ========== */
@media (max-width: 768px) {
  .navbar-toggler-fixed {
    top: 12px;
    right: 15px;
    padding: 6px 10px;
  }

  /* Adjust logo position for very small screens */
  .custom-navbar .container,
  .custom-navbar .container-fluid {
    justify-content: space-between !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0 !important;
    display: flex;
    justify-content: center;
    z-index: 1050;
  }

  .navbar-brand img {
    height: 40px;
  }

  .navbar-collapse {
    top: 50px;
    right: 10px;
    min-width: 180px;
    max-width: calc(100% - 20px);
  }

  .nav-link {
    padding: 10px 15px;
    font-size: 13px;
  }

  .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .dropdown-menu {
    border-left: 2px solid #ffffff !important;
  }

  .dropdown-item {
    padding: 8px 15px;
    font-size: 12px;
  }

  .custom-navbar {
    position: relative;
  }

  .navbar-brand img {
    height: 30px;
  }

  .navbar-collapse.show {
    min-width: 180px;
  }

  .nav-link {
    padding: 8px 18px;
    font-size: 13px;
  }

  #miniMap {
    width: 140px;
    height: 150px;
    bottom: 10px;
    right: 10px;
  }
}

/* ========== HOTSPOT STYLING ========== */
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  z-index: 10;
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.2);
  background: white;
  box-shadow: 0 4px 12px rgba(211, 191, 40, 0.4);
}

.hotspot .tooltip {
  visibility: hidden;
  width: max-content;
  max-width: 60vw;
  background: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 20;
  white-space: nowrap;
}

.hotspot:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* ========== TOMBOL DAFTAR LOKASI (TEKS) ========== */
.menu-text-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  /* Nilai z-index harus lebih tinggi dari .custom-navbar (50) */
  z-index: 9999 !important; 
  pointer-events: auto !important; /* Memastikan bisa diklik */
  
  background: rgba(44, 43, 43, 0.7) !important;
  color: #ffffff !important;
  border: 1.5px solid #f6f5f2 !important;
  border-radius: 4px;
  padding: 10px 20px;
  
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-text-btn:hover {
  background: rgba(0, 0, 0, 0.9) !important;
  color: #f1c40f !important;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}

/* ========== PANEL MENU (FIX TAMPILAN) ========== */
#sceneMenu {
  position: fixed;
  top: 75px; 
  left: 20px;
  width: 280px;
  max-height: 75vh;
  /* z-index sedikit di bawah tombol tapi di atas navbar */
  z-index: 9998 !important; 
  
  background: rgba(0, 0, 0, 0.9) !important;
  border: 1px solid rgba(248, 233, 145, 0.4) !important;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  display: none; /* Akan diubah jadi 'block' oleh JavaScript */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Munculkan menu saat ada class show atau active */
#sceneMenu.show, #sceneMenu.active {
  display: block !important;
}

/* Efek Biru saat kursor menempel */
.menu-text-btn:hover {
  background: rgba(117, 116, 116, 0.9) !important;
  color: #ebedef !important; /* Tulisan jadi Biru */
  border-color: #e5e9ec !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* ========== PANEL DAFTAR MENU (KIRI) ========== */
#sceneMenu {
  position: fixed;
  top: 75px; /* Biar pas di bawah tombol */
  left: 20px;
  width: 260px;
  max-height: 75vh;
  background: rgba(0, 0, 0, 0.9) !important;
  border: 1px solid rgba(250, 213, 3, 0.4) !important;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  z-index: 998;
  display: none;
}

#sceneMenu h3 {
  color: #fafaf8 !important; /* Judul Kuning */
  font-size: 15px;
  border-bottom: 1px solid #f8f7f4;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

#sceneMenu li,
#sceneMenu li a {
  color: #ffffff !important; /* List Putih */
  padding: 8px 10px;
  cursor: pointer;
  transition: 0.2s;
}

/* Hover list jadi kuning */
#sceneMenu li:hover, 
#sceneMenu .accordion-title:hover {
  color: #f1c40f !important;
  background: rgba(255, 215, 0, 0.1) !important;
}

/* Accordion Title (Rumah Amora) */
#sceneMenu .accordion-title {
  color: #ffffff !important;
  background: rgba(255, 215, 0, 0.05) !important;
  font-weight: bold;
}

/* ========== UTILITIES ========== */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.judul {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  z-index: 20;
  font-weight: bold;
  font-size: 18px;
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity 0.5s ease;
}

#loading-screen.hide {
  opacity: 0;
  pointer-events: none;
}
