/* ==========================================================================
   CSS Variables - Fluid Islamic & IQIS Theme (Green, Gold & Glassmorphism)
   ========================================================================== */
:root {
  /* Brand Colors */
  --brand-green: #026432;
  --brand-green-dark: #1b381c;
  --brand-green-hover: #038040;
  --secondary-gold: #C8951A;
  --text-light: #ffffff;
  
  /* Glassmorphism & Soft Colors */
  --glass-bg: rgba(2, 100, 50, 0.65); /* Hijau transparan */
  --glass-bg-dark: rgba(27, 56, 28, 0.85);
  --glass-border: rgba(200, 149, 26, 0.35); /* Border emas transparan */
  --glass-border-hover: rgba(200, 149, 26, 0.8);
  
  /* Shapes & Shadows - Lebih lembut dan tidak kaku */
  --radius-pill: 50px;
  --radius-soft: 16px;
  --radius-arch: 24px 24px 8px 8px; /* Lengkungan kubah modern */
  
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 15px rgba(200, 149, 26, 0.4);
  
  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   Global Reset
   ========================================================================== */
* {
  -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
  -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none;
  -ms-text-size-adjust: none; -moz-text-size-adjust: none; -webkit-text-size-adjust: none; text-size-adjust: none;
  -webkit-user-drag: none; -webkit-touch-callout: none; -ms-content-zooming: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

html, body {
  width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; /* Font lebih modern */
  font-size: 16px; background-color: #000; color: var(--text-light);
}

a, a:hover, a:active, a:visited { text-decoration: none; color: inherit; }

#pano {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden;
}

/* ==========================================================================
   Title Bar (Floating Pill Design - Tidak kaku)
   ========================================================================== */
#titleBar {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  height: 46px;
  z-index: 10;
  max-width: 60%;
  display: flex;
  justify-content: center;
}

.mobile #titleBar { top: 20px; max-width: 80%; }

#titleBar .sceneName {
  display: inline-block;
  padding: 0 30px;
  line-height: 46px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill); /* Bentuk kapsul yang fluid */
  box-shadow: var(--shadow-soft);
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text;
}

/* ==========================================================================
   Toggles (Autorotate, Fullscreen, Scene List)
   ========================================================================== */
/* Memperbaiki masalah toggle hilang dengan menargetkan ID secara langsung */
#autorotateToggle, 
#fullscreenToggle, 
#sceneListToggle {
  position: absolute;
  top: 15px;
  width: 46px;
  height: 46px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50%; /* Bulat sempurna agar tidak kaku */
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10;
}

#autorotateToggle:hover, 
#fullscreenToggle:hover, 
#sceneListToggle:hover {
  background-color: var(--brand-green-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-3px) scale(1.05); /* Efek membal (bouncy) */
  box-shadow: var(--shadow-glow);
}

/* Layout Posisi Toggle */
#fullscreenToggle { right: 15px; display: none; }
body.fullscreen-enabled #fullscreenToggle { display: block; }

#autorotateToggle { right: 15px; display: block; }
body.fullscreen-enabled #autorotateToggle { right: 75px; } /* Geser jika ada fullscreen */
body.fullscreen-enabled.mobile #autorotateToggle { right: 85px; }

#sceneListToggle { left: 15px; }

.mobile #autorotateToggle, .mobile #fullscreenToggle, .mobile #sceneListToggle {
  top: 20px; width: 50px; height: 50px;
}

/* Icon Toggles Settings */
#autorotateToggle .icon, 
#fullscreenToggle .icon, 
#sceneListToggle .icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  transition: opacity 0.2s ease;
}

.mobile #autorotateToggle .icon, .mobile #fullscreenToggle .icon, .mobile #sceneListToggle .icon {
  width: 26px; height: 26px;
}

