/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== ROOT VARIABLES ===== */
:root {
  --navy: #0d1117;
  --navy-2: #161b22;
  --navy-3: #21262d;
  --navy-4: #30363d;
  --gold: #d4a843;
  --gold-light: #f0c060;
  --gold-dark: #b8902e;
  --white: #ffffff;
  --white-60: rgba(255,255,255,0.6);
  --white-40: rgba(255,255,255,0.4);
  --white-20: rgba(255,255,255,0.2);
  --white-10: rgba(255,255,255,0.1);
  --white-05: rgba(255,255,255,0.05);
  --green: #2ea043;
  --blue: #1f6feb;
  --red: #f85149;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--navy-2); }
::-webkit-scrollbar-thumb { background: var(--navy-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ===== HEADER ===== */
header {
  background: var(--navy);
  border-bottom: 1px solid var(--navy-3);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  gap: 16px;
}

/* ===== LOGO ===== */
#logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

#logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.logo-highlight {
  color: var(--gold);
}

/* ===== SEARCH ===== */
#search-container {
  display: flex;
  align-items: center;
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: 25px;
  padding: 0 6px 0 14px;
  gap: 8px;
  transition: var(--transition);
  flex: 1;
  max-width: 380px;
  height: 38px;
}

#search-container:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}

.search-icon {
  color: var(--white-40);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  width: 100%;
  font-weight: 400;
}

#search-input::placeholder {
  color: var(--white-40);
}

#search-button {
  padding: 6px 14px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
  height: 28px;
  display: flex;
  align-items: center;
}

#search-button:hover {
  background: var(--gold-light);
  transform: scale(1.02);
}

/* ===== HEADER RIGHT ===== */
#header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ===== MAILBOX BUTTON ===== */
#mailbox-btn {
  position: relative;
  width: 34px;
  height: 34px;
  background: transparent;
  color: var(--white-60);
  border: 1px solid var(--navy-4);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

#mailbox-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dark);
  background: rgba(212,168,67,0.08);
}

#mailbox-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--navy);
  font-family: 'Inter', sans-serif;
}

/* ===== LIST PROPERTY BUTTON ===== */
#add-property-btn {
  padding: 7px 16px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
}

#add-property-btn:hover {
  background: rgba(212,168,67,0.1);
  border-color: var(--gold);
}

/* ===== UPGRADE PLAN BUTTON ===== */
#upgrade-plan-btn {
  padding: 7px 16px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
  height: 34px;
  align-items: center;
}

#upgrade-plan-btn:hover {
  background: var(--gold);
  color: var(--navy);
}

/* ===== USER MENU ===== */
#user-menu {
  position: relative;
}

#user-menu-btn {
  padding: 6px 14px;
  background: var(--navy-2);
  color: var(--white);
  border: 1px solid var(--navy-4);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
}

#user-menu-btn:hover {
  border-color: var(--white-40);
  background: var(--navy-3);
}

/* ===== DROPDOWN ===== */
#user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-md);
  min-width: 190px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 2000;
}

#user-dropdown.active {
  display: block;
  animation: dropdown-in 0.15s ease;
}

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

.dropdown-item {
  padding: 10px 16px;
  color: var(--white-60);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-bottom: 1px solid var(--navy-3);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--navy-3);
  color: var(--white);
}

.dropdown-item.danger {
  color: var(--red);
}

.dropdown-item.danger:hover {
  background: rgba(248,81,73,0.08);
}

.dropdown-divider {
  height: 1px;
  background: var(--navy-3);
}

/* ===== MAIN CONTENT ===== */
#main-content {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: 340px;
  min-width: 340px;
  height: 100%;
  max-height: 100%;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--navy-3);
  z-index: 900;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent, #0d1117);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s ease;
}

#sidebar.at-bottom::after {
  opacity: 0;
}

#sidebar.collapsed {
  margin-left: -340px;
  border-right: none;
}

#sidebar-toggle {
  position: absolute;
  left: 340px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 60px;
  background: #161b22;
  border: 1px solid #21262d;
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 0;
  flex-shrink: 0;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
}

#sidebar-toggle:hover {
  background: #21262d;
  color: #ffffff;
}

#sidebar-toggle-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.collapsed ~ #sidebar-toggle {
  left: 0;
}

