:root {
  --primary-bg: #0a0a0a;
  --secondary-bg: #1a1a1a;
  --tertiary-bg: #2a2a2a;
  --view-bg: #ffffff;
  --view-hover-text: #c3c3c3;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #3f3f46;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --rail-icon-hover: #111827;
  --rail-btn-hover: #1d1d1d;
  --bg-gradient: rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --logo-filter: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

  #app-container.blurred {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
  }

  .custom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9998;
    backdrop-filter: blur(8px) saturate(1.05);
  }

  .custom-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #161618; /* solid top+middle colour */
    padding: 0; /* remove outer padding so sections align to edges */
    width: 85%;
    height: fit-content;
    min-height: 72%;
    max-width: 1100px;
    max-height: fit-content;
    border-radius: 10px;
    color: #fff;
    z-index: 9999;
    text-align: left;
    font-family: Inter, Arial, sans-serif;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;

  }

  .custom-modal .modal-body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding:20px;
    padding-bottom: 0px;
    text-align: center;
    background: #161618;
    height: fit-content;

  }

  .spinner {
    margin: 8px 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.12);
    border-top: 5px solid rgba(255,255,255,0.95);
    animation: spin 0.9s linear infinite;
  }

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

  .custom-modal .popup-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid rgba(255,255,255,0.03);
    padding: 14px 18px;
    background: #141415; /* solid footer colour */
  }

  .close-btn {
    margin: 0;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    color: #111;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  }

  .custom-modal h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
  }

  .custom-modal p {
    color: #b9bbbf;
    margin: 0;
    line-height: 1.4;
  }

  .custom-modal .modal-header {
    padding: 18px;
    background: #161618; /* solid header colour */
    border-bottom: 1px solid rgba(255,255,255,0.03);
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
  }

  .custom-modal .modal-body .analyzing {
    font-size: 16px;
    color: #e6e7e9;
    margin-top: 6px;
  }

  .custom-modal .modal-body .hint {
    font-size: 13px;
    color: #9aa0a6;
    max-width: 720px;
    margin-top: 0px;
    margin-bottom: 0.7rem;
  }

button.close-btn.verify-btn {
  padding: 0.5rem 1rem;
  margin-left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.popup-bottom{
  position: relative;
  margin-top: auto;
  margin-bottom: 0px;
}

#app-container {
  height: 100vh;
}

/* Main Layout */
#app-main {
  display: flex;
  height: 100vh;
  position: relative;
}

#map-container {
  flex: 1;
  position: relative;
  background: var(--primary-bg);
}

/* Left Sidebar: rail + panes */
#left-sidebar.sidebar {
  height: 100%;
  display: flex;
  flex-direction: row; /* rail on left, content to the right */
  z-index: 80; /* above map */
  order: -1; /* place sidebar to the left of the map without changing DOM order */
  position: relative; /* needed so absolute .sidebar-content can position against this */
  width: 64px; /* only reserve rail width in layout so content can overlay map */
}