/* State Switcher On/Off */
#autorotateToggle .icon.on, #fullscreenToggle .icon.on, #sceneListToggle .icon.on { display: none; }
#autorotateToggle .icon.off, #fullscreenToggle .icon.off, #sceneListToggle .icon.off { display: block; }

#autorotateToggle.enabled .icon.on, #fullscreenToggle.enabled .icon.on, #sceneListToggle.enabled .icon.on { display: block; }
#autorotateToggle.enabled .icon.off, #fullscreenToggle.enabled .icon.off, #sceneListToggle.enabled .icon.off { display: none; }

#sceneListToggle .text { display: none; }

/* ==========================================================================
   Scene List (Sidebar Panel)
   ========================================================================== */
#sceneList {
  position: absolute; top: 0; left: -260px;
  width: 260px; height: 100%;
  padding-top: 80px;
  overflow-x: hidden; overflow-y: auto;
  margin-left: 0;
  transition: margin-left 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 9;
}

#sceneList.enabled { margin-left: 260px; }
.mobile #sceneList { width: 100%; left: -100%; padding-top: 90px; }
.mobile #sceneList.enabled { margin-left: 100%; }

#sceneList .scenes {
  width: 100%; min-height: 100vh;
  background-color: var(--glass-bg-dark);
  backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  border-right: 1px solid var(--glass-border);
  border-radius: 0 24px 24px 0; /* Sudut membulat di sebelah kanan */
  box-shadow: 10px 0 30px rgba(0,0,0,0.4);
}

.mobile #sceneList .scenes { border-radius: 0; border-right: none; }

#sceneList .scene {
  display: block; width: 100%; height: 55px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition-smooth);
}

.mobile #sceneList .scene { height: 65px; }

#sceneList .scene .text {
  width: 100%; height: 100%;
  padding: 0 25px; line-height: 55px;
  font-size: 15px; letter-spacing: 0.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mobile #sceneList .scene .text { line-height: 65px; font-size: 16px; }

.no-touch #sceneList .scene:hover {
  background-color: rgba(200, 149, 26, 0.15); /* Highlight emas tipis */
  padding-left: 8px; /* Efek indentasi saat hover */
}

#sceneList .scene.current {
  background-color: var(--brand-green);
  border-left: 5px solid var(--secondary-gold);
  color: var(--secondary-gold);
  font-weight: 600;
}

body.single-scene #sceneList, body.single-scene #sceneListToggle { display: none; }

/* ==========================================================================
   Hotspots (Link & Tooltips)
   ========================================================================== */
.link-hotspot {
  width: 60px; height: 60px;
  margin-left: -30px; margin-top: -30px;
  opacity: 0.85;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.no-touch .link-hotspot:hover { opacity: 1; transform: scale(1.15); }
.mobile .link-hotspot { width: 70px; height: 70px; top: 19px; }

.link-hotspot-icon {
  width: 100%; height: 100%; cursor: pointer;
  filter: drop-shadow(0px 6px 8px rgba(0,0,0,0.4));
}

.link-hotspot-tooltip {
  position: absolute; left: 100%; top: 10px; margin-left: 15px;
  font-size: 14px; max-width: 300px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background-color: var(--glass-bg-dark);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: #fff; box-shadow: var(--shadow-soft);
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateX(-15px);
  transition: all 0.4s ease;
}

.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1; transform: translateX(0); pointer-events: all;
}

/* ==========================================================================
   Info Hotspot (Diperbarui dengan Flexbox - Rapi & Anti-berantakan)
   ========================================================================== */
.info-hotspot {
  line-height: 1.4em;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.no-touch .info-hotspot:hover { opacity: 1; }
.info-hotspot.visible { opacity: 1; z-index: 20; }

/* Header Container - Menggunakan Flexbox */
.info-hotspot .info-hotspot-header {
  position: relative;
  display: flex;
  align-items: center;
  width: 45px;
  height: 45px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-green);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  overflow: hidden; /* Menyembunyikan judul & tombol close saat memendek */
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-radius 0.3s;
}

