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

* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

html,
body {
  height: 100%;
  font-family: "Figtree";
}

.layout_body {
  background-color: var(--darkgray1);
}

/* -- TOP -- */

.top {
  display: none;
  align-items: center;
  height: 60px;
  background: #232323;
  border-bottom: 1px solid var(--darkborder1);
}

.toggle_information_container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 15px;
  top: 17px;
  z-index: 2000;
  border-radius: 20px;
  padding-left: 20px;
  padding-right: 10px;
  background-color: var(--darkgray1);
  cursor: pointer;
  border: 1px solid transparent;
}
.toggle_information_container:hover {
  border: 1px solid rgb(80, 80, 80);
  background-color: var(--darkgray1_hover);
}
.toggle_information_container:active {
  border: 1px solid rgb(80, 80, 80);
  background-color: var(--darkgray1_active);
}

.toggle_buildings_container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 150px;
  top: 17px;
  z-index: 2000;
  border-radius: 20px;
  padding-left: 20px;
  padding-right: 10px;
  background-color: var(--darkgray1);
  cursor: pointer;
}
.toggle_buildings_container:hover {
  background-color: var(--darkgray1_hover);
}
.toggle_buildings_container:active {
  background-color: var(--darkgray1_active);
}

/* Desktop: keep filter toggle docked near the side panel when open */
@media (min-width: 769px) {
  .layout_body.sidepanel-open .toggle_information_container {
    display: none;
  }
}

/* Mobile: hide the floating toggle when the panel is open */
@media (max-width: 768px) {
  .layout_body.sidepanel-open .toggle_information_container {
    display: none;
  }
}

/* Hide floating filter toggle while details panel is open */
.layout_body.mobile-details-open .toggle_information_container {
  display: none !important;
}

.woningzoeker-toggle {
  position: fixed;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.woningzoeker-button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--darkgray1);
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.woningzoeker-button:disabled {
  pointer-events: none;
}

.spotlight-view-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}

.spotlight-view-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.spotlight-view-loading-spinner {
  width: 46px;
  height: 46px;
  border: 5px solid rgb(255 255 255 / 38%);
  border-top-color: #ffffff;
  border-radius: 999px;
  filter: drop-shadow(0 10px 26px rgb(0 0 0 / 42%));
  animation: spotlightViewLoadingSpin 700ms linear infinite;
}

@keyframes spotlightViewLoadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.woningzoeker-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.woningzoeker-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.woningzoeker-button.active {
}

.woningzoeker-arrow {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(1.1);
}

.toggle_information {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: none;
  z-index: 100;
}
.toggle_information img {
  width: 15px;
  height: 100%;
  object-fit: contain;
}
.toggle_information_text {
  display: inline-block;
  color: var(--darktext1);
  font-size: 1.2rem;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.toggle_menu {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 10px;
  top: 10px;
  color: #fff;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  z-index: 100;
}

.toggle_information {
  margin-left: auto;
}

.toggle_menu img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.details-open .toggle_information_container {
  display: none !important;
}

.panel_handle {
  display: none;
  position: absolute;
  top: 4px;
  left: 50%;
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: #ffffff;
  opacity: 0.9;
  transform: translateX(-50%);
  pointer-events: none;
}

/* -- MAIN -- */

.main {
  display: flex;
  height: 100%;
  width: auto;
  position: relative;
}

.menu {
  position: fixed;
  left: 0;
  top: 0;
  width: 70px;
  height: 100%;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 10px;
  z-index: 100;
  gap: 10px;
}

.menu button:last-of-type {
  margin-bottom: 16px;
}

.menu-logo {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: auto;
  z-index: 1000;
}
.menu-logo img {
  width: 30px;
  height: 30px;
}

.menu-item {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  background-color: var(--darkgray1);
}
.menu-item:hover {
  background-color: var(--darkgray1_hover);
}
.menu-item:active {
  background-color: var(--darkactive1);
}
.menu-item img {
  width: 20px;
  height: 20px;
}
.menu-item.is-active,
.menu-item.is-active:hover {
  background-color: var(--darkgray1_active);
}

.menu-item-bottom {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  margin-bottom: 8px;
  background-color: var(--darkgray1);
}
.menu-item-bottom:hover {
  background-color: var(--darkgray1_hover);
}
.menu-item-bottom:active {
  background-color: var(--darkgray1_active);
}
.menu-item-bottom img {
  width: 20px;
  height: 20px;
}
.menu-item-bottom.is-active,
.menu-item-bottom.is-active:hover {
  background-color: var(--darkgray1_active);
}

#toggle_menu_buttons {
  display: none;
}

