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

html {
  font-size: 14px; /* Adjust base font size to make overall UI smaller */
}

body {
  font-family: Arial, sans-serif;
  /* padding: 20px; */ /* Removed for full-width layout */
  margin: 0;
  background: #eef2f9;
}

.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0 auto;
  max-width: 1920px;
  background: #fff;
}


.left-column-list {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 90vh; /* Set a specific height for the list */
}

.search-bar-container {
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.search-input {
  padding-left: 35px;
}

.feature-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.feature-list {
  margin: 0;
  padding: 0;
}

.right-column-details {
  display: grid;
  grid-template-rows: minmax(0, 55fr) minmax(0, 45fr); /* Flexible rows */
  gap: 20px;
  overflow: hidden;
  height: 100%;
}

.map-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  height: 100%; /* Fill the grid row */
  overflow: hidden; /* Hide anything that might spill out */
}

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

#dashboard-container {
    padding: 1rem;
    background-color: #ffffff;
    border-radius: .25rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

#dashboard-container .form-control-sm {
    font-size: 0.8rem;
}

#dashboard-container label {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: .2rem;
}

#dashboard-container .mt-1 {
    font-size: 0.8rem;
    font-style: italic;
}

#dashboard-container hr {
    margin-top: 10px;
    margin-bottom: 10px;
}

.details-scroll-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  padding: 15px;
  height: 100%; /* Fill the grid row */
}

.details-card {
  height: 100%;
  position: relative; /* For positioning the initial message */
}

.initial-message {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  color: #6c757d;
  font-size: 1.2rem;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 1; /* Ensure it's above featureProperties when visible */
}

.initial-message p {
  margin: 0;
}

/* Hide feature properties when initial message is shown */
.details-card:not(.has-selection) #featureProperties {
  display: none;
}

/* Show initial message when no selection */
.details-card.has-selection .initial-message {
  display: none;
}

.main-content-wrapper {
  margin-left: 80px;
  padding: 20px;
  background: #f8f9fa;
  min-height: 100vh;
  width: calc(100% - 80px);
}

.main-header-bar {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.main-title {
  font-size: 1.25rem;
  color: #333;
  margin: 0;
  font-weight: 500;
}

#search {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

th {
  background-color: #f2f2f2;
}

.right-panel {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#map {
  height: 400px;
  margin-bottom: 20px;
}

.details .section {
  margin-bottom: 20px;
}

.details table {
}

.section-header {
  margin-top: 20px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.section-header h3 {
  font-size: 1rem;
  color: #555;
  margin: 0;
  text-transform: uppercase;
  font-weight: bold;
}

.section-content {
  margin-bottom: 15px;
}

/* Add any custom styles here */

.leaflet-control-layers {
    z-index: 1000;
}

.photo-grid {
  display: flex;
  flex-direction: row;
  overflow-x: auto; /* Enable horizontal scrolling */
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.photo-grid img {
  flex-shrink: 0; /* Prevent images from shrinking */
  width: 200px; /* Increased width for larger images */
  height: 150px; /* Increased height for larger images */
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.video-player {
  max-width: 100%;
  width: 320px; /* Fixed width for video player */
  height: 240px; /* Fixed height for video player */
  display: block;
  margin: 10px 0;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.broken-media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px; /* Same width as images */
  height: 150px; /* Same height as images */
  background-color: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 4px;
  color: #888;
  font-size: 0.9em;
  text-align: center;
  flex-shrink: 0;
}

.broken-media-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin-bottom: 5px;
}

.broken-media-placeholder.video {
  width: 320px; /* Same width as video player */
  height: 240px; /* Same height as video player */
}

.broken-media-placeholder.video img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .content-columns {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 992px) {
  body {
    overflow-y: auto; /* Enable scrolling on body for mobile */
  }

  .main-content-wrapper {
    height: auto;
    min-height: 100vh;
    margin-left: 0; /* Remove margin when sidebar might be hidden or different */
    width: 100%;
  }

  .content-columns {
    display: flex;
    flex-direction: column;
  }

  .left-column-list {
    height: 80vh !important; /* Force height with !important */
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .feature-list-scroll {
    flex-grow: 1;
    overflow-y: auto;
  }

  .right-column-details {
    display: flex;
    flex-direction: column; /* Stack map and details */
    height: auto;
  }

  .map-card {
    height: 400px; /* Fixed map height */
  }

  .details-scroll-container {
    height: auto; /* Allow details to grow */
    max-height: 60vh;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .main-content-wrapper {
    padding: 10px;
  }

  .content-columns {
    padding: 0 10px 10px 10px;
  }

  .main-header-bar {
    padding: 10px 15px;
  }

  .main-title {
    font-size: 1.5rem;
  }
}