/* Custom CSS stylesheet for StreetPulse UK - Premium Dark Glassmorphism Design */

:root {
  --color-bg: #070708;
  --color-card-bg: rgba(18, 18, 20, 0.75);
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  
  /* Monochrome Accents */
  --color-purple: #ffffff;
  --color-purple-glow: rgba(255, 255, 255, 0.04);
  --color-indigo: #8e8e93;
  --color-emerald: #f3f4f6;
  --color-cyan: #d1d5db;
  
  /* Scrollbar Custom Colors */
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-track: rgba(10, 10, 11, 0.8);

  color-scheme: dark;
  accent-color: var(--color-purple);
}

/* Base resets & styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(168, 85, 247, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: clip;
  min-height: 100vh;
}

/* Custom Scrollbar (standard & fallback) */
:root {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

/* WebKit Fallback */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
  }
}

/* Typography styles */
.font-outfit {
  font-family: 'Outfit', sans-serif;
}

/* Glassmorphic panels */
.glass-panel {
  background: var(--color-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.glass-panel:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.02);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Outfit', sans-serif;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: 'Inter', sans-serif;
  width: 100%;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
  border-color: var(--color-purple);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Native Select Styling */
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* Range input layout */
.form-group input[type="range"] {
  accent-color: var(--color-purple);
  background: #1f1f21;
  border-radius: 0.5rem;
  height: 0.375rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-green {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

.badge-red {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

/* Metrics styles */
.metric-card {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Shimmer Loading Animations */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-shimmer {
  position: relative;
  overflow: hidden;
}

.loading-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    rgba(22, 18, 36, 0) 0%,
    rgba(139, 92, 246, 0.04) 20%,
    rgba(139, 92, 246, 0.08) 60%,
    rgba(22, 18, 36, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  pointer-events: none;
}

/* Loading Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* Tailwind CSS classes mapped locally for convenience and flex grid stability */
.aspect-square { aspect-ratio: 1 / 1; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.w-full { width: 100%; }
.h-10 { height: 2.5rem; }
.w-10 { width: 2.5rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pr-1 { padding-right: 0.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1.5 { margin-top: 0.375rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-16 { margin-top: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.text-white { color: #fff; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-purple-300 { color: #e5e7eb; }
.text-purple-400 { color: #ffffff; }
.text-indigo-300 { color: #d1d5db; }
.text-indigo-400 { color: #9ca3af; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-400 { color: #34d399; }
.text-rose-400 { color: #fb7185; }
.text-amber-400 { color: #fbbf24; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.italic { font-style: italic; }
.list-disc { list-style-type: disc; }
.ml-4 { margin-left: 1rem; }
.leading-relaxed { leading-height: 1.625; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .lg:col-span-6 { grid-column: span 6 / span 6; }
  .lg:col-span-12 { grid-column: span 12 / span 12; }
}

/* Neighborhood Dashboard Layout */
.neighborhood-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .neighborhood-dashboard {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); /* 60% stats, 40% map */
  }
}

/* Toast styling */
.toast {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Leaflet Custom Styling to match dark glassmorphic design & smooth mobile scroll */
.leaflet-container, #map, #flood-map-surface, #flood-map-rivers {
  background-color: #0f0f11 !important;
  touch-action: pan-y !important;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: rgba(20, 20, 22, 0.95) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px);
}

.leaflet-popup-content {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.75rem !important;
  line-height: 1.5 !important;
  margin: 12px 16px !important;
}

.leaflet-popup-content b {
  color: #ffffff !important;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.02em;
}

.leaflet-popup-close-button {
  color: #cbd5e1 !important;
}

.leaflet-bar {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

.leaflet-bar a {
  background-color: rgba(26, 26, 28, 0.9) !important;
  color: #cbd5e1 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: background-color 0.2s, color 0.2s;
}

.leaflet-bar a:hover {
  background-color: #2d2d30 !important;
  color: #fff !important;
}

/* Custom Marker Styling */
.center-marker {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.crime-marker {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.center-marker-pulse {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #000;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  animation: marker-ping 1.5s ease-in-out infinite;
}

.center-marker-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #000;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

@keyframes marker-ping {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.crime-marker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f43f5e; /* rose-500 */
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.8);
  transition: transform 0.2s;
}

.crime-marker-dot:hover {
  transform: scale(1.3);
  background: #ff4b6e;
}

.crime-marker-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #f43f5e;
  border: 1.5px solid #ffffff;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  font-family: monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.9);
  transition: transform 0.2s;
  cursor: pointer;
}

.crime-marker-badge:hover {
  transform: scale(1.3);
  background: #ff4b6e;
}

/* Markdown styling inside the AI Report container */
.report-container h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-cyan);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.375rem;
  font-family: 'Outfit', sans-serif;
}

.report-container h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-emerald);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: 'Outfit', sans-serif;
}

.report-container p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.report-container blockquote {
  border-left: 4px solid var(--color-purple);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.25rem;
  font-style: italic;
  color: #cbd5e1;
}

.report-container ul {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  list-style-type: disc;
  color: #cbd5e1;
}

.report-container li {
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: #cbd5e1;
}

.report-container code {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.75rem;
}

/* Custom scrollbar for crime breakdown list */
#crime-breakdown-list::-webkit-scrollbar {
  width: 4px;
}
#crime-breakdown-list::-webkit-scrollbar-track {
  background: transparent;
}
#crime-breakdown-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
#crime-breakdown-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

/* Developer Logo Badge styling matching portfolio site code styling */
.logo-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  line-height: 1;
}

.logo-code-badge:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.06);
  transform: scale(1.05) rotate(-1deg);
}

.logo-code-badge span.bracket {
  color: #8e8e93;
  transition: color 0.3s;
}

.logo-code-badge:hover span.bracket {
  color: #ffffff;
}

/* Premium Postcode Form & Hero Search Bar Styling */
#postcode-form {
  background: rgba(18, 18, 22, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
  padding: 0.5rem !important;
  border-radius: 1.25rem !important;
  width: 100% !important;
  display: flex !important;
  gap: 0.5rem !important;
}

#postcode-input, #address-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-color: rgba(10, 10, 12, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0.875rem !important;
  padding: 0.875rem 1.25rem !important;
  font-size: 0.875rem !important;
  color: #fff !important;
  transition: all 0.25s ease !important;
  height: 52px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

#postcode-input:focus, #address-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
  outline: none !important;
}

#address-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 1.1rem !important;
  padding-right: 2.75rem !important;
  cursor: pointer !important;
}

#analyze-btn {
  background: #6366f1 !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  border-radius: 0.875rem !important;
  padding: 0 1.75rem !important;
  height: 52px !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

#analyze-btn:hover {
  background: #4f46e5 !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45) !important;
}

#analyze-btn:active {
  transform: scale(0.97) !important;
}

/* Premium Web App Navigation Menu Bar */
nav.glass-panel {
  background: rgba(15, 12, 26, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
  padding: 0.375rem !important;
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.tab-btn {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  padding: 0.6rem 1.25rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
  background: transparent !important;
  color: #9ca3af !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
}

.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
}

.tab-btn.active {
  background: #6366f1 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* Demographics Grid Split Layout */
.demographics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.demographics-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.demographics-right-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 33, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 2rem;
}

@media (min-width: 768px) {
  .demographics-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.bg-owner { background-color: #10b981; }
.bg-rent { background-color: #6366f1; }
.bg-social { background-color: #f59e0b; }
.bg-council { background-color: #f43f5e; }

.legend-bullet {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

/* Button styling for Land Registry external links */
.lr-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
}

.lr-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-decoration: none !important;
}

.lr-btn-sky {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.lr-btn-sky:hover {
  background: rgba(14, 165, 233, 0.3);
  color: #ffffff;
}

.lr-btn-violet {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.lr-btn-violet:hover {
  background: rgba(139, 92, 246, 0.3);
  color: #ffffff;
}

.lr-btn-teal {
  background: rgba(20, 184, 166, 0.15);
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.lr-btn-teal:hover {
  background: rgba(20, 184, 166, 0.3);
  color: #ffffff;
}

/* Leaflet Layer Switcher Dark Theme */
.leaflet-control-layers {
  background: rgba(15, 23, 42, 0.9) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  color: #f1f5f9 !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6) !important;
  padding: 6px 10px !important;
}

.leaflet-control-layers-toggle {
  background-size: 18px 18px !important;
}

.leaflet-control-layers label {
  cursor: pointer;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}

.leaflet-control-layers label:hover {
  color: #ffffff;
}

/* High-contrast crisp Dark Mode for OpenStreetMap */
.map-tiles-dark {
  filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(110%) saturate(0.65) !important;
}

/* Crime Map Header Controls */
.crime-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.crime-map-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crime-map-pin-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fb7185;
  flex-shrink: 0;
}
.crime-map-pin-icon svg {
  width: 14px;
  height: 14px;
}

.crime-map-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.crime-map-radius-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

.crime-map-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crime-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  line-height: 1;
}

.crime-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.crime-refresh-btn svg {
  width: 13px;
  height: 13px;
  color: #818cf8;
  transition: transform 0.4s ease;
}

.crime-refresh-btn:hover svg {
  transform: rotate(180deg);
}

.police-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  white-space: nowrap;
  line-height: 1;
}

.police-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* StreetPulse Mobility & Transit Matrix (Proprietary Layout) */
.mobility-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.mobility-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.85rem;
}

.mobility-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
  transition: transform 0.2s ease;
}

.mobility-score-badge:hover {
  transform: translateY(-1px);
}

.mobility-grade {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  line-height: 1;
}

.mobility-score-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f1f5f9;
}

.mobility-bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
  align-items: stretch;
}

@media (min-width: 860px) {
  .mobility-bento-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.mobility-panel {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mobility-panel:hover {
  border-color: var(--color-border-hover);
}

.mobility-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.75rem;
}

.mobility-hero-station {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 0.85rem;
  padding: 0.95rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.mobility-hero-station:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.45);
}

.mobility-hero-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobility-crs-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  color: #cbd5e1;
  font-weight: 600;
  line-height: 1.2;
}

.mobility-badge-walk {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.3rem 0.65rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobility-badge-drive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.3rem 0.65rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobility-feed {
  height: 250px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mobility-feed::-webkit-scrollbar {
  width: 4px;
}

.mobility-feed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 9999px;
}

.mobility-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
}

.mobility-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.mobility-feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mobility-feed-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.mobility-airports-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 680px) {
  .mobility-airports-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mobility-airport-card {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 2px solid rgba(99, 102, 241, 0.5);
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mobility-airport-card:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.09), rgba(255, 255, 255, 0.035));
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   POPUP MODAL (LOGIN & REGISTRATION) - 100% BULLETPROOF CENTERING OVERLAY
   ========================================================================== */

