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

:root {
  --font-thai: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'Prompt', sans-serif;
  --color-primary: #059669;
  --color-sindhorn: #e11d48;
}

body {
  font-family: var(--font-thai);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-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;
}

/* Radar Beacon Animation for Sindhorn Tower */
.sindhorn-beacon-container {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sindhorn-floating-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.5);
  pointer-events: none;
  z-index: 30;
  letter-spacing: 0.02em;
}
.sindhorn-floating-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #9f1239 transparent transparent transparent;
}

.sindhorn-beacon-core {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  border: 3.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 10;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sindhorn-beacon-core:hover {
  transform: scale(1.18);
}

.sindhorn-beacon-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.45);
  animation: radar-pulse 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

.sindhorn-beacon-ring.delayed {
  animation-delay: 1.1s;
}

@keyframes radar-pulse {
  0% {
    width: 40px;
    height: 40px;
    opacity: 0.85;
  }
  100% {
    width: 110px;
    height: 110px;
    opacity: 0;
  }
}

/* Custom Property Markers - High Visibility */
.custom-property-pin-wrapper {
  background: transparent !important;
  border: none !important;
}
.custom-property-pin-wrapper .prop-marker-pin {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}
.prop-marker-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border: 2.5px solid #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
  line-height: 1.25;
}

.prop-marker-pin .badge-price {
  background: rgba(0, 0, 0, 0.28);
  padding: 1.5px 7px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.prop-marker-pin:hover {
  transform: scale(1.18) translateY(-4px);
  z-index: 9999 !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}

.prop-marker-pin.active {
  transform: scale(1.24) translateY(-6px);
  box-shadow: 0 0 0 4px #fbbf24, 0 10px 24px rgba(0, 0, 0, 0.45);
  z-index: 10000 !important;
}

/* Scaled font sizes for user accessibility */
.marker-size-lg .prop-marker-pin {
  padding: 6.5px 14px;
  font-size: 14.5px;
  border-width: 3px;
}
.marker-size-lg .prop-marker-pin .badge-price {
  font-size: 13px;
  padding: 2px 8px;
}

.marker-size-xl .prop-marker-pin {
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 800;
  border-width: 3px;
}
.marker-size-xl .prop-marker-pin .badge-price {
  font-size: 14.5px;
  padding: 2.5px 9px;
}

/* Type Colors */
.pin-dorm {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}
.pin-apartment {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}
.pin-condo {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.pin-luxury {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

/* Landmark Marker */
.landmark-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #475569;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.landmark-pin:hover {
  transform: scale(1.2);
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.leaflet-popup-content {
  margin: 0;
  line-height: 1.5;
  font-family: var(--font-thai);
}
.leaflet-popup-tip-container {
  overflow: visible;
}
.leaflet-popup-tip {
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(0,0,0,0.15);
}
.leaflet-container a.leaflet-popup-close-button {
  top: 10px;
  right: 10px;
  color: #64748b;
  padding: 4px;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  z-index: 20;
}
.leaflet-container a.leaflet-popup-close-button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Zone Circle Labels */
.zone-label-tooltip {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.zone-label-tooltip::before {
  display: none;
}

/* Card Active Highlight */
.property-card.active-card {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px #f59e0b, 0 12px 24px -6px rgba(245, 158, 11, 0.25) !important;
  transform: translateY(-2px);
}

/* Badge animations */
.badge-pulse {
  animation: badge-pulse-anim 2s infinite;
}
@keyframes badge-pulse-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Modal Transitions */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100005 !important;
}

/* Toast Notifications */
#toast-container {
  z-index: 100010 !important;
}

.toast-pill {
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive map container transitions */
#map-container {
  transition: height 0.3s ease, width 0.3s ease;
}

/* Map Fullscreen Mode */
#map-container.map-fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* Floating Quick Toolbar inside Map */
.map-quick-toolbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Floating Drawer for Fullscreen Mode */
#fullscreen-drawer {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#fullscreen-drawer.drawer-closed {
  transform: translateX(100%);
}

/* Color Filter Buttons in Map Quick Bar */
.color-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  color: #475569;
  cursor: pointer;
}

.color-filter-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}

.color-filter-btn.active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.color-filter-btn[data-color-btn="all"].active {
  color: #0f172a;
  border-color: #cbd5e1;
}

.color-filter-btn[data-color-btn="dorm"].active {
  color: #6d28d9;
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.color-filter-btn[data-color-btn="apartment"].active {
  color: #0369a1;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.color-filter-btn[data-color-btn="condo"].active {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.color-filter-btn[data-color-btn="luxury"].active {
  color: #c2410c;
  border-color: #fed7aa;
  background: #fff7ed;
}

/* Legend Interactive Toggle Buttons in #map-layer-box */
.legend-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4.5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1.5px solid transparent;
  user-select: none;
}

.legend-toggle-btn:hover {
  transform: translateY(-1px);
}

.legend-toggle-btn.is-active.legend-dorm {
  background: #f5f3ff;
  border-color: #8b5cf6;
  color: #5b21b6;
}

.legend-toggle-btn.is-active.legend-apartment {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #075985;
}

.legend-toggle-btn.is-active.legend-condo {
  background: #ecfdf5;
  border-color: #059669;
  color: #065f46;
}

.legend-toggle-btn.is-active.legend-luxury {
  background: #fff7ed;
  border-color: #ea580c;
  color: #9a3412;
}

.legend-toggle-btn.is-disabled {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
  opacity: 0.65;
}

.legend-toggle-btn.is-disabled .legend-dot {
  background-color: #cbd5e1 !important;
}

.legend-toggle-btn.is-disabled .legend-count-badge {
  background: #e2e8f0;
  color: #64748b;
  text-decoration: line-through;
}

