/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f2f2f2;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

h1 {
  text-align: center;
}

/* Filters Wrapper */
.filters-wrapper {
  width: 95%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.filters-container,
.filter-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 100%;
  justify-content: space-between;
}

/* All filter elements (dropdowns + button) */
.filter-select,
.sort-button {
  padding: 6px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
  flex: 1 1 calc(16.66% - 10px); /* 6 per row with 10px gaps */
  max-width: calc(16.66% - 10px);
  min-width: 120px;
  box-sizing: border-box;
  white-space: nowrap;
}

/* Sort Button Styling */
.sort-button {
  background-color: #B4905A;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.sort-button:hover {
  background-color: #a07c44;
}

/* Main Content Layout */
.main-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 2.5%;
  box-sizing: border-box;
  height: 85vh;
  margin-top: 1%;
}

/* Map Container */
.map-container {
  width: 35%;
  height: 100%;
  box-sizing: border-box;
  border: 2px solid #B4905A;
}

/* Table Container */
.table-container {
  width: 65%;
  height: 100%;
  overflow-y: auto;
  background-color: #f9f9f9;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  border: 2px solid #B4905A;
}

/* Property Card with 3 columns */
.card {
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  width: 100%;
  text-align: left;
  font-size: 12px;
  border: 1px solid #ddd;
  box-sizing: border-box;
  
  display: grid;
  grid-template-columns: 2fr 2fr 1fr; /* 2 text columns + 1 image column */
  gap: 15px;
  align-items: start;
}

/* Text Columns Styling */
.text-column-1, .text-column-2 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Field Styling */
.field {
  margin-bottom: 6px;
}

.label {
  font-weight: 600;
  color: #B4905A;
  margin-right: 5px;
}

.value {
  color: #000;
}

/* Images Container */
.images-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);

  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0; /* optional background for empty space */
}

/* Image styling */
.images-container img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show full image inside container */
  border-radius: 8px;
  display: block;
}

/* Navigation buttons */
.img-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  border: none;
  color: #B4905A;
  font-weight: bold;
  font-size: 12px;
  width: 25px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 10;
  opacity:0.6;
}

.img-nav-btn:hover {
  background-color: rgba(128, 128, 128, 0.2); /* light grey transparent */
  color: #555; /* darker grey on hover */
}

/* Positioning prev and next buttons */
.prev-btn {
  left: 5px;
}

.next-btn {
  right: 5px;
}


/* No image placeholder */
.no-image {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Pagination */
.pagination-container {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  background-color: #eee;
  border: 1px solid #ccc;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
}

.page-btn:hover:not(:disabled) {
  background-color: #ddd;
}

.page-btn:disabled {
  cursor: default;
  background-color: #bbb;
  color: #666;
}

/* J&K Label */
.jandk-label {
  font-weight: bold;
  font-size: 8px;
  color: grey;
  border: 1px solid #ccc;
  padding: 2px 5px;
  border-radius: 5px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 1px 1px 2px #fff;
}

/* Leaflet default tooltip container styling */
.leaflet-tooltip {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

/* Responsive Design */
@media (max-width: 800px) {
  .filters-wrapper {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
  }

  .filters-container,
  .filter-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
  }

  .filter-select,
  .sort-button {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
    box-sizing: border-box;
    margin: 0;
    padding: 6px 8px;
    min-width: 0;
  }

  .main-content {
    flex-direction: column;
    height: auto;
    padding: 0 5%;
  }

  .map-container {
    width: 100%;
    height: 60vh;
  }

  .table-container {
    width: 100%;
    height: 150vh;
  }

  /* Cards switch to single column on mobile */
  .card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .images-container {
    min-height: 50px !important;  /* prevents fixed height */
    height: auto;
    max-height: 250px;
  }

  .img-nav-btn {
    width: 25px;
    height: 35px;
    font-size: 18px;
  }
}
.ad-images-container {
  width: 20%;
  height: 100% !important;
  overflow-y: auto;
  border: 2px solid #B4905A;
  background-color: #fff;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
    justify-content: center; /* Vertical centering */
  align-items: center;     /* Horizontal centering */
}

.ad-images-container img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.ad-images-title {
  font-size: 14px;
  font-weight: bold;
  color: #B4905A;
  justify-content: center; /* Vertical centering */
  align-items: center;
}

@media (max-width: 800px) {
  .ad-images-container {
    order: -1; /* Move to top in flex layout */
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    padding: 5px;
    gap: 5px;
  }

  .ad-images-container img {
    height: 100px !important;
    width: auto;
    object-fit: contain;
    flex: 0 0 auto;
  }

  .ad-images-title {
    display: none; /* Hide "Advertisements" title on mobile */
  }
  .ad-carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
    }
    .ad-carousel-image {
      max-height: 100%;
      max-width: 100%;
      object-fit: contain;
      border-radius: 8px;
      cursor: pointer;
      display: block;
      margin: auto;
    }
}
.ad-carousel-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-carousel-image {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  margin: auto;
}

.ad-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(180, 144, 90, 0.7); /* Theme color */
  border: none;
  color: white;
  font-size: 24px;
  padding: 4px 10px;
  cursor: pointer;
  z-index: 1;
  border-radius: 4px;
}

.left-arrow {
  left: 10px;
}

.right-arrow {
  right: 10px;
}

.ad-dots-container {
  text-align: center;
  margin-top: 10px;
}

.ad-dot {
  height: 10px;
  width: 10px;
  margin: 0 4px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.ad-dot.active {
  background-color: #B4905A;
}