/* --- PANEL --- */

.panel {
  width: 0;
  overflow: hidden;
  background: var(--darkgray1);
  transition: width 0.35s ease;
  display: flex;
  position: relative;
  flex-direction: column;
}

.panel.show {
  width: 260px;
}

.panel-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
  background-color: var(--darkgray1);
}
.panel-close:hover {
  background-color: var(--darkgray1_hover);
}
.panel-close:active {
  background-color: var(--darkgray1_active);
}
.panel-close img {
  width: 15px;
  height: auto;
  object-fit: contain;
}

/* --- title --- */

.title_container {
  display: none !important;
  position: absolute;
  justify-items: center;
  align-items: center;
  flex-direction: column;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 15px;
  height: auto;
  padding: 10px 20px;
  background-color: var(--darkgray1);
}

.display_title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--darktext1);
}

.display_subtitle {
  font-size: 1.2rem;
  font-weight: 500;
  color: #f69179;
}

/* --- pages inside the panel --- */

.panel-page {
  display: none;
  height: 100%;
}
.panel-page.is-visible {
  display: block;
}

.panel-page_title {
  display: flex;
  align-items: center;
  justify-content: left;
  width: 100%;
  height: 35px;
  padding-left: 10px;
  color: var(--darktext1);
  font-size: 1.2rem;
}

.information_panel_page {
  padding: 16px;
  height: 100%;
}

/* show only when toggled */
.information_panel_page.is-visible {
  display: block;
}

.information_panel_title {
  display: flex;
  align-items: center;
  justify-content: left;
  width: 100%;
  height: 35px;
  padding-left: 10px;
  color: var(--darktext1);
  font-size: 1.2rem;
}

.panel_scroll_container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  padding-bottom: 20px;
  border-top: 1px solid var(--darkborder1);
}

.panel_scroll_container {
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.panel_scroll_container::-webkit-scrollbar {
  display: none;
}

/* --- Content --- */

.content {
  flex: 1;
  background: var(--darkgray2);
  transition: width 0.3s ease;
}

.main-content-page {
  display: none;
}

.main-content-page.is-visible {
  display: block;
}

/* --- Navigation --- */

.tree {
  list-style: none;
  padding-left: 0;
  padding-top: 10px;
}

.tree li {
  margin-bottom: 6px;
}

.tree-btn {
  all: unset;
  cursor: pointer;
  padding: 6px 10px;
  width: 90%;
  display: flex;
  align-items: center;
  border-radius: 30px;
  color: var(--darktext1);
}
.tree-btn:hover {
  background-color: var(--darkhover1);
}
.tree-btn:active {
  background-color: var(--darkactive1);
}
.tree-btn.is-active {
  background-color: var(--darkactive1);
}

/* Information + details container*/

/* === Sidepanel (right) === */
.information {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 0; /* collapsed state */
  background-color: var(--darkgray2);
  overflow: hidden;
  transition: width 0.3s ease-in-out;
  z-index: 1001;
  border-left: 1px solid var(--darkborder2);
}

.information:not(.collapsed) {
  width: 400px; /* always 400px wide when open */
  min-width: 400px; /* enforce min width */
}

/* Legacy compatibility: some runtimes toggle `expanded` instead of removing `collapsed`. */
.information.expanded {
  width: 400px;
  min-width: 400px;
  transform: translateX(0);
}

.information.collapsed {
  width: 0;
}

/* === Details panel (left, next to aside) === */
.information_details {
  position: fixed;
  top: 0;
  right: 400px; /* exactly next to sidebar */
  height: 100%;
  width: 0;
  background-color: rgb(50, 50, 50);
  overflow: hidden;
  z-index: 100; /* behind the sidepanel */
}

/* when open */
.information_details.open {
  width: calc(100% - 400px); /* take up the remaining space */
}

.details-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Close button top-right */
.details-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  border-radius: 50px;
  border: 1px solid transparent;
  background-color: var(--darkgray1);
}
.details-close:hover {
  border: 1px solid rgb(80, 80, 80);
  background-color: var(--darkgray1_hover);
}
.details-close:active {
  border: 1px solid rgb(80, 80, 80);
  background-color: var(--darkgray1_active);
}
.details-close img {
  width: 14px;
  height: 14px;
}