#sidebar.collapsed ~ #sidebar-toggle #sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* Tooltip hint */
#sidebar-tooltip {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #21262d;
  color: rgba(255,255,255,0.7);
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-family: Inter, sans-serif;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

#sidebar-tooltip.visible {
  opacity: 1;
}

/* ===== SIDEBAR HEADER ===== */
#sidebar-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--navy-3);
  flex-shrink: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

#sidebar-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.2px;
}

#property-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: var(--gold);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

/* ===== SIDEBAR FILTERS ===== */
#sidebar-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--navy-3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--navy-2);
  flex-shrink: 0;
}

#filter-container {
  display: flex;
  gap: 6px;
}

.filter-btn {
  flex: 1;
  padding: 6px 10px;
  background: var(--navy-3);
  color: var(--white-60);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.filter-btn:hover {
  background: var(--navy-4);
  color: var(--white);
}

.filter-btn.active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

#price-select {
  width: 100%;
  padding: 7px 12px;
  background: var(--navy-3);
  color: var(--white-60);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  outline: none;
  appearance: none;
  transition: var(--transition);
}

#price-select:focus {
  border-color: var(--gold);
  color: var(--white);
}

#price-select option {
  background: var(--navy-2);
  color: var(--white);
}

/* ===== PROPERTY LIST ===== */
#property-list {
  overflow-y: scroll !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #30363d transparent;
}

#property-list::-webkit-scrollbar {
  width: 3px;
}
#property-list::-webkit-scrollbar-track {
  background: transparent;
}
#property-list::-webkit-scrollbar-thumb {
  background: #21262d;
  border-radius: 4px;
}
#property-list::-webkit-scrollbar-thumb:hover {
  background: #d4a843;
}
body.light-mode #property-list::-webkit-scrollbar-thumb {
  background: #d0d7de;
}
body.light-mode #property-list::-webkit-scrollbar-thumb:hover {
  background: #d4a843;
}

/* ===== PROPERTY CARD — AIRBNB STYLE ===== */
.property-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  flex-shrink: 0;
}

