:root {
  --primary-bg: #000;
  --primary-text: #fff;

  /* MODIFIED: Softer background */
  --menu-bg: rgb(20 20 20 / 92%);
  --menu-hover: rgb(255 255 255 / 20%);
  --menu-active: rgb(255 255 255 / 30%);
  --accent-color: #4caf50;
  --warning-color: #f44336;
  --edge-marker-bg: #2196f3;

  /* NEW: For Firefox dropdown colors */
  --select-bg: rgb(255 255 255 / 10%);

  /* NEW: Colors & Shadows */
  --secondary-color: #6c757d;
  --menu-shadow: 0 4px 12px rgb(0 0 0 / 50%);
}

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

body {
  /* MODIFIED: Modern font stack */
  font-family: var(--font-family-base);
  background: var(--primary-bg);
  color: var(--primary-text);
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Intro Animation */
.intro-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999; /* Below header (1000) to allow header clicks */
  transition: opacity 1s ease;
  pointer-events: none; /* Don't block clicks by default */
}

.intro-container.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-logo {
  width: var(--intro-logo-size);
  height: var(--intro-logo-size);
  position: relative;
  pointer-events: auto; /* Enable clicks on logo area */
}

.intro-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.intro-bottom-half {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;

  /* Allows clicks to pass through */
}

img.intro-icon-overlay {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: var(--intro-icon-size);
  height: var(--intro-icon-size);
  opacity: 0;
  transition: opacity 0.5s ease;
  object-fit: contain;
  display: block;
}

.intro-icon-overlay.visible {
  opacity: 1;
}

.skip-intro-btn {
  position: absolute;
  bottom: 84px;
  right: 40px;
  background: var(--menu-bg);
  color: var(--primary-text);
  border: 1px solid var(--primary-text);
  border-radius: 0.25em;
  padding: 0.625em 1.25em;
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.8s ease,
    transform 0.2s ease;
  z-index: 1100;
  pointer-events: auto; /* Enable clicks on button */
}

.skip-intro-btn:hover {
  background: var(--menu-hover);
  transform: scale(1.05);
}

.skip-intro-btn.visible {
  opacity: 1;
}

