/* Gallery Filters */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 12px;
  justify-content: center;
  align-items: center;
}

.gallery-filters .btn-filter {
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  color: #333;
  font-size: 15px;
  padding: 2px 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  margin: 5px;
}

.gallery-filters .btn-filter:hover {
  background: #f8f9fa;
  border-color: #008374;
  color: #008374;
}

.gallery-filters .btn-filter.active,
.gallery-filters button.btn-filter.active {
  background-color: #008374 !important;
  border-color: #008374 !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
}

/* Main Gallery Image */
.gallery-main-image {
  position: relative;
  width: 100%;
  padding-top: 66.67%; /* 3:2 aspect ratio */
  margin-bottom: 10px;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
}

.gallery-main-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px; 
}

/* Gallery Navigation */
.gallery-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.gallery-navigation button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-prev {
  left: 20px;
}

.nav-next {
  right: 20px;
}

.gallery-navigation button:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.gallery-navigation i {
  font-size: 20px;
  color: #333;
}

/* Image Counter */
.image-counter {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2;
}

/* Thumbnails Gallery */
.gallery-thumbnails {
  margin-top: 10px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.gallery-thumbnails .row {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 10px;
  margin: 0;
  padding: 0 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  position: relative;
}

.gallery-thumbnails .row::-webkit-scrollbar {
  display: none;
}

.gallery-item {
  flex: 0 0 120px;
  padding: 0;
  flex-shrink: 0;
}

.thumbnail {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.8;
  filter: blur(1px);
  border: none;
}

.thumbnail:hover {
  opacity: 0.9;
  filter: blur(0.5px);
}

.thumbnail.active {
  opacity: 1;
  filter: none !important;
  border: none;
}

/* Thumbnails Navigation */
.thumbnails-navigation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.thumbnails-navigation button {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  pointer-events: auto;
  transition: all 0.3s ease;
  position: relative;
}

.thumbnails-navigation button:hover {
  background: white;
  transform: scale(1.1);
}

.thumbnails-navigation button i {
  font-size: 18px;
  color: #333;
}

.thumbnails-prev {
  margin-right: auto;
}

.thumbnails-next {
  margin-left: auto;
}

/* Modal Styles */
.modal-dialog {
  max-width: 80vw;
  margin: 1.75rem auto;
  height: calc(100vh - 6rem);
  display: flex;
  align-items: center;
}

.modal-content {
  background: rgba(0, 0, 0, 0.9);
  border: none;
  height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.modal-header {
  border: none;
  padding: 1rem;
  position: absolute;
  right: 0;
  z-index: 1050;
}

.modal-header .btn-close {
  background-color: white;
  opacity: 0.8;
  margin: 0;
  padding: 0.5rem;
}

.modal-header .btn-close:hover {
  opacity: 1;
}

.modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  overflow: hidden;
}

.modal-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  margin: auto;
  display: block;
}

.modal-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1200;
}

.modal-nav-prev,
.modal-nav-next {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-nav-prev:hover,
.modal-nav-next:hover {
  background: white;
  transform: scale(1.1);
}

.modal-nav-prev i,
.modal-nav-next i {
  font-size: 24px;
  color: #333;
}

.modal-image-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1050;
}

/* Mobile Responsive */
@media screen and (max-width: 767px) {
  /* Add gap between gallery and sidebar in mobile */
  .property-info-sidebar {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
  }
  .gallery-thumbnails {
    margin: 10px -15px 0;
    padding: 0;
  }

  .gallery-thumbnails .row {
    padding: 0 15px;
    gap: 8px;
  }

  .gallery-item {
    flex: 0 0 90px !important;
    display: flex;
    justify-content: center;
  }
  
  .thumbnail {
    width: 90px !important;
    height: 60px !important;
  }

  .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
    height: calc(100vh - 4rem);
  }
  
  .modal-content {
    height: 80vh;
  }
  
  .modal-body {
    padding: 2rem 0.5rem;
  }
  
  .modal-image {
    max-width: 95%;
    max-height: 65vh;
  }
}
