:root {
  --bg-dark: #0a0d18;
  --bg-panel: rgba(18, 24, 40, 0.85);
  --bg-card: rgba(28, 36, 58, 0.6);
  --bg-card-hover: rgba(36, 46, 74, 0.8);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 242, 254, 0.3);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-emerald: #00e676;
  --accent-warning: #ffb703;
  --accent-error: #ff5252;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 242, 254, 0.25);
}

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

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

/* Main Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 440px;
  min-width: 380px;
  height: 100vh;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: var(--shadow-main);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 13, 24, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #000;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text h1 .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.btn-auth {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  outline: none;
}

.btn-auth:hover {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.35);
  transform: translateY(-1px);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.btn-logout:hover {
  color: var(--accent-error);
}

/* Auth Modal Styling */
.auth-modal-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-icon.modal-close,
.modal-close {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

.btn-icon.modal-close:hover,
.modal-close:hover {
  background: rgba(255, 82, 82, 0.25) !important;
  border-color: #ff5252 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(255, 82, 82, 0.35);
  transform: scale(1.08);
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-md);
  width: fit-content;
}

.auth-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: rgba(0, 242, 254, 0.18);
  color: var(--accent-cyan);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 16px;
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #ff8a8a;
}

/* Legal Links & Legal Document Viewer */
.legal-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}

.legal-link:hover {
  color: #ffffff;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.custom-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.legal-doc-card {
  max-width: 580px !important;
  max-height: 80vh;
}

.legal-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.legal-doc-body {
  padding: 20px 24px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.6;
}

.legal-doc-body h4 {
  color: var(--accent-cyan);
  font-size: 0.9rem;
  margin-top: 14px;
  margin-bottom: 6px;
}

.legal-doc-body p {
  margin-bottom: 10px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-warning);
}

.status-dot.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.pulsing {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.4; transform: scale(0.9); }
}

/* Sidebar Content Scroll */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

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

.card-title-row .section-label {
  margin-bottom: 0;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.btn-location-pill {
  background: rgba(0, 242, 254, 0.12) !important;
  color: var(--accent-cyan) !important;
  border: 1px solid rgba(0, 242, 254, 0.35) !important;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  outline: none;
}

.btn-location-pill:hover {
  background: rgba(0, 242, 254, 0.25) !important;
  border-color: var(--accent-cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.35);
  transform: translateY(-1px);
}

.btn-location-pill:active {
  transform: translateY(0);
}

.btn-text:hover {
  color: var(--accent-cyan);
}

/* Address Search */
.search-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.search-input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
}

.search-input-wrapper button {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-input-wrapper button:hover {
  background: var(--accent-cyan);
  color: #000;
}

.search-results-dropdown {
  display: none;
  margin-top: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
}

.search-result-item {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s, color 0.2s;
}

.search-result-item:hover {
  background: rgba(0, 242, 254, 0.15);
  color: var(--text-main);
}

/* Coordinate Inputs */
.coords-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.input-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.input-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.input-field input::-webkit-outer-spin-button,
.input-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-field input:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.5);
}

/* Sample Pills & File Upload */
.sample-pills-wrapper, .survey-upload-wrapper {
  margin-bottom: 16px;
}

.btn-file-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-file-select:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-file-select.has-file {
  border-style: solid;
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(0, 230, 118, 0.1);
}

.pills-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
}

.sample-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.pill.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #030816;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

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

/* Alert Boxes */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.4;
}

.alert-error {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: var(--accent-error);
}

/* Results Card & Stats Grid */
.card-header-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header-with-badge h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-success {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.loading-percent {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.btn-cancel-extraction {
  margin-top: 20px;
  background: rgba(255, 82, 82, 0.12);
  color: #ff5252;
  border: 1px solid rgba(255, 82, 82, 0.35);
  padding: 8px 20px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  outline: none;
}

.btn-cancel-extraction:hover {
  background: rgba(255, 82, 82, 0.25);
  border-color: #ff5252;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 82, 82, 0.35);
  transform: translateY(-1px);
}

.btn-cancel-extraction:active {
  transform: translateY(0);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Downloads Section */
.download-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.download-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-zip {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.2), rgba(0, 242, 254, 0.2));
  border: 1px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s ease;
}

.btn-zip:hover {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.35), rgba(0, 242, 254, 0.35));
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
  transform: translateY(-2px);
}

