/* Complete removal of map/bubble animations and mobile popup fixes */

/* Remove ALL blur effects from page */
*, *::before, *::after {
  backdrop-filter: none !important;
  filter: none !important;
}

/* Specifically target headers and sticky elements */
.sticky-header, .fixed-header, .nav-bar, .navigation, .header,
[class*="header"], [class*="nav"], [class*="sticky"], [class*="fixed"] {
  backdrop-filter: none !important;
  filter: none !important;
}

/* Remove any overlaying pseudo-elements that might cause blur */
.colorful-map-modal::before,
.colorful-map-container::before,
.colorful-map-container::after,
.colorful-map-info::before,
.modern-footer::before {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Ensure no semi-transparent overlays are blocking interaction */
div[style*="opacity"], div[style*="filter"], div[style*="backdrop-filter"] {
  opacity: 1 !important;
  filter: none !important;
  backdrop-filter: none !important;
}

/* Hide all bubble and interactive elements completely */
.bubble, .nav-bubble, .hero-bubble, .school-bubble, .daycare-bubble, .interactive-element,
.floating-cloud, .floating-butterfly, .floating-bird, .sparkle, .floating-text,
.bubble-ripple, .colorful-map-modal, .map-modal, .animated-map-pin {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Disable all bubble animations */
@keyframes bubblePulse,
@keyframes daycareSpecial,
@keyframes elementSpin,
@keyframes schoolBounce,
@keyframes pinBounce,
@keyframes floatUp,
@keyframes floatDown,
@keyframes sparkleShine {
  from, to { opacity: 0; transform: scale(0); }
}

/* Override Tour Form Modal for Mobile - Maximum Priority */
#tour-form-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 50 !important;
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: none !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Ensure modal content is properly sized and positioned */
#tour-form-modal .modal-content {
  position: relative !important;
  z-index: 50 !important;
  background: white !important;
  border-radius: 16px !important;
  width: 100% !important;
  max-width: 500px !important;
  max-height: 85vh !important;
  overflow: hidden !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6) !important;
  margin: auto !important;
}

/* Ensure headers stay above modal on mobile */
.mobile-sticky-header,
.desktop-header,
.modern-header,
.sticky-header-container,
.mobile-portal-buttons {
  z-index: 100 !important;
}

/* Mobile specific adjustments - Below floating header */
@media screen and (max-width: 767px) {
  #tour-form-modal {
    z-index: 50 !important;
    align-items: flex-start !important;
    padding: 0 !important;
    padding-top: 100px !important; /* Push below mobile sticky header */
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    justify-content: center !important;
  }
  
  #tour-form-modal .modal-content {
    z-index: 50 !important;
    max-height: calc(100vh - 120px) !important;
    width: 100% !important;
    max-width: 95% !important;
    margin: 0 auto !important;
    overflow-y: auto !important;
  }
  
  #tour-form-modal .modal-header {
    z-index: 50 !important;
    display: flex !important;
    background: linear-gradient(135deg, #253b70 0%, #1a2b5c 100%) !important;
    color: white !important;
    padding: 1.2rem !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    flex-shrink: 0 !important;
  }
  
  #tour-form-modal .modal-header h2 {
    color: white !important;
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
  }
  
  #tour-form-modal .modal-close {
    z-index: 50 !important;
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 1.8rem !important;
    cursor: pointer !important;
    padding: 0.25rem !important;
    line-height: 1 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Ensure modal body can scroll if content is too long */
  #tour-form-modal .modal-body {
    max-height: calc(100vh - 220px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1.2rem !important;
  }
}

/* When modal is shown */
#tour-form-modal.show {
  display: flex !important;
}



#tour-form-modal .modal-header {
  position: relative !important;
  z-index: 50 !important;
  background: linear-gradient(135deg, #253b70 0%, #1a2b5c 100%) !important;
  color: white !important;
  padding: 1.5rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

#tour-form-modal .modal-header h2 {
  color: white !important;
  margin: 0 !important;
  font-size: 1.2rem !important;
  font-weight: 600 !important;
}

#tour-form-modal .modal-close {
  position: relative !important;
  z-index: 50 !important;
  background: none !important;
  border: none !important;
  color: white !important;
  font-size: 1.8rem !important;
  cursor: pointer !important;
  padding: 0.25rem !important;
  line-height: 1 !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: background-color 0.2s ease !important;
}

#tour-form-modal .modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

#tour-form-modal .modal-body {
  position: relative !important;
  z-index: 2147483647 !important;
  padding: 1.5rem !important;
  overflow-y: auto !important;
  max-height: calc(90vh - 120px) !important;
}

#tour-form-modal .tour-form,
#tour-form-modal .form-group,
#tour-form-modal .form-group input,
#tour-form-modal .form-group select,
#tour-form-modal .form-group label,
#tour-form-modal .submit-btn {
  position: relative !important;
  z-index: 2147483647 !important;
}

/* Mobile specific overrides */
@media (max-width: 768px) {
  /* Body lock when modal is open */
  html.modal-open,
  body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
  }

  #tour-form-modal {
    padding: 0.75rem !important;
  }

  #tour-form-modal .modal-content {
    width: calc(100% - 1.5rem) !important;
    max-width: 420px !important;
    border-radius: 12px !important;
  }

  #tour-form-modal .modal-header {
    padding: 1rem !important;
  }

  #tour-form-modal .modal-header h2 {
    font-size: 1.1rem !important;
  }

  #tour-form-modal .modal-body {
    padding: 1rem !important;
    max-height: calc(90vh - 100px) !important;
  }

  #tour-form-modal .form-group {
    margin-bottom: 1rem !important;
  }

  #tour-form-modal .form-group input,
  #tour-form-modal .form-group select {
    padding: 0.75rem !important;
    font-size: 16px !important; /* Prevent zoom on iOS */
  }

  #tour-form-modal .submit-btn {
    width: 100% !important;
    padding: 0.875rem !important;
    font-size: 1rem !important;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  #tour-form-modal {
    padding: 0.5rem !important;
  }

  #tour-form-modal .modal-content {
    width: calc(100% - 1rem) !important;
    max-width: 360px !important;
  }
}