/* ── Chennai.rent Modern Dark UI Design ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #121224;
  --bg-card: #18182e;
  --bg-input: #0e0e1c;
  --accent-purple: #7c3aed;
  --accent-purple-light: #a78bfa;
  --accent-purple-glow: rgba(124, 58, 237, 0.4);
  --accent-teal: #0d9488;
  --accent-teal-light: #5eead4;
  --accent-amber: #d97706;
  --accent-amber-light: #fbbf24;
  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(167, 139, 250, 0.3);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Fullscreen Map Container ── */
#map {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  background: #0d0d12;
}

/* Custom Leaflet Map styling override */
.leaflet-container {
  background: #0d0d12 !important;
  font-family: inherit !important;
}

/* 100% Free Dark Map Styling - Zero API Key, Zero Watermark */
.dark-osm-tiles {
  filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(95%);
  -webkit-filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(95%);
}

.leaflet-bar {
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5) !important;
}
.leaflet-bar a {
  background-color: rgba(18, 18, 36, 0.85) !important;
  color: #cbd5e1 !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  backdrop-filter: blur(10px);
}
.leaflet-bar a:hover {
  background-color: rgba(30, 30, 60, 0.95) !important;
  color: #fff !important;
}
.leaflet-control-attribution {
  background: rgba(10, 10, 20, 0.75) !important;
  color: #64748b !important;
  font-size: 10px !important;
  border-radius: 6px;
  margin: 4px;
}
.leaflet-control-attribution a {
  color: #94a3b8 !important;
  text-decoration: none;
}

/* ── Top Floating Search Wrap ── */
.search-wrap {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 28px);
  max-width: 540px;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(10, 10, 22, 0.75);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.03);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-purple-light);
  white-space: nowrap;
  letter-spacing: -0.2px;
  cursor: pointer;
}
.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}

.search-input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}
.search-input::placeholder {
  color: #64748b;
}
.search-input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.filter-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.filter-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.filter-toggle-btn.has-filters {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(167, 139, 250, 0.6);
  color: #fff;
}
.filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #7c3aed;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}
.filter-toggle-btn.has-filters .filter-badge {
  display: flex;
}

/* ── Chicklet Quick Action Bar ── */
.chicklet-bar {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 100%;
  max-width: 560px;
  padding: 0 14px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chicklet-bar::-webkit-scrollbar {
  display: none;
}

.chicklet {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 20px;
  background: rgba(12, 12, 26, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  user-select: none;
}
.chicklet:hover {
  background: rgba(24, 24, 46, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.chicklet:active {
  transform: scale(0.96);
}
.chicklet.active {
  background: rgba(13, 148, 136, 0.25);
  border-color: rgba(94, 234, 212, 0.5);
  color: #5eead4;
}
.chicklet.highlight {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(79, 70, 229, 0.25));
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

/* ── Right-Side Utility Rail ── */
.right-rail {
  position: fixed;
  right: 14px;
  bottom: 120px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(15, 15, 30, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: all 0.18s;
  font-size: 14px;
}
.rail-btn:hover {
  background: rgba(30, 30, 56, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.05);
}
.rail-btn.active {
  background: #7c3aed;
  border-color: #a78bfa;
  color: #fff;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.6);
}
.rail-btn span {
  font-size: 8.5px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ── Bottom Floating "Add Anything" / CTA Bar ── */
.bottom-cta-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-cta-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 30px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5), 0 0 0 1px rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-cta-main:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 36px rgba(124, 58, 237, 0.65);
}
.btn-cta-main:active {
  transform: scale(0.97);
}

.btn-cta-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 30px;
  background: rgba(14, 14, 28, 0.85);
  backdrop-filter: blur(16px);
  color: #e2e8f0;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-cta-sub:hover {
  background: rgba(26, 26, 48, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: scale(1.03);
}

/* ── Custom Map Markers ── */
.custom-pin-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.12s ease;
  will-change: transform;
}
.custom-pin-marker:hover {
  transform: scale(1.15);
  z-index: 9999 !important;
}

.pin-bubble {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.5);
  letter-spacing: -0.2px;
}
.pin-bubble.gated {
  background: #2563eb;
  border: 1px solid rgba(147, 197, 253, 0.5);
}
.pin-bubble.not-gated {
  background: #d97706;
  border: 1px solid rgba(253, 230, 138, 0.5);
}
.pin-bubble.owner-listing {
  background: #059669;
  border: 1px solid rgba(110, 231, 183, 0.6);
  box-shadow: 0 0 12px rgba(5, 150, 105, 0.6);
}
.pin-bubble.seeker {
  background: rgba(13, 148, 136, 0.9);
  border: 1px dashed #5eead4;
  color: #ccfbf1;
}
.pin-bubble.tolet {
  background: #b45309;
  border: 1px solid #f59e0b;
  color: #fef3c7;
}

.pin-bubble .bhk-tag {
  opacity: 0.85;
  font-size: 9.5px;
  font-weight: 600;
}
.pin-triangle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  margin-top: -1px;
}
.pin-triangle.gated { border-top: 6px solid #2563eb; }
.pin-triangle.not-gated { border-top: 6px solid #d97706; }
.pin-triangle.owner-listing { border-top: 6px solid #059669; }
.pin-triangle.seeker { border-top: 6px solid #0d9488; }
.pin-triangle.tolet { border-top: 6px solid #b45309; }

/* Metro station markers */
.metro-station-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
  cursor: pointer;
}
.metro-station-marker.blue { background: #2563eb; }
.metro-station-marker.green { background: #16a34a; }

/* ── Modal Dialogs & Backdrops ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 22px 24px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
}
.modal-card::-webkit-scrollbar {
  width: 5px;
}
.modal-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-title {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-sub {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Form inputs & buttons */
.field-group {
  margin-bottom: 15px;
}
.field-label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.field-label span {
  color: #ef4444;
  margin-left: 2px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px var(--accent-purple-glow);
}
.form-input::placeholder {
  color: #475569;
}

/* Segmented Buttons / Chips */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-btn {
  flex: 1;
  min-width: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
}
.chip-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.chip-btn.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple-light);
  color: #fff;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  flex: 1;
  padding: 11px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(1.1);
}
.btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ── Selection Chooser Cards ── */
.chooser-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chooser-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
}
.chooser-tile:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}
.chooser-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.chooser-info h4 {
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chooser-info p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.badge-new {
  background: #f59e0b;
  color: #18181b;
  font-size: 9px;
  font-weight: 800;
  border-radius: 6px;
  padding: 1px 6px;
}

/* ── Live Stats Table ── */
.stat-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}
.stat-card-label {
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
}
.stat-card-sub {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 2px;
}
.stat-card-value {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ── Guided Onboarding Tour ── */
.tour-card {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  width: calc(100% - 32px);
  max-width: 420px;
  background: #141428;
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
  display: none;
}
.tour-card.active {
  display: block;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.tour-step {
  color: #a78bfa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.tour-title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tour-body {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tour-skip {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
}
.tour-skip:hover { color: #94a3b8; }
.tour-next {
  padding: 7px 16px;
  border-radius: 10px;
  background: var(--accent-purple);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .search-wrap {
    top: 10px;
    width: calc(100% - 20px);
  }
  .chicklet-bar {
    top: 70px;
  }
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
  }
  .bottom-cta-wrap {
    bottom: 16px;
    width: calc(100% - 24px);
  }
  .btn-cta-main {
    flex: 1;
    justify-content: center;
  }
}
