/* Custom Real Estate MLS Styles & Leaflet Map Enhancements */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #0f172a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --emerald: #059669;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Leaflet Map Custom Price Markers */
.custom-price-marker {
  background: transparent;
  border: none;
}

.marker-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
  border: 2px solid #ffffff;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.marker-pill::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.marker-pill.rent {
  background: #0284c7;
}
.marker-pill.rent::after {
  border-color: #0284c7 transparent transparent transparent;
}

.marker-pill:hover,
.marker-pill.active {
  background: #2563eb;
  color: #ffffff;
  transform: scale(1.15) translateY(-2px);
  z-index: 1000;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

.marker-pill.active::after,
.marker-pill:hover::after {
  border-color: #2563eb transparent transparent transparent;
}

/* Custom Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.leaflet-popup-content {
  margin: 0;
  width: 260px !important;
  line-height: 1.5;
}

.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  background: rgba(15, 23, 42, 0.7) !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.leaflet-popup-close-button:hover {
  background: rgba(15, 23, 42, 0.95) !important;
}

/* Animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-modal {
  animation: fadeInScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Glassmorphic elements */
.glass-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Image gallery hero aspect ratios */
.hero-gallery-main {
  aspect-ratio: 16 / 10;
}

/* Card image zoom effect */
.property-card:hover .card-img {
  transform: scale(1.05);
}

.card-img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badges */
.badge-sale {
  background: #0f172a;
  color: #f8fafc;
}

.badge-rent {
  background: #0284c7;
  color: #ffffff;
}

/* Ensure map does not conflict with modals */
.leaflet-pane {
  z-index: 40 !important;
}
.leaflet-top,
.leaflet-bottom {
  z-index: 45 !important;
}

/* Responsive height for map container */
#mainMap {
  height: calc(100vh - 150px);
  min-height: 480px;
}

@media (max-width: 1024px) {
  #mainMap {
    height: 420px;
    min-height: 360px;
  }
}

/* Realtor pin picker map */
#realtorMapPicker {
  height: 280px;
  width: 100%;
  border-radius: 12px;
}

#propertyDetailMap {
  height: 240px;
  width: 100%;
  border-radius: 12px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