.sidebar-rail {
  width: 64px;
  background: var(--secondary-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  padding-top: 1.21rem;
  gap: 0.5rem;
  position: relative;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: var(--secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.sidebar-logo img {
  max-height: 100%;
}
.sidebar-logo:hover .img-target {
  filter: var(--logo-filter);
}

.rail-btn {
  font-size: x-small;
  text-align: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.rail-btn:hover,
.rail-btn.active {
  color: var(--rail-icon-hover);
  border-color: transparent;
  background: var(--rail-btn-hover);/*
  border-color: var(--rail-btn-hover); */
}

.theme-toggle {
  position: unset;
  margin-top: auto;
}

.rail-spacer {
  flex: 1;
}
.small-spacer {
  height: 0.25rem;
}

.rail-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
}
.lat-lon-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  transition: all 0.2s ease;
  width: 100%;
  border-radius: 0.5rem;
  cursor: pointer;
}

.lat-lon-stats i {
  margin-left: auto;
  margin-right: auto;
  color: var(--view-hover-text);
  opacity: 0;
  max-height: 0;
  transition: all 0.5s ease;
}

.lat-lon-stats i:hover {
  color: #a1a1aa;
}

.lat-lon-stats .rail-btn {
  background-color: var(--secondary-bg);
  color: var(--text-secondary);
}

.lat-lon-stats:hover {
  background-color: var(--rail-btn-hover);
}
.lat-lon-stats:hover .rail-btn {
  border-color: var(--rail-btn-hover);
}
.lat-lon-stats:hover i {
  opacity: 1;
  max-height: 50px;
}

.rail-stat {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.4rem;
  padding: 0.25rem 0.4rem;
  text-align: center;
}

.sidebar-content {
  position: absolute; /* overlay map */
  top: 0;
  left: 64px; /* sit immediately to the right of the rail */
  width: 360px;
  max-width: 40vw;
  height: 100%;
  margin: 0;
  background: var(--bg-gradient);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border-color);
  overflow: hidden auto;
  padding: 0.75rem;
  display: block;
  /* Use transform to animate slide in/out instead of width to avoid layout jank */
  transition:
    transform 0.32s cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 0.2s ease,
    opacity 0.18s ease;
  transform: translateX(0);
  box-shadow: -12px 0 24px rgba(0, 0, 0, 0.25);
  z-index: 70; /* above map but below rail if necessary */
}

/* When sidebar is collapsed, slide the content off to the left so it doesn't leave artifacts */
#left-sidebar.collapsed .sidebar-content {
  transform: translateX(-100%);
  padding: 0.75rem 0; /* keep padding to avoid layout jump when expanding */
  opacity: 0; /* subtle fade */
  pointer-events: none;
}

/* ensure rail stays visible while content slides */
#left-sidebar .sidebar-rail {
  z-index: 90;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .sidebar-content {
    transition: none !important;
  }
}

.sidebar-pane {
  display: block;
}
.pane-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.pane-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Verification modal: image + score button */
/* keep modal header layout unchanged — only update modal body */