.btn-zip .btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-emerald);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.btn-zip .btn-text-block {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.btn-zip .btn-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-zip .btn-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-zip .btn-arrow {
  color: var(--accent-emerald);
  font-size: 1.1rem;
}

.download-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-download-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-download-sm:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Guide Accordion */
.guide-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-summary::-webkit-details-marker {
  display: none;
}

.summary-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

details[open] .summary-arrow {
  transform: rotate(180deg);
}

.guide-content {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.guide-steps {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-steps code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Map Area */
.map-container {
  flex: 1;
  height: 100vh;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: #0f1423;
}

/* Floating Overlay Controls */
.map-overlay {
  position: absolute;
  z-index: 500;
  pointer-events: none;
}

.map-overlay > *,
.user-auth-widget,
.btn-auth {
  pointer-events: auto !important;
}

.map-overlay.top-right {
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.map-overlay.top-right .btn-auth {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-main);
}

.map-overlay.top-right .btn-auth:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.map-overlay.top-right .user-profile-badge {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 5px 14px 5px 8px;
  border-radius: 30px;
  box-shadow: var(--shadow-main);
}

/* Auth Lock Banner & Greyed Out Sidebar Controls */
.auth-lock-card {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(79, 172, 254, 0.05));
  border: 1px solid rgba(0, 242, 254, 0.35);
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.lock-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.lock-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lock-info h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.lock-info p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.btn-lock-signin {
  width: 100%;
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* When sidebar-scroll is auth-gated, grey out all controls below lock banner */
.sidebar-scroll.auth-gated section.card:not(.auth-lock-card),
.sidebar-scroll.auth-gated .accordion {
  opacity: 0.4;
  pointer-events: none !important;
  filter: grayscale(0.7);
  user-select: none;
}

.map-overlay.bottom-right {
  bottom: 30px;
  right: 20px;
}

.layer-switcher-card {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 4px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow-main);
}

.layer-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.layer-btn:hover {
  color: var(--text-main);
}

.layer-btn.active {
  background: var(--accent-cyan);
  color: #000;
}

.map-legend {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  width: 220px;
  box-shadow: var(--shadow-main);
}

.legend-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legend-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #00f2fe, #00e676, #ffb703, #ff5252);
  margin-bottom: 6px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.map-prompt-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 13, 24, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-main);
  z-index: 500;
  pointer-events: none;
}

/* Custom Leaflet Styling */
.leaflet-popup-content-wrapper {
  background: rgba(18, 24, 40, 0.95) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-main) !important;
}

.leaflet-popup-tip {
  background: rgba(18, 24, 40, 0.95) !important;
}

.leaflet-popup-content {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  margin: 10px 14px !important;
  line-height: 1.4;
}

/* Custom Pin Pulse */
.custom-pin-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-cyan);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 15px var(--accent-cyan);
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: rgba(18, 26, 43, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 242, 254, 0.1);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(255, 75, 75, 0.2);
  border-color: #ff4b4b;
  color: #ff4b4b;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.instructions-box {
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.instruction-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-main);
}

.step-num {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.cropper-container {
  max-height: 440px;
  min-height: 320px;
  width: 100%;
  background: #090d16;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.cropper-container img {
  max-width: 100%;
  max-height: 430px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cropper-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-ctrl:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* County Selector Dropdown */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-county-dropdown {
  width: 100%;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.select-county-dropdown:hover,
.select-county-dropdown:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
  background: rgba(18, 24, 40, 0.95);
}

.select-county-dropdown option {
  background: #0d121f;
  color: var(--text-main);
  padding: 8px;
}

/* Full-Screen Loading & Progress Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.loading-overlay.visible {
  opacity: 1;
}

.loading-card {
  background: rgba(13, 18, 30, 0.95);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 35px rgba(0, 242, 254, 0.25), 0 20px 40px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
  padding: 36px 42px;
  width: 440px;
  max-width: 90vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.loading-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00f2fe, #4facfe, #00f2fe);
  background-size: 200% 100%;
  animation: shineGradient 2s linear infinite;
}

@keyframes shineGradient {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.loading-icon-spinner {
  font-size: 2.4rem;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
}

.loading-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.loading-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.4;
  min-height: 38px;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.8);
  border-radius: 6px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-percent {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}