.property-card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.property-card-image {
  height: 100px;
  background: var(--navy-3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.property-card-image-placeholder {
  font-size: 28px;
  opacity: 0.15;
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .property-card-image img {
  transform: scale(1.05);
}

.property-card-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.badge-rent-overlay {
  background: rgba(46,160,67,0.85);
  color: white;
}

.badge-sale-overlay {
  background: rgba(31,111,235,0.85);
  color: white;
}

.property-card-body {
  padding: 10px 12px 12px;
}

.property-card-location {
  font-size: 11px;
  color: var(--white-40);
  font-weight: 500;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.3px;
}

.property-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.4;
  overflow: hidden;
  max-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.property-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.property-card-price {
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.3px;
}

.property-card-views {
  font-size: 11px;
  color: var(--white-40);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ===== MAP ===== */
#map {
  flex: 1;
  height: 100%;
}

/* ===== LEAFLET POPUPS ===== */
.leaflet-popup-content-wrapper {
  background: var(--navy-2) !important;
  border: 1px solid var(--navy-4) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  padding: 0 !important;
  overflow: hidden;
  color: var(--white) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 16px !important;
  min-width: 200px !important;
}

.leaflet-popup-tip-container {
  display: none !important;
}

.leaflet-popup-close-button {
  color: var(--white-60) !important;
  font-size: 16px !important;
  padding: 8px !important;
}

/* ===== ANIMATED MARKERS ===== */
.custom-marker {
  background: transparent;
  border: none;
}

.marker-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

.marker-rent .marker-pulse {
  background: rgba(46,160,67,0.25);
}

.marker-sale .marker-pulse {
  background: rgba(31,111,235,0.25);
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

.marker-pin {
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: marker-drop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* For Rent — teardrop, green */
.marker-rent .marker-pin {
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #3fb950, #238636);
  box-shadow: 0 4px 16px rgba(46,160,67,0.55), 0 2px 6px rgba(0,0,0,0.3);
}

/* For Sale — diamond (square rotated), blue */
.marker-sale .marker-pin {
  border-radius: 4px;
  background: linear-gradient(135deg, #2d88ff, #1158c7);
  box-shadow: 0 4px 16px rgba(31,111,235,0.55), 0 2px 6px rgba(0,0,0,0.3);
}

.marker-icon {
  transform: rotate(45deg);
  font-size: 14px;
}

.marker-price {
  background: var(--navy);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  padding: 3px 8px;
  border-radius: 8px;
  margin-top: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 1px solid var(--navy-4);
  letter-spacing: 0.3px;
}

@keyframes marker-drop {
  0% { transform: rotate(-45deg) translateY(-20px); opacity: 0; }
  60% { transform: rotate(-45deg) translateY(4px); }
  100% { transform: rotate(-45deg) translateY(0); opacity: 1; }
}

/* ===== FEATURED MARKER ===== */
.marker-featured .marker-pulse {
  background: rgba(212,168,67,0.3);
  width: 50px;
  height: 50px;
}

.marker-featured .marker-pin {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #d4a843, #b8902e);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 18px rgba(212,168,67,0.55), 0 0 0 3px rgba(212,168,67,0.2);
}

.marker-featured .marker-price {
  background: #d4a843;
  color: #0d1117;
  font-weight: 800;
  border-color: rgba(212,168,67,0.6);
  box-shadow: 0 2px 10px rgba(212,168,67,0.4);
}

@keyframes pulse-ring-gold {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}

.marker-featured .marker-pulse {
  animation: pulse-ring-gold 2s ease-out infinite;
}

/* ===== SPONSORED MARKER — gold, 1.2x, glow ===== */
.sponsored-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(212,168,67,0.15);
  border: 1px solid rgba(212,168,67,0.3);
  color: #d4a843;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.marker-sponsored .marker-pulse {
  width: 54px;
  height: 54px;
  background: rgba(212,168,67,0.35);
  animation: pulse-ring-gold 2s ease-out infinite;
}

.marker-sponsored .marker-pin {
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #e6bc56, #d4a843 55%, #b8902e);
  border: 2px solid rgba(255,255,255,0.75);
  box-shadow: 0 4px 18px rgba(212,168,67,0.55), 0 0 0 3px rgba(212,168,67,0.2);
  filter: drop-shadow(0 0 8px rgba(212,168,67,0.6));
}

.marker-sponsored .marker-price {
  background: #d4a843;
  color: #0d1117;
  font-weight: 800;
  border-color: rgba(212,168,67,0.6);
  box-shadow: 0 2px 10px rgba(212,168,67,0.4);
}

/* ===== LAND MARKER — red diamond ===== */
.marker-land .marker-pin {
  border-radius: 4px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 4px 16px rgba(220,38,38,0.65), 0 2px 6px rgba(0,0,0,0.35);
}

.marker-land .marker-pulse {
  background: rgba(220,38,38,0.3);
  border-radius: 50%;
}

@keyframes pulse-ring-red {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

.marker-land .marker-pulse {
  animation: pulse-ring-red 2s ease-out infinite;
}

.marker-land .marker-price {
  background: #dc2626;
  color: #ffffff;
  border-color: rgba(220,38,38,0.5);
  box-shadow: 0 2px 10px rgba(220,38,38,0.4);
}

/* ===== MODAL ===== */
#modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
}

#modal-overlay.active {
  display: flex;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#modal {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

#modal::-webkit-scrollbar { width: 4px; }
#modal::-webkit-scrollbar-thumb { background: var(--navy-4); border-radius: 4px; }

#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--navy-3);
}

#modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.2px;
}

#modal-close {
  background: var(--navy-3);
  color: var(--white-60);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-close:hover {
  background: var(--red);
  color: white;
}

#modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  color: var(--white-60);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-group input {
  background: var(--navy-3);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--white);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--gold);
  background: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.1);
}

.form-group input::placeholder {
  color: var(--white-40);
}

#type-selector {
  display: flex;
  gap: 8px;
}

.type-btn {
  flex: 1;
  padding: 9px;
  background: var(--navy-3);
  color: var(--white-60);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.type-btn.active {
  background: rgba(212,168,67,0.12);
  border-color: var(--gold-dark);
  color: var(--gold);
}

#pin-instructions {
  color: var(--white-40);
  font-size: 12px;
  line-height: 1.5;
}