/* --- NEW: Custom Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-alert-modal);
  opacity: 1;
  transition: opacity 0.3s ease;
  padding: var(--space-md);
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e3e8ef);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25em;
  max-width: min(420px, 92vw);
  font-size: var(--text-md);
  text-align: center;
  box-shadow: var(--shadow-lg, 0 12px 32px rgb(15 23 42 / 18%));
  font-family: var(--font-family-base);
  color: var(--color-ink, #0f172a);
}

.modal-content button {
  background: linear-gradient(180deg, var(--booking-bg-dark), var(--booking-bg-dark));
  color: var(--booking-surface);
  border-color: rgb(32 32 32 / 80%);
  border-radius: 0.625em;
  padding: 0.625em 0.875em;
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  box-shadow: 0 6px 16px rgb(15 23 42 / 16%);
  height: auto;
  min-height: 2.75em;
}

.modal-content button:hover {
  filter: brightness(1.05);
}


/* Main Menu */
.menu-container {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.menu-container.visible {
  opacity: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.menu-btn {
  width: 3.75em;
  height: 3.75em;
  background: var(--menu-bg);
  border: 1px solid var(--primary-text);
  border-radius: 0.25em;
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--primary-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.menu-btn:hover {
  background: var(--menu-hover);
  transform: scale(1.05);
}

.menu-btn.active {
  background: var(--menu-active);
}

.menu-btn img {
  max-width: 70%;
  max-height: 70%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.menu-label {
  position: absolute;
  left: calc(100% + 10px);
  background: var(--menu-bg);
  padding: 0.3125em 0.625em;
  border-radius: 0.25em;
  white-space: nowrap;
  max-width: min(200px, calc(100vw - 80px));
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--primary-text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 505;
}

/* --- Tooltip Behavior --- */

/* 1. Default state: labels are hidden (defined above in .menu-label) */

/* 2. On-Launch state: Show all labels */
.menu-container.show-all-tooltips .menu-label {
  opacity: 1;
}

/* 3. Single-Hover state: Show only the hovered label */
.menu-container.show-single-tooltip .menu-item.show-tooltip .menu-label {
  opacity: 1;
}

/* --- END Tooltip Behavior --- */

/* Submenu */
.submenu {
  display: flex;
  gap: var(--space-sm);
  margin-left: 0.625em;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.submenu.visible {
  max-width: 400px;
  opacity: 1;
  overflow: visible;
}

.submenu-btn {
  width: 2.5em;
  height: 2.5em;
  background: var(--menu-bg);
  border: 1px solid var(--primary-text);
  border-radius: 0.25em;
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--primary-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.submenu-btn:hover {
  background: var(--menu-hover);
  transform: scale(1.05);
}

.submenu-btn.active {
  background: var(--menu-active);
  border-color: var(--accent-color);
}

.submenu-btn img {
  max-width: 70%;
  max-height: 70%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.submenu-tooltip {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--menu-bg);
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
  white-space: nowrap;
  max-width: min(250px, calc(100vw - 40px));
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-family-base);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--primary-text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s;
  z-index: 520;
}

.submenu-btn:hover .submenu-tooltip {
  opacity: 1;
  visibility: visible;
}


.custom-div-icon {
  background: var(--poi-container-bg);
  border: none;
  border-radius: 50%;
  width: var(--size-poi-container) !important;
  height: var(--size-poi-container) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.full-size-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}



/* Use a generic class for buttons, inputs, and selects */
.poi-menu-btn {
  background: var(--menu-hover);
  color: var(--primary-text);
  border: 1px solid var(--primary-text);
  border-radius: 0.25em;
  padding: 0.5em 0.625em;
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;

  /* MODIFIED: Added transition */
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    filter 0.2s ease;
  flex-grow: 1;
  box-sizing: border-box;
  height: auto;
  min-height: 2.75em;
}

.poi-menu-btn:not(:disabled):hover {
  /* MODIFIED: Added hover effect */
  transform: scale(1.03);
  filter: brightness(1.1);
}


.poi-menu-btngroup .poi-menu-btn {
  flex-basis: 150px; /* Allow buttons to stack on narrow panel */
}

/* --- Logo Overlap Styles --- */

.permanent-logo-icon {
  position: relative;
}

.logo-overlap-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-color);
  color: var(--color-button-label);
  font-size: var(--text-base);
  font-weight: bold;
  border-radius: 50%;
  padding: 0.25em;
  min-width: 1.5em;
  height: 1.5em;
  box-sizing: border-box;
  text-align: center;
  line-height: 1em;
  border: 1px solid white;
  z-index: 10;
  display: none;
}

.permanent-logo-icon::before,
.permanent-logo-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 80%);
  z-index: -1;
  opacity: 0;
  transition: all 0.3s ease;
  box-sizing: content-box;
  padding: 0.25em;
}

.permanent-logo-icon::after {
  border-color: rgb(255 255 255 / 50%);
  padding: var(--space-sm);
}

.permanent-logo-icon.logo-is-overlapping::before,
.permanent-logo-icon.logo-is-overlapping::after {
  width: 100%;
  height: 100%;
  opacity: 1;
}

/* --- End Logo Overlap --- */

/* --- NEW: Media Query for Mobile/Narrow Screens --- */
@media (width <= 768px) {
  #poiMenuContainer,
  #bookingFilterContainer {
    /* Override desktop styles */
    width: auto; /* Fill available space */
    min-width: 0;
    max-width: none;
    left: 10px;
    right: 10px;
    top: 70px; /* Position below top-left logo */
    max-height: calc(100vh - 80px);   /* Fill height with padding — fallback */
    max-height: calc(100dvh - 80px);  /* dynamic: correct as chrome toggles */
  }

  .menu-container {
    top: auto;
    bottom: 20px; /* Move main menu to bottom-left */
    transform: none;
  }

  #homeBtn {
    top: 10px;
    right: 10px;
  }

  #resetBtn {
    top: 0.625em;
    left: 0.625em;
    width: 6.25em;
    height: 6.25em;
  }
}

/* --- END Media Query --- */

/* ===== Utility Classes (replacing inline styles for CSP compliance) ===== */
.modal-close-btn {
  width: 100px;
  margin-top: 15px;
}

.edit-poi-modal {
  width: 400px;
  max-width: 90%;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}