.mobile .info-hotspot .info-hotspot-header { width: 55px; height: 55px; }

/* Saat Hotspot di-hover (Desktop) atau diklik (Visible) */
.desktop.no-touch .info-hotspot .info-hotspot-header:hover,
.desktop .info-hotspot.visible .info-hotspot-header {
  width: 300px; /* Lebar otomatis saat terbuka */
  background-color: var(--brand-green-dark);
  border-radius: var(--radius-soft);
}

/* Saat di-klik (buka teks box), sudut bawah header menjadi kotak */
.desktop .info-hotspot.visible .info-hotspot-header {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

/* 1. Wrapper Icon (Kiri) */
.info-hotspot .info-hotspot-icon-wrapper {
  width: 41px; /* 45px dikurangi ketebalan border */
  height: 41px;
  flex-shrink: 0; /* Mencegah ikon menyusut */
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile .info-hotspot .info-hotspot-icon-wrapper { width: 51px; height: 51px; }

.info-hotspot .info-hotspot-icon {
  width: 22px;
  height: 22px;
}

/* 2. Wrapper Title (Tengah) */
.info-hotspot .info-hotspot-title-wrapper {
  flex: 1; /* Mengisi sisa ruang kosong di tengah */
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.desktop.no-touch .info-hotspot .info-hotspot-header:hover .info-hotspot-title-wrapper,
.desktop .info-hotspot.visible .info-hotspot-title-wrapper {
  opacity: 1;
}

.info-hotspot .info-hotspot-title {
  font-weight: 600;
  color: var(--secondary-gold);
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* 3. Wrapper Close Button (Kanan) */
.info-hotspot .info-hotspot-close-wrapper {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(200, 149, 26, 0.15); /* Latar belakang tipis warna emas */
  border-left: 1px solid var(--glass-border);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.desktop .info-hotspot.visible .info-hotspot-close-wrapper {
  opacity: 1;
  visibility: visible;
}

.info-hotspot .info-hotspot-close-icon {
  width: 14px;
  height: 14px;
}

/* 4. Konten Teks Deskripsi di Bawah Header */
.info-hotspot .info-hotspot-text {
  position: absolute;
  top: 45px;
  left: 0;
  width: 300px; /* Disesuaikan agar sejajar dengan lebar header */
  max-height: 250px;
  padding: 15px 20px;
  background-color: var(--glass-bg-dark);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius-soft) var(--radius-soft);
  box-shadow: var(--shadow-soft);
  overflow-y: auto;
  
  /* Sembunyikan secara default */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-in-out;
}

.desktop .info-hotspot.visible .info-hotspot-text {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   View Control Buttons (Bottom Floating Nav)
   ========================================================================== */
.viewControlButton {
  display: none;
  position: absolute;
  bottom: 25px;
  width: 44px; height: 44px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15); /* Border sangat tipis agar fluid */
  border-radius: 50%; /* Lingkaran penuh */
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.viewControlButton:hover {
  background-color: var(--brand-green);
  border-color: var(--secondary-gold);
  transform: translateY(-5px); /* Efek melayang */
  box-shadow: var(--shadow-glow);
}

body.view-control-buttons .viewControlButton { display: block; }

@media (max-width: 600px) { body.view-control-buttons .viewControlButton { display: none; } }

.viewControlButton .icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
}

/* Jarak tombol diatur lebih harmonis */
.viewControlButton-1 { left: calc(50% - 135px); } /* Up */
.viewControlButton-2 { left: calc(50% - 81px); }  /* Down */
.viewControlButton-3 { left: calc(50% - 27px); }  /* Left */
.viewControlButton-4 { left: calc(50% + 27px); }  /* Right */
.viewControlButton-5 { left: calc(50% + 81px); }  /* Zoom In */
.viewControlButton-6 { left: calc(50% + 135px); } /* Zoom Out */