#pick-location-btn {
  padding: 9px 14px;
  background: var(--navy-3);
  color: var(--white-60);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

#pick-location-btn.picking {
  background: rgba(212,168,67,0.1);
  border-color: var(--gold-dark);
  color: var(--gold);
}

#pin-status {
  color: var(--white-40);
  font-size: 11px;
  letter-spacing: 0.2px;
}

#pin-status.selected {
  color: var(--green);
  font-weight: 600;
}

#form-submit {
  padding: 12px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

#form-submit:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212,168,67,0.3);
}

#form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== LIGHT MODE ===== */
body.light-mode {
  --navy: #f6f8fa;
  --navy-2: #ffffff;
  --navy-3: #f0f2f5;
  --navy-4: #d0d7de;
  --white: #1a1a2e;
  --white-60: rgba(26,26,46,0.6);
  --white-40: rgba(26,26,46,0.4);
  --white-20: rgba(26,26,46,0.2);
  --white-10: rgba(26,26,46,0.08);
  --white-05: rgba(26,26,46,0.04);
  background: var(--navy);
}

body.light-mode .leaflet-popup-content-wrapper {
  background: white !important;
  color: #1a1a2e !important;
}

body.light-mode #map {
  filter: brightness(1.05);
}

/* ===== MY LOCATION BUTTON ===== */
#my-location-btn {
  position: absolute;
  bottom: 30px;
  right: 15px;
  width: 42px;
  height: 42px;
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: var(--transition);
  color: var(--white-60);
}

#my-location-btn:hover {
  background: var(--navy-3);
  border-color: var(--gold);
  color: var(--gold);
  transform: scale(1.08);
}

#my-location-btn.loading {
  animation: spin 1s linear infinite;
  border-color: var(--gold);
  color: var(--gold);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== SMART SEARCH ===== */

/* Search wrapper — positions the dropdown */
#search-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
}

/* Move the max-width from #search-container to #search-wrapper */
#search-container {
  max-width: none;
  flex: none;
  width: 100%;
}

/* Clear (X) button inside search bar */
#search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white-40);
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 0;
}
#search-clear-btn:hover { color: var(--white); }

/* Suggestions dropdown */
#search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  z-index: 9990;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: none;
}
#search-dropdown::-webkit-scrollbar { display: none; }
#search-dropdown.open {
  display: block;
  animation: dropdown-in 0.15s ease;
}

/* Section label inside dropdown */
.dd-label {
  padding: 10px 14px 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--white-40);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Suggestion row */
.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}
.dd-item:hover, .dd-item.hl { background: var(--navy-3); }

/* Recent search row */
.dd-recent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 44px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}
.dd-recent:hover, .dd-recent.hl { background: var(--navy-3); }

/* Icon box inside suggestion */
.dd-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--navy-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.dd-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--white-40);
  background: var(--navy-3);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Delete recent button */
.dd-del {
  background: none;
  border: none;
  color: var(--white-40);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
  line-height: 0;
}
.dd-del:hover { color: var(--red); background: rgba(248,81,73,0.1); }

/* Clear all row */
.dd-clear-row {
  padding: 8px 14px;
  border-top: 1px solid var(--navy-3);
  display: flex;
  justify-content: flex-end;
}
.dd-clear-all {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  transition: color 0.15s;
}
.dd-clear-all:hover { color: var(--gold-light); }

/* Popular city chips */
.dd-chips {
  display: flex;
  gap: 6px;
  padding: 4px 14px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.dd-chips::-webkit-scrollbar { display: none; }

.dd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid rgba(212,168,67,0.4);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  background: transparent;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1;
}
.dd-chip:hover {
  background: rgba(212,168,67,0.1);
  border-color: var(--gold);
}

/* Dropdown divider */
.dd-divider {
  height: 1px;
  background: var(--navy-3);
  margin: 4px 0;
}

/* ===== FILTER ROW ===== */
#filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#filter-row #filter-container {
  flex: 1;
}

#price-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: var(--navy-3);
  color: var(--white-60);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
  height: 30px;
  flex-shrink: 0;
}
#price-filter-btn:hover, #price-filter-btn.active-filter {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,168,67,0.08);
}