#login-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: rgba(5, 7, 15, 0.85) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  overflow-y: auto !important;
}

#login-modal.flex {
  display: flex !important;
  animation: modalBackdropFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#login-modal.hidden {
  display: none !important;
}

#login-backdrop-close {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1 !important;
  cursor: pointer !important;
}

.login-modal-card {
  position: relative !important;
  z-index: 10 !important;
  width: 100% !important;
  max-width: 440px !important;
  margin: auto !important;
  background: radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.18), transparent 55%),
              radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.12), transparent 55%),
              #121422 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.95), 
              0 0 50px rgba(99, 102, 241, 0.25) !important;
  padding: 1.75rem !important;
  box-sizing: border-box !important;
  animation: modalPopupScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-modal-card:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
}

.login-modal-card input {
  width: 100% !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 0.75rem !important;
  padding: 0.65rem 0.85rem !important;
  font-size: 0.85rem !important;
  color: #ffffff !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.login-modal-card input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.login-modal-card label {
  display: block !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
  margin-bottom: 0.35rem !important;
}

#panel-login.hidden,
#panel-register.hidden {
  display: none !important;
}

#panel-login:not(.hidden),
#panel-register:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
}

@keyframes modalBackdropFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(14px);
  }
}

@keyframes modalPopupScaleUp {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}



