/* 
 * Elegant Light & Soft Minimalist Styling System
 * Soft whites, slate blues, pastel alerts, and rounded, friendly borders.
 * Modern SaaS utility aesthetic. Zero glassmorphism.
 */

:root {
  --bg-primary: #f4f6f9;
  --bg-secondary: #ffffff;
  --bg-panel: #ffffff;
  --bg-active: #2d3142;
  
  --text-primary: #2d3142;
  --text-secondary: #4f5d75;
  --text-muted: #9fa8da;
  
  --border-light: #e8ebf0;
  --border-medium: #cfd8dc;
  --border-heavy: #2d3142;
  
  --color-active: #4caf50; /* Soft Pastel Green */
  --color-maint: #ff9800;  /* Soft Pastel Orange */
  --color-degraded: #f44336; /* Soft Pastel Red */
  
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-display);
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.dashboard {
  display: block;
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
}

.sidebar-header {
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.sidebar-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Panel Structure */
.panel {
  border: 1px solid var(--border-light);
  background-color: var(--bg-panel);
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.panel-title {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
}

.stat-label {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.text-active { color: var(--color-active); }
.text-maint { color: var(--color-maint); }
.text-degraded { color: var(--color-degraded); }

/* Buttons */
.btn {
  background-color: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  padding: 8px 14px;
  text-align: center;
  transition: all 0.15s ease;
}

.btn:hover {
  background-color: var(--text-primary);
  color: #ffffff;
  border-color: var(--border-heavy);
}

.btn-solid {
  background-color: var(--text-primary);
  border-color: var(--border-heavy);
  color: #ffffff;
}

.btn-solid:hover {
  background-color: #3d4356;
}

.btn-outline {
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

.btn-mini {
  font-size: 10px;
  padding: 6px 10px;
}

.btn.active {
  background-color: var(--text-primary);
  color: #ffffff;
  border-color: var(--border-heavy);
}

.w-100 { width: 100%; }

/* Carrier Buttons Group */
.carrier-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Tower List */
.list-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tower-list-container {
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 4px;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
}

/* Tower Card */
.tower-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 8px;
  padding: 12px;
  transition: all 0.15s ease;
}

.tower-card:hover {
  border-color: var(--border-medium);
  background-color: #f8fafc;
}

.tower-card.selected {
  border-color: var(--border-heavy);
  background-color: #edf2f7;
}

.tower-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.tower-id {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}

.tower-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-active { background-color: var(--color-active); }
.status-maint { background-color: var(--color-maint); }
.status-degraded { background-color: var(--color-degraded); }

.tower-card-body h3 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.tower-meta {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  display: flex;
  gap: 12px;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
}

/* Map Viewport Area */
.map-viewport {
  position: relative;
  height: 100%;
  width: 100%;
}

#map-container {
  height: 100%;
  width: 100%;
  background-color: var(--bg-primary);
}

.map-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  background-color: var(--bg-primary);
}

.placeholder-content {
  text-align: center;
  max-width: 400px;
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background-color: var(--bg-panel);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.placeholder-content h3 {
  font-size: 18px;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.placeholder-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Info Overlay */
.map-info-overlay {
  position: absolute;
  top: 24px;
  right: 24px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  width: 280px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.map-info-overlay h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

#info-location {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
}

#info-coords {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.camera-controls {
  display: flex;
  gap: 6px;
}

/* Command Console */
.prompt-console {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.agent-output {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.agent-prompt-indicator {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}

.agent-message {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
}

.prompt-form {
  display: flex;
}

.input-flat {
  background-color: var(--bg-panel);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 14px 16px;
  flex-grow: 1;
}

.input-flat:focus {
  outline: none;
  background-color: #fcfdfe;
}

.prompt-form .btn {
  border: none;
  border-left: 1px solid var(--border-light);
  border-radius: 0px;
  padding: 14px 24px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 450px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.btn-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group .input-flat {
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  width: 100%;
}

.form-group .input-flat:focus {
  border-color: var(--border-heavy);
}

.help-text {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Pulsing Bullseye Markers */
.bullseye-container {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  --marker-color: #4285f4; /* Default to Google's Blue brand color */
}

/* Owner company coloring classes (overridden to Google Blue per user request, but defined for completeness/flexibility) */
.carrier-verizon {
  --marker-color: #4285f4; /* Google's Blue */
}
.carrier-t-mobile {
  --marker-color: #4285f4; /* Google's Blue */
}
.carrier-at-and-t {
  --marker-color: #4285f4; /* Google's Blue */
}
.carrier-maintenance {
  --marker-color: #ff9500; /* Retained Amber Warning for maintenance */
}

.bullseye-center {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--marker-color);
  border: 6px solid #ffffff;
  box-shadow: 0 0 30px var(--marker-color);
  z-index: 2;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.bullseye-ring {
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 6px solid var(--marker-color);
  opacity: 0;
  z-index: 1;
  transition: border-width 0.2s ease;
}

/* Selected state enhancements */
.bullseye-container.selected .bullseye-center {
  transform: scale(1.3);
  box-shadow: 0 0 48px var(--marker-color);
  background-color: #ffffff;
  border-color: var(--marker-color);
}

.bullseye-container.selected .bullseye-ring {
  border-width: 9px;
  opacity: 0.3;
}

/* Custom 3D Marker Pulsing migrated to native SVG elements within the HTML template for WebGL rendering stability */

/* Floating Places Autocomplete container */
.map-search-container {
  position: absolute;
  left: 20px;
  top: 85px; /* Stacked below layer controls */
  z-index: 1000;
  width: 416px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Floating Map Layer Controls */
.map-layer-controls {
  position: absolute;
  left: 20px;
  top: 20px; /* Placed at top-left viewport corner */
  z-index: 1000;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}

.control-separator {
  width: 1px;
  height: 16px;
  background-color: var(--border-light);
  margin: 0 14px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.toggle-control.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.toggle-control input {
  display: none;
}

.toggle-indicator {
  position: relative;
  width: 32px;
  height: 18px;
  background-color: var(--border-medium);
  border-radius: 9px;
  transition: background-color 0.2s ease;
}

.toggle-indicator::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ffffff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.toggle-control input:checked + .toggle-indicator {
  background-color: #4285f4; /* Google Blue brand color */
}

.toggle-control input:checked + .toggle-indicator::after {
  transform: translateX(14px);
}

/* Premium styling for OpenCellid On-Demand Button */
.opencellid-btn {
  background-color: rgba(66, 133, 244, 0.1); /* Soft premium Google Blue tint */
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 6px;
  color: #82b1ff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  width: auto;
  margin-left: 2px;
}

.opencellid-btn:hover {
  background-color: rgba(66, 133, 244, 0.2);
  border-color: rgba(66, 133, 244, 0.5);
  color: #fff;
  box-shadow: 0 0 10px rgba(66, 133, 244, 0.25);
}

.opencellid-btn:active {
  transform: scale(0.97);
}

/* Green theme when active representing live-towers mode */
.opencellid-btn.active {
  background-color: rgba(0, 230, 118, 0.1);
  border-color: rgba(0, 230, 118, 0.3);
  color: #69f0ae;
}

.opencellid-btn.active:hover {
  background-color: rgba(0, 230, 118, 0.2);
  border-color: rgba(0, 230, 118, 0.5);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.25);
}

.opencellid-btn.loading {
  background-color: rgba(255, 152, 0, 0.1) !important;
  border-color: rgba(255, 152, 0, 0.3) !important;
  color: #ffb74d !important;
  cursor: wait !important;
}

.opencellid-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-muted) !important;
}

/* Margin Utilities */
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }

/* Place Autocomplete Web Component style */
gmp-place-autocomplete {
  width: 100%;
  --gmp-place-autocomplete-box-shadow: none;
  --gmp-place-autocomplete-border: 1px solid var(--border-medium);
  --gmp-place-autocomplete-border-radius: 6px;
  --gmp-place-autocomplete-font-family: var(--font-display);
  --gmp-place-autocomplete-font-size: 13px;
  --gmp-place-autocomplete-padding: 8px 12px;
}

gmp-place-autocomplete:focus-within {
  --gmp-place-autocomplete-border: 1px solid var(--text-primary);
}

/* Floating Map Toast Notification Container (Bottom-Left) */
.map-toast-container {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start; /* Left-align toasts */
  pointer-events: none; /* Let clicks pass through to map beneath */
  z-index: 1010; /* Float above bottom panel (1000) */
  max-width: 90%;
  width: 420px;
  transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Slide messaging up when bottom scout panel is open */
.dashboard.scout-panel-open .map-toast-container {
  bottom: 370px; /* Float above the 330px bottom panel + 40px margin spacing */
}

/* Premium Glassmorphic Toast Message Box */
.map-toast {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(228, 231, 235, 0.6);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.08), 
    0 2px 4px rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto; /* Let clicks focus the toast if clicked */
  width: 100%;
  box-sizing: border-box;
  
  /* Animations: Slide in from below, scale slightly */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: 
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    margin-top 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.2s ease;
}

/* Compact Premium Regenerate Button */
.mini-regenerate-btn {
  margin-left: 12px;
  background: var(--text-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(45, 49, 66, 0.15);
  transition: all 0.2s ease;
}

.mini-regenerate-btn:hover {
  background: #3c425e;
  transform: translateY(-0.5px);
  box-shadow: 0 4px 10px rgba(45, 49, 66, 0.25);
}

.mini-regenerate-btn:active {
  transform: translateY(0.5px);
}

.map-toast:hover {
  filter: brightness(0.98);
}

.map-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.map-toast.hide {
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
  margin-top: -50px; /* Animate space collapsing */
}

/* Accent Sidebars and Colors for Toast States */
.map-toast-info {
  border-left: 4px solid #4285f4; /* Google Blue */
}

.map-toast-success {
  border-left: 4px solid #34a853; /* Google Green */
}

.map-toast-warning {
  border-left: 4px solid #fbbc05; /* Google Yellow */
}

.map-toast-error {
  border-left: 4px solid #ea4335; /* Google Red */
  background: rgba(255, 245, 245, 0.94);
}

.map-toast-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: var(--bg-primary);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.map-toast-message {
  flex-grow: 1;
  line-height: 1.45;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.map-toast-message strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 12px;
}


/* Site Scouting Telemetry Box */
.scout-coords-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  transition: all 0.2s ease;
}

.scout-coords-box.active {
  border-color: #4285f4;
  background-color: #f0f7ff;
  color: #1a73e8;
  font-weight: 500;
}

/* Embedded Street View Portal framing */
/* Embedded Street View Portal and Bottom Scout Drawer */
.scout-panel-bottom {
  position: absolute;
  bottom: -430px; /* Start hidden (accommodates increased height) */
  left: 20px;
  right: 20px;
  height: 380px; /* Increased height to cleanly fit new header + viewports */
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(228, 231, 235, 0.8);
  border-radius: 16px 16px 12px 12px;
  box-shadow: 
    0 -12px 36px rgba(0, 0, 0, 0.08), 
    0 -2px 8px rgba(0, 0, 0, 0.03);
  z-index: 1000;
  transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1), right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px 18px 18px 18px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scout-panel-bottom.show {
  bottom: 20px; /* Pinned 20px floating above bottom of screen */
}

/* Bottom Insights Panel Overall Header Bar */
.scout-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(228, 231, 235, 0.7);
  padding-bottom: 10px;
  margin-bottom: 12px;
  min-height: 40px;
  flex-shrink: 0;
}

.scout-panel-heading-left {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.scout-panel-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: #1a73e8; /* Soft Google Blue */
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1;
}

.scout-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
}

.scout-panel-place-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
  flex-shrink: 0;
}

.scout-panel-separator {
  color: var(--text-secondary);
  font-size: 12px;
  opacity: 0.4;
  user-select: none;
  flex-shrink: 0;
}

.scout-panel-address {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

/* Close button for Scout Drawer */
.close-scout-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.close-scout-btn:hover {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

/* Double Viewport Layout */
.scout-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.scout-viewport-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.scout-viewport-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.badge {
  background-color: #4285f4;
  color: #ffffff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Inner containers */
.scout-portal-container {
  flex-grow: 1;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background-color: var(--bg-primary);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
  min-height: 0;
}

.scout-portal-element {
  width: 100%;
  height: 100%;
}

.scout-portal-placeholder-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Aerial View Container Styles */
.aerial-view-container {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  min-height: 0;
  transition: grid-template-columns 0.3s ease;
}

.aerial-view-container.no-snippet {
  grid-template-columns: 1fr;
}

.snippet-explanation {
  font-size: 11px;
  color: #ffb74d; /* Warm orange to denote explanation/fallback status */
  margin-bottom: 10px;
  line-height: 1.4;
  background: rgba(255, 183, 77, 0.05);
  border-left: 3px solid #ffb74d;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
}

.aerial-video-wrapper {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  background-color: #000;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
  height: 100%;
  min-height: 0;
}

.aerial-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.05);
}

/* Aerial Video Overlay states */
.aerial-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  transition: all 0.3s ease;
}

/* Success state: hide overlay */
.aerial-video-overlay.success {
  display: none !important;
}

/* Loading, Processing, Fallback, and Error states: centered full dark overlays */
.aerial-video-overlay.loading,
.aerial-video-overlay.processing,
.aerial-video-overlay.fallback,
.aerial-video-overlay.error {
  background: rgba(12, 12, 24, 0.94);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.aerial-video-overlay .overlay-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.aerial-video-overlay .overlay-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #80deea;
  border-radius: 50%;
  animation: aerial-spinner 0.8s linear infinite;
  margin-bottom: 12px;
}

.aerial-video-overlay .overlay-spinner.processing {
  border-top-color: #ffb74d;
}

.aerial-video-overlay .overlay-message {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.aerial-video-overlay .overlay-caption {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 85%;
  text-align: center;
  line-height: 1.4;
}

@keyframes aerial-spinner {
  to { transform: rotate(360deg); }
}

/* Premium instructions & documentation link in overlay */
.overlay-instructions {
  margin: 12px 0 8px 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  max-width: 90%;
  box-sizing: border-box;
}

.instructions-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #80deea;
  text-align: left;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.instructions-list {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  padding-left: 14px;
  margin: 0;
  line-height: 1.5;
}

.instructions-list li {
  margin-bottom: 4px;
}

.instructions-list li:last-child {
  margin-bottom: 0;
}

.instructions-list li code {
  background: rgba(128, 222, 234, 0.12);
  color: #80deea;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.overlay-doc-btn {
  background: rgba(128, 222, 234, 0.1);
  border: 1px solid rgba(128, 222, 234, 0.25);
  color: #80deea;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin-top: 4px;
  transition: all 0.25s ease;
  cursor: pointer;
  pointer-events: auto !important;
}

.overlay-doc-btn:hover {
  background: rgba(128, 222, 234, 0.2);
  border-color: rgba(128, 222, 234, 0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(128, 222, 234, 0.15);
}

.overlay-doc-btn svg {
  transition: transform 0.2s ease;
}

.overlay-doc-btn:hover svg {
  transform: translate(1px, -1px);
}

.aerial-overlay-info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}

.aerial-coords-text {
  color: #80deea;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.aerial-snippet-panel {
  background: #1e1e24;
  border: 1px solid #2d2d34;
  border-radius: 10px;
  padding: 10px 14px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.snippet-header {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #90a4ae;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2d2d34;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.snippet-code {
  flex-grow: 1;
  overflow-y: auto;
  font-family: monospace;
  font-size: 10px;
  color: #eceff1;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.snippet-code code {
  color: #80cbc4; /* Soft cyan syntax color */
}

/* Floating Market Demand Side Panel (Right) */
.demand-panel-right {
  position: absolute;
  top: 20px;
  right: -360px; /* Start hidden */
  width: 330px;
  height: calc(100vh - 40px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(228, 231, 235, 0.8);
  border-radius: 16px;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.08), 2px 2px 8px rgba(0, 0, 0, 0.02);
  z-index: 1005;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.demand-panel-right.show {
  right: 20px; /* Slide into view */
}

/* Header style */
.demand-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.demand-panel-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* Close panel button */
.close-panel-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
}

.close-panel-btn:hover {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.demand-panel-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow-y: auto;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Place type filters section */
.filter-section {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Premium Checkbox Tiles */
.category-checkbox-label {
  display: block;
  cursor: pointer;
}

.category-checkbox-label input {
  display: none; /* Hide real input */
}

.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.category-checkbox-label input:checked + .category-card {
  background: rgba(76, 175, 80, 0.08); /* Soft pastel green tint */
  border-color: var(--color-active);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.06);
}

.category-icon {
  font-size: 18px;
}

.category-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.category-checkbox-label input:checked + .category-card .category-name {
  color: #2e7d32; /* Richer green for contrast */
}

/* Regenerate heatmap button */
.glow-btn {
  background: var(--text-primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(45, 49, 66, 0.2);
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.glow-btn:hover {
  background: #3c425e;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 49, 66, 0.3);
}

.glow-btn:active {
  transform: translateY(1px);
}

/* Telemetry Card */
.status-summary-card {
  border: 1px solid var(--border-light);
  background-color: var(--bg-panel);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  margin-bottom: 12px;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.telemetry-row:last-child {
  margin-bottom: 0;
}

.tel-label {
  color: var(--text-secondary);
}

.tel-val {
  font-weight: 600;
  color: var(--text-primary);
}

/* Adjustments when demand side panel is open */
.dashboard.demand-panel-open .scout-panel-bottom {
  right: 370px; /* Leave space for the right panel + 20px gap */
}

/* Floating Market Demand Legend */
.demand-legend {
  position: static;
  width: 240px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.legend-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legend-description {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  font-weight: 400;
}

.legend-scale {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-gradient {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, hsla(120, 85%, 50%, 0.8), hsla(60, 85%, 50%, 0.8), hsla(30, 85%, 50%, 0.8), hsla(0, 85%, 50%, 0.8));
}

.legend-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Right Floating Map Controls & Layout */
.right-map-controls-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  pointer-events: none;
}

.demand-control-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  pointer-events: auto;
}
