/* Reset/default styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f7f7f7;
  color: #333;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

.search-container {
  margin-top: 10px;
}

#search {
  padding: 10px;
  width: 80%;
  max-width: 400px;
  font-size: 1rem;
}

#profiles-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 350px;
  width: 100%;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 15px;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.9rem;
  line-height: 1.4;
}

.email-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: 0.9rem;
}

/* Visually-hidden class for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Load More button styles */
.load-more-container {
  margin-top: 20px;
  text-align: center;
}

#load-more {
  padding: 10px 20px;
  display: block;
  margin: 0 auto;
  font-size: 1rem;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#load-more:hover {
  background-color: #0056b3;
}

/* Toggle description button styles */
.toggle-desc-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
  margin-top: 5px;
  padding: 0;
} 

/* Basic styling for the sort dropdown and export button in the search container */
.search-container select,
.search-container #export-csv,
.search-container #export-json {
  padding: 8px;
  font-size: 1rem;
  margin-top: 10px;
  margin-right: 10px;
}

.firm-count {
  font-weight: bold;
  margin-top: 10px;
}

/* Truncate long links within profile cards */
.card a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-toggle {
  margin: 15px 0;
}

.view-btn {
  padding: 8px 16px;
  margin: 0 5px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  border-radius: 4px;
}

.view-btn.active {
  background: #007bff;
  color: white;
  border-color: #0056b3;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

#map-container {
  width: 100%;
  height: 600px;
  margin-bottom: 30px;
  border: 1px solid #ccc;
  background: #e5e5e5;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #e5e5e5;
}

/* Ensure the map container is visible when active */
#map-container.active-view {
  display: block !important;
}

/* Ensure proper spacing when map is visible */
#map-container.active-view + #profiles-container {
  margin-top: 30px;
}

.mapboxgl-popup {
  max-width: 300px;
}

.mapboxgl-popup-content {
  padding: 15px;
}

.map-popup {
  font-size: 14px;
}

.map-popup h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.map-popup img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 4px;
}

.map-popup p {
  margin: 5px 0;
}

.map-error {
  padding: 20px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-error h3 {
  color: #dc3545;
  margin-bottom: 10px;
}

.no-image {
  height: 200px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  border-radius: 4px;
  margin-bottom: 15px;
}

/* Add placeholder image styling */
img[src="placeholder.png"] {
  height: 200px;
  width: 100%;
  object-fit: cover;
  background: #f8f9fa;
}

.map-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

#marker-count {
  font-weight: bold;
  color: #007bff;
}

/* New styles for the radial filter controls */
.radial-filter-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  z-index: 2;
}

.radial-filter-controls p {
  margin-bottom: 5px;
}

.radial-filter-controls label {
  margin-right: 5px;
}

.radial-filter-controls input {
  width: 60px;
  padding: 4px;
  margin-right: 5px;
}

.radial-filter-controls button {
  padding: 4px 8px;
  margin-right: 5px;
  font-size: 0.9rem;
  cursor: pointer;
}