/* Custom Animations, Safe-Area Utilities, & Glassmorphism Helpers */
body.auth-pending {
  visibility: hidden;
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulseSoft {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-float-slow {
  animation: floatSlow 5s ease-in-out infinite;
}

.animate-pulse-soft {
  animation: pulseSoft 2.8s ease-in-out infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Safe-Area Inset for Mobile Bottom Navigation */
.pb-safe {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.mb-safe-nav {
  margin-bottom: calc(4.75rem + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .mb-safe-nav {
    margin-bottom: 2rem;
  }
}

/* Custom Subtle Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #FFF9F5;
}

::-webkit-scrollbar-thumb {
  background: #FBCFE0;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #E8799A;
}

/* Leaflet map markers and popups */
.leaflet-container {
  font-family: "Plus Jakarta Sans", sans-serif;
}

.ourspace-map-marker {
  background: transparent;
  border: 0;
}

.ourspace-map-marker__pin {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  box-shadow: 0 5px 16px rgba(69, 52, 61, 0.3);
  color: #fff;
  transform: rotate(-45deg);
}

.ourspace-map-marker__pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: inherit;
}

.ourspace-map-marker__pin span {
  z-index: 1;
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 700;
  transform: rotate(45deg);
}

.ourspace-map-marker__pin--1 {
  background: linear-gradient(145deg, #f295b0, #e8799a);
}

.ourspace-map-marker__pin--2 {
  background: linear-gradient(145deg, #ad9bdd, #8069bd);
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(251, 207, 224, 0.9);
  border-radius: 16px;
}

.leaflet-popup-content {
  margin: 12px 16px;
}

@media (max-width: 767px) {
  body:has(#location-page-main) {
    overflow-x: hidden;
  }

  #location-page-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 calc(1rem + env(safe-area-inset-bottom));
    gap: 1rem;
  }

  #location-map-panel {
    width: 100%;
    height: calc(100svh - 8.5rem);
    min-height: 480px;
    max-height: 820px;
    border-right: 0;
    border-left: 0;
    border-radius: 0 0 1.5rem 1.5rem;
    box-shadow: 0 12px 28px -18px rgba(69, 52, 61, 0.35);
  }

  #location-map-panel > .absolute.top-4 {
    top: max(0.75rem, env(safe-area-inset-top));
    right: 0.75rem;
    left: 0.75rem;
    gap: 0.5rem;
  }

  #location-map-panel > .absolute.top-4 > div {
    max-width: calc(100% - 3.25rem);
    padding: 0.75rem;
    border-radius: 1.25rem;
  }

  #location-map-panel h1 {
    margin-top: 0.35rem;
    font-size: clamp(1.05rem, 5vw, 1.35rem);
    line-height: 1.2;
  }

  #location-map-panel > .absolute.top-4 > button {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
  }

  #location-map-panel > .absolute.bottom-5 {
    right: 0.75rem;
    bottom: max(0.9rem, env(safe-area-inset-bottom));
    left: 0.75rem;
    gap: 0.5rem;
  }

  #location-map-panel > .absolute.bottom-5 > div:first-child {
    max-width: calc(100% - 3.25rem);
    padding: 0.65rem 0.75rem;
  }

  #location-map-panel > .absolute.bottom-5 > div:last-child {
    gap: 0.4rem;
  }

  #location-map-panel > .absolute.bottom-5 button {
    width: 2.65rem;
    height: 2.65rem;
  }

  #location-page-main > section:not(#location-map-panel) {
    margin-right: 0.75rem;
    margin-left: 0.75rem;
  }

  #location-page-main > section:not(#location-map-panel) article,
  #location-page-main > section:not(#location-map-panel) > div {
    padding: 1rem;
    border-radius: 1.25rem;
  }

  .location-bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  .leaflet-control-attribution {
    max-width: 72%;
    font-size: 8px;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.78);
  }
}