.filter-badge {
  display: none;
  background: var(--gold);
  color: var(--navy);
  font-size: 9px;
  font-weight: 800;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Price dropdown */
#price-dropdown {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  border-top: 1px solid var(--navy-3);
  margin-top: 4px;
}
#price-dropdown.open { display: flex; }

.price-opt {
  padding: 7px 10px;
  background: none;
  color: var(--white-60);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.price-opt:hover { background: var(--navy-3); color: var(--white); }
.price-opt.active {
  background: rgba(212,168,67,0.1);
  color: var(--gold);
  font-weight: 600;
}

/* Active filters / clear link */
#filter-status {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 2px;
  border-top: 1px solid var(--navy-3);
  margin-top: 4px;
}
#filter-status.visible { display: flex; }

#filter-status-text {
  font-size: 11px;
  color: var(--white-40);
}

#clear-filters-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
#clear-filters-btn:hover { color: var(--gold-light); }

/* ===== SIDEBAR HEADER — search result label ===== */
#search-result-label {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--white-40);
  font-weight: 500;
}
#search-result-label.visible { display: flex; }
#search-result-label svg { color: var(--gold); flex-shrink: 0; }

/* ===== EMPTY STATE IN SIDEBAR ===== */
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 10px;
  text-align: center;
}
.search-empty-icon { color: var(--white-20); margin-bottom: 4px; }
.search-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--white-60);
  line-height: 1.4;
}
.search-empty-sub {
  font-size: 12px;
  color: var(--white-40);
  line-height: 1.5;
}
.search-empty-reset {
  margin-top: 8px;
  padding: 7px 18px;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(212,168,67,0.5);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.search-empty-reset:hover {
  background: rgba(212,168,67,0.1);
  border-color: var(--gold);
}
/* ===== MARKER CLUSTER ===== */
.em-cluster-wrap {
  background: transparent !important;
  border: none !important;
}
.em-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #d4a843;
  border: 2px solid #b8902e;
  color: #0d1117;
  font-family: Inter, -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45), 0 0 0 4px rgba(212,168,67,0.18);
  animation: cluster-pop 0.18s cubic-bezier(0.34,1.56,0.64,1) both;
}
.em-cluster.cluster-sm { width: 36px; height: 36px; font-size: 13px; }
.em-cluster.cluster-md { width: 44px; height: 44px; font-size: 14px; }
.em-cluster.cluster-lg { width: 52px; height: 52px; font-size: 15px; color: #fff; background: #c49730; }
@keyframes cluster-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
/* suppress default cluster colours */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background: transparent !important; }
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div { background: transparent !important; }

/* ===== CURRENCY SELECTOR ===== */
#currency-selector {
  position: relative;
  flex-shrink: 0;
}

#currency-btn {
  padding: 6px 12px;
  background: var(--navy-2);
  color: var(--white);
  border: 1px solid var(--navy-3);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
}

#currency-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dark);
  background: rgba(212,168,67,0.08);
}

#currency-btn .currency-chevron {
  display: flex;
  align-items: center;
  color: var(--white-40);
  transition: transform 0.25s ease;
}

#currency-selector.open #currency-btn .currency-chevron {
  transform: rotate(180deg);
}

#currency-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  max-height: 420px;
  background: rgba(22,27,34,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

#currency-selector.open #currency-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.currency-dd-label {
  padding: 11px 14px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--white-40);
  border-bottom: 1px solid var(--navy-3);
  flex-shrink: 0;
}

.currency-dd-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.currency-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-align: left;
  transition: background 0.15s ease;
}

.currency-option:hover {
  background: var(--white-05);
}

.currency-flag {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.currency-symbol {
  min-width: 34px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-60);
  flex-shrink: 0;
}

.currency-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.currency-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
}

.currency-name {
  font-size: 11px;
  color: var(--white-40);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.currency-check {
  display: none;
  align-items: center;
  color: var(--gold);
  flex-shrink: 0;
}

.currency-option.selected {
  background: rgba(212,168,67,0.1);
}

.currency-option.selected .currency-code,
.currency-option.selected .currency-symbol {
  color: var(--gold);
}

.currency-option.selected .currency-check {
  display: flex;
}

body.light-mode #currency-dropdown {
  background: rgba(255,255,255,0.94);
}

@media (max-width: 768px) {
  #currency-dropdown {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 60vh;
  }
}