/* Top slideshow = 50% */
.details-slideshow {
  flex: 1 1 50%;
  max-height: 50%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-snap-type: x mandatory;
  background-color: var(--darkgray2);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.details-slideshow::-webkit-scrollbar {
  display: none;
}
.slideshow-track {
  display: flex;
  justify-content: flex-start;
  height: 100%;
}
.slideshow-media {
}
.slide {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  height: 100%;
  margin-right: 20px; /* small gap */
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide img {
  width: auto;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: left top;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 120ms ease;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.slide img:hover {
  border-color: rgb(180, 180, 180);
}
.slide img:active {
  border-color: rgb(255, 255, 255);
}

.details-info {
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 20px;
  color: #fff;
  flex: 1 1 50%;
  min-height: 0; /* allow flex container to shrink properly */
  overflow-y: auto;
}

/* Use ratios: 1 : 2 : 1 and allow shrinking */
.info-left,
.info-center,
.info-right {
  flex: 1 1 0; /* base 0 makes the ratio exact */
  min-width: 0; /* prevent overflow from long content */
  background-color: var(--darkgray2);
  padding: 20px;
  border-radius: 15px;
}
.info-center {
  flex: 2 1 0;
}

/* Inside center: 50 / 50 */
.bnr-columns {
  display: flex;
  gap: 16px;
}
.detail_bnr_left,
.detail_bnr_right {
  flex: 1 1 0;
  min-width: 0;
}

/* Responsive stack (optional) */
@media (max-width: 1024px) {
  .details-info {
    flex-wrap: wrap;
  }
  .info-left,
  .info-center,
  .info-right {
    flex: 1 1 100%;
  }
  .bnr-columns {
    flex-wrap: wrap;
  }
}

/* buildings panel */

#buildings_panel {
}

/* -- MISC -- */

.hidden {
  display: none;
}

@media screen and (max-width: 950px) {
  .information {
    width: 100vw !important;
    height: 0;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    z-index: 1000;
    border-top: 1px solid var(--darkborder2);
  }

  .information:not(.collapsed) {
    height: 70vh;
    height: 70dvh;
    max-width: none;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }

  .information.expanded {
    width: 100vw !important;
    height: 70vh;
    height: 70dvh;
    max-width: none;
  }

  .information.collapsed {
    transform: none;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden;
    padding: 0;
    border-top: 0;
  }

  #toggle_menu_buttons {
    display: flex;
  }

  .menu-toggleable {
    display: none;
  }
  #toggle_fullscreen {
    display: none !important;
  }

  .woningzoeker-button {
    padding: 12px 14px;
    font-size: 0.8rem;
  }

  /* Mobile layout when apartment details are open */
  .layout_body.mobile-details-open .information:not(.collapsed) {
    height: 10vh;
    height: 10dvh;
  }

  .layout_body.mobile-details-open .information_details {
    left: 0;
    right: 0;
    width: 100vw;
    top: 0;
    height: 90vh;
    height: 90dvh;
    max-height: 90vh;
    max-height: 90dvh;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    z-index: 1100;
  }

  .layout_body.mobile-details-open .information_details.open {
    width: 100vw;
  }

  .layout_body.mobile-details-open .details-container {
    height: 100%;
  }

  .layout_body.mobile-details-open .details-slideshow {
    flex: 0 0 25%;
    max-height: 25%;
  }

  .layout_body.mobile-details-open .details-info {
    flex: 0 0 75%;
    overflow-y: auto;
  }

  .layout_body.mobile-details-open.mobile-filter-expanded .information:not(.collapsed) {
    height: 65vh;
    height: 65dvh; /* leaves ~45vh at the top */
    max-height: 65vh;
    max-height: 65dvh;
    z-index: 1300; /* sit above details */
  }

  .panel_handle {
    display: block;
  }

  .layout_body.mobile-details-open .details-slideshow .slide img {
    width: auto;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: left top;
    border-radius: 10px;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
  }

  .layout_body.mobile-details-open .details-slideshow .slide {
    align-items: flex-start;
    justify-content: flex-start;
  }
}