/* Score button reuses the close button base styles; color variants override background/text */
.score-btn {
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  margin-right: auto;
  margin-left: 2%;
}
.score-excellent { background: #10ae73; color: #fff; }
.score-good { background: #fff; color: #111; }
.score-weak { background: #ef4444; color: #fff; }
.score-none { background: #ef4444; color: #fff; }

.verification-image {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  padding: 16px;
  object-fit: contain;
  background: transparent; /* allow PNG transparency */
  border-radius: 8px;
}
.pane-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.geocoder-container {
  width: 100%;
}

.subtle {
  opacity: 0.85;
}

.property-form .input {
  width: 100%;
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}
.property-form .form-row {
  display: flex;
  gap: 0.5rem;
}
.property-form .form-row.two .input {
  flex: 1;
}
.primary-btn {
  padding: 0.75rem;
  background: var(--accent-blue);
  color: var(--text-primary);
  border: 1px solid var(--accent-blue);
  border-radius: 0.5rem;
  cursor: pointer;
}

.coming-soon-card {
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
}
.soon-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.soon-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#map {
  width: 100%;
  height: 100%;
  flex: 1;
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: 1rem;
  z-index: 10;
  pointer-events: none;
}

.map-controls-bottom {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  pointer-events: none;
}
.map-controls-bottom:hover {
  pointer-events: auto;
  background-color: #000000;
}

.map-controls > * {
  pointer-events: auto;
}

.map-controls.left {
  left: 1rem;
}

.map-controls.right {
  right: 1rem;
}

.map-controls.bottom-right {
  top: auto;
  bottom: 1rem;
  right: 1rem;
  left: auto;
}

/* Draw tools within sidebar should be fixed */
.map-tools.fixed {
  margin-left: 0;
}

.map-mode-buttons {
  display: flex;
  gap: 0.5rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
  overflow: visible;
}

.map-mode-btn {
  padding: 0.5rem 1rem;
  background: rgba(30, 30, 30, 0.9);
  color: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.map-mode-btn.active {
  background: rgba(240, 240, 240, 0.95);
  color: rgba(0, 0, 0, 0.85);
}

.map-mode-btn.active:hover {
  background: rgba(220, 220, 220, 0.95);
  color: rgba(0, 0, 0, 0.85);
}

.map-mode-btn:not(.active):hover {
  background: rgba(50, 50, 50, 0.9);
  color: rgba(255, 255, 255, 0.9);
}

.map-controls-bottom.active,
.map-controls-bottom:hover {
  background: var(--view-bg);
  color: var(--view-hover-text);
}

.map-tools {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.5rem;
  border-radius: 0.75rem;
  backdrop-filter: blur(10px);
  margin-left: 1.5rem; /* Make room for grip dots */
}

.tool-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  background: var(--accent-blue);
  color: var(--text-primary);
}

/* Map Overlay */
.map-overlay {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  padding: 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Close Distribution Button */
.close-distribution-btn {
  position: absolute;
  top: 3.5rem;
  right: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--secondary-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.close-distribution-btn:hover {
  background: var(--tertiary-bg);
  box-shadow: var(--shadow-xl);
}

.map-overlay.draggable {
  padding-left: 2.5rem; /* Make room for grip dots */
}

.map-overlay.bottom-right {
  bottom: 1rem;
  right: 1rem;
}

.coords-display {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Upload panel now lives inside sidebar; keeping styling via .upload-section */

.upload-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.upload-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Search Filter Bar */
.search-filter-bar {
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative; /* <-- Add this line */
  z-index: 20; /* <-- Optional: ensures dropdown is above other elements */
}

.search-filter-bar:hover {
  background: var(--secondary-bg);
  border-color: var(--accent-blue);
}

.search-filter-bar.raise {
  z-index: 51 !important;
}

.filter-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.filter-content i:first-child {
  color: #ff4c4c;
  font-size: 1rem;
}

.filter-content i:last-child {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Drop Zone */
.drop-zone {
  position: relative;
  border: 2px dashed var(--text-primary);
  border-radius: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--secondary-bg);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.75rem;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #a855f7;
  background: rgba(139, 92, 246, 0.05);
  transform: translateY(-2px);
}

.upload-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* New preview layout: make preview image take most of the drop box
   and push text / formats to the bottom. Keeps overall drop-box size. */
.upload-preview {
  width: 100%;
  flex: 1 1 auto; /* take remaining space */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.preview-img {
  width: 100%;
  height: 100%;
  max-height: calc(100% - 8px);
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

/* push the text elements to the bottom and reduce their size so image dominates */
.upload-text {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  display: block;
  text-align: center;
  padding: 0 6px;
  margin-top: auto; /* push to bottom */
}
.upload-text h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.upload-text .upload-sub { font-size: 0.75rem; color: var(--text-secondary); margin: 0; }
.supported-formats { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; margin-bottom: 6px; }


.upload-icon {
  width: 80px;
  height: 80px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.drop-zone:hover .upload-icon {
  background: #ffffff;
  border-color: #ffffff;
  color: #0a0a0a;
}
.drop-zone:hover .fas.fa-upload {
  color: #0a0a0a;
}

.upload-icon i {
  font-size: 2rem;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.drop-zone:hover .upload-icon i {
  color: var(--text-primary);
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-text h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.upload-text p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.supported-formats {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.drop-zone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Analyse Button */
.analyse-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--accent-blue) 0%,
    var(--accent-blue-hover) 100%
  );
  color: var(--text-primary);
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
}

.analyse-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.analyse-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Results Panel */
.results-panel {
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--secondary-bg);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  z-index: 2;
  display: none;
  overflow-y: auto;
}
.mapboxgl-ctrl-attrib {
  display: none;
}

.mapboxgl-ctrl-geocoder.mapboxgl-ctrl {
  background: transparent;
}

/* Geocoder container */
.mapboxgl-ctrl-geocoder {
    width: 400px; /* adjust width */
    font-family: 'Inter', sans-serif;
}

.mapboxgl-canvas {
  cursor: default !important;
}
/* Input field */
.mapboxgl-ctrl-geocoder input {
    background-color: #1c1c1c; /* dark background */
    color: #fff !important;               /* white text */
    -webkit-text-fill-color: white;
    border: none;
    border-radius: 8px;        /* rounded corners */
    padding: 8px 12px;
    font-size: 14px;
}
.mapboxgl-ctrl-geocoder input:hover {
  background-color: #252525;
}

/* Remove default shadow & border */
.mapboxgl-ctrl-geocoder .suggestions {
    background-color: #2a2a2a; /* dark suggestion dropdown */
    color: #fff;
    border-radius: 8px;
    box-shadow: none;
}

/* Placeholder text color */
.mapboxgl-ctrl-geocoder input::placeholder {
    color: #aaa !important;
    -webkit-text-fill-color: white;
    margin-right: 0;
    margin-left: auto;
}

/* Icon adjustments */
.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-search {
    display: none;
}
.mapboxgl-ctrl-geocoder--button {
  display: none !important;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--primary-bg);
}

.results-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.results-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.show-distribution-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.show-distribution-btn:hover {
  background: var(--tertiary-bg);
  color: var(--text-primary);
}

.close-results {
  width: 2rem;
  height: 2rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-results:hover {
  background: var(--tertiary-bg);
  color: var(--text-primary);
}

.results-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.image-container {
  text-align: center;
}

.analyzed-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 0.75rem;
}

.image-filename {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.explanation {
  background: var(--tertiary-bg);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-blue);
}

.explanation p {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.location-data {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.location-flex {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  align-items: stretch;
}

.location-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  background: var(--tertiary-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 0;
  width: 100%;
}

.location-item.half-width {
  flex: 0 0 48%;
  max-width: 48%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: var(--tertiary-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 0;
}

.location-item .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.location-item.half-width .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.1rem;
}

.location-item .value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: "Monaco", "Menlo", monospace;
}

/* Coordinates container - two column layout */
.coordinates-container {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  padding: 1rem;
}

.coordinates-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.coordinate-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.coordinate-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.coordinate-header .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0;
}

.coordinate-item .value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: "Monaco", "Menlo", monospace;
  margin: 0;
}

.coordinate-value-city,
.coordinate-value-country {
  font-family: "Montserrat", sans-serif !important;
}

.coordinate-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.coordinate-copy-btn:hover {
  opacity: 1;
  color: var(--text-primary);
  background: var(--secondary-bg);
}

.location-item.half-width .value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: "Monaco", "Menlo", monospace;
  margin-bottom: 0.5rem;
}

.copy-btn,
.non-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover,
.non-copy-btn:hover {
  border-color: var(--view-bg);
  border-width: 2px;
  color: var(--text-primary);
}

.download-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--tertiary-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.download-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.accuracy-evaluation h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.accuracy-buttons {
  display: flex;
  gap: 0.5rem;
}

.accuracy-btn {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.accuracy-btn.incorrect {
  background: transparent;
  color: var(--error-color);
  border-color: var(--error-color);
}

.accuracy-btn.incorrect:hover {
  background: var(--error-color);
  color: var(--text-primary);
}

.accuracy-btn.nearby {
  background: transparent;
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.accuracy-btn.nearby:hover {
  background: var(--warning-color);
  color: var(--text-primary);
}

.accuracy-btn.accurate {
  background: transparent;
  color: var(--success-color);
  border-color: var(--success-color);
}

.accuracy-btn.accurate:hover {
  background: var(--success-color);
  color: var(--text-primary);
}

/* Queue Status Display */
.queue-status {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--secondary-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  padding-top: 0.5rem;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  display: none;
}

.queue-status-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.queue-icon {
  font-size: 1.5rem;
  color: #ff4c4c;
  --fa-animation-duration: 2s;
  --fa-fade-opacity: 0.2;
}

.queue-message {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Street View Container */
#streetview-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

#streetview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

/* Custom Dropdown Styles */
.custom-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--tertiary-bg);
  border: 1px solid var(--border-color);
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 30;
  animation: fadeIn 0.2s;
}

#custom-dropdown.open {
  z-index: 50; /* Higher than model dropdown */
}

.dropdown-option {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.875rem;
}

.dropdown-option:hover {
  background: var(--accent-blue);
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar-content {
    width: 320px;
  }
  .results-panel {
    width: 350px;
  }
}

@media (max-width: 768px) {
  #left-sidebar.sidebar {
    left: 0;
    top: 0;
  }
  .sidebar-rail {
    width: 56px;
  }
  .sidebar-content {
    margin: 0.5rem 0.5rem 0.5rem 0.5rem;
    width: calc(100% - 68px);
  }
  .results-panel {
    width: 100%;
  }

  .map-controls {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .drop-zone {
    min-height: 200px;
    padding: 1.5rem 1rem;
  }

  .upload-icon {
    width: 60px;
    height: 60px;
  }

  .upload-icon i {
    font-size: 1.5rem;
  }

  .upload-text h3 {
    font-size: 1.125rem;
  }

  .drag-grip {
    display: none;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-panel {
  animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Remove general dragging behavior for fixed sidebar UI */

/* Drag Grip */
.drag-grip {
  position: absolute;
  top: 50%;
  left: 0.5rem;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  cursor: grab;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-grip:hover {
  opacity: 1;
}

.drag-grip:active {
  cursor: grabbing;
}

.grip-dots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
}

.grip-dot {
  width: 3px;
  height: 3px;
  background-color: var(--text-muted);
  border-radius: 50%;
}

.drag-grip:hover .grip-dot {
  background-color: var(--text-secondary);
}

/* Upload Panel Grip */
#upload-panel .drag-grip {
  top: 0.75rem;
  left: 0.75rem;
}

/* Draw Tools Panel Grip */
#draw-tools-panel .drag-grip {
  top: 50%;
  left: 0.25rem;
  transform: translateY(-50%);
}

/* Coords Panel Grip */
#coords-panel .drag-grip {
  top: 50%;
  left: 0.25rem;
  transform: translateY(-50%);
}

#model-bar {
  margin-top: 0.5rem;
}

.location-divider {
  width: 85%;
  height: 1px;
  background: var(--border-color);
  margin: 0.4rem auto 0.4rem auto;
  opacity: 0.7;
  border-radius: 1px;
}

.combined-flex {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--tertiary-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.latlon-side,
.score-side {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  min-width: 0;
  position: relative;
}

.score-side {
  align-items: flex-end;
  text-align: right;
}

.location-pairs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pair-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.location-pair-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.pair-left,
.pair-right,
.middle-pair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.pair-left .label,
.pair-right .label,
.middle-pair .label {
  color: var(--text-secondary);
  font-weight: 500;
}
.middle-pair .label {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.addr-copy:hover {
  color: var(--text-secondary);
}

.pair-left .value,
.pair-right .value,
.middle-pair .value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: "Monaco", "Menlo", monospace;
}

.location-divider-horizontal {
  width: 98%;
  height: 1px;
  background: var(--border-color);
  opacity: 0.7;
  border-radius: 1px;
  margin: 0.5rem auto;
}

.latlon-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 2rem;
}

.latlon-col,
.score-col {
  display: flex;
  flex-direction: column;
  font-family: "Roboto Mono", "Monaco", "Menlo", monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 0;
  flex: 1 1 0;
}

.latlon-line,
.score-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.score-col {
  align-items: flex-end;
  text-align: right;
}

.latlon-col .copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  transition: background 0.2s;
}

.latlon-col .copy-btn:hover {
  background: var(--accent-blue);
  color: var(--text-primary);
}

.copy-actions-box {
  margin-top: 0.75rem;
  background: var(--tertiary-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  width: 100%;
}

.copy-actions-box .location-pair-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0rem;
}

.copy-actions-box .pair-left,
.copy-actions-box .pair-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.copy-actions-box .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.gm-iv-address {
  display: none !important ;
}
