/* Filter Panel Styling */
#filter-panel {
  position: absolute;
  top: 20px;
  left: -280px; /* Start off-screen from left side */
  width: 260px;
  max-height: calc(100vh - 40px); /* Limit height to viewport minus margins */
  z-index: 1000;
  font-size: 14px;
  display: block; /* Always display, but positioned off-screen initially */
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
  transition: left 0.5s ease-in-out; /* Changed from right to left transition */
  display: flex;
  flex-direction: column;
  border:none;
}

#filter-panel.visible {
  left: 20px; /* Final position when visible */
}

/* Filter panel in sidebar */
#filter-sidebar-container #filter-panel {
  position: static;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  margin-right: 0;
  margin-bottom: 0;
  transition: none;
  box-shadow: none;
  border: none;
  display: flex;
  flex-direction: column;
}

#filter-sidebar-container #filter-panel.visible {
  right: auto;
}

/* Add padding to filter content in sidebar */
#filter-sidebar-container .filter-content {
  padding: 0 15px 15px;
  flex: 1;
  overflow-y: auto;
}

/* Add padding to filter footer in sidebar */
#filter-sidebar-container .filter-footer {
  padding: 10px 15px;
  flex-shrink: 0;
}

#filter-header {
  cursor: grab;
  padding: 8px 12px;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; /* Prevent header from shrinking */
  position: relative; /* For tooltip positioning */
  touch-action: none; /* Prevent scrolling while dragging on mobile */
}

/* Increase touch target size when dragging on mobile */
#filter-header.active-drag {
  cursor: grabbing;
}

/* Styling for the filter header in sidebar mode */
#filter-sidebar-container #filter-header {
  cursor: default;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 0;
  background-color: #ffffff;
  color: #333;
  flex-shrink: 0;
  padding: 10px 15px;
  height: 55px; 
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Hide collapse button in sidebar view */
#filter-sidebar-container #collapse-toggle {
  display: none;
}

#filter-sidebar-container .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#filter-header:active {
  cursor: grabbing;
}


#filter-header:hover::after {
  opacity: 1;
}

/* Hide tooltip in sidebar mode */
#filter-sidebar-container #filter-header::after {
  display: none;
}

#collapse-toggle {
  cursor: pointer;
  padding: 0 4px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#collapse-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#filter-panel.collapsed .card-body {
  display: none;
}

#filter-panel.collapsed {
  transition: transform 0.3s ease-in-out, left 0.3s ease-in-out, bottom 0.3s ease-in-out, top 0.3s ease-in-out;
  width: auto !important; /* Allow width to shrink to content */
  min-width: 180px; /* Ensure minimum width */
}

/* Make the header more visible when collapsed */
#filter-panel.collapsed #filter-header {
  border-radius: 5px; /* Give it rounded corners when collapsed */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Add stronger shadow for visibility */
}

#collapse-toggle i {
  transform: rotate(0deg);
  transition: transform 0.3s ease-in-out;
  display: inline-block; /* Ensures transform works properly */
}

#filter-panel.collapsed #collapse-toggle i {
  transform: rotate(180deg);
}

/* Filter panel state transitions */
#filter-panel.transitioning {
  transition: none !important;
}

#filter-panel:not(.transitioning) {
  transition: right 0.5s ease-in-out, opacity 0.3s ease-in-out;
}

.card-body { /* Note: This might be too general, consider scoping if needed */
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scrollable filter content */
.filter-content {
  flex: 1 1 auto;
  overflow-y: auto;
  scroll-behavior: smooth;
  /* For Firefox */
  scrollbar-width: thin;
  scrollbar-color: #ccc #f1f1f1;
}

/* Scrollbar styling for Chrome, Safari, and Edge */
.filter-content::-webkit-scrollbar {
  width: 6px;
}

.filter-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.filter-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Fixed footer */
.filter-footer {
  flex-shrink: 0;
  background-color: #fff;
  padding-top:0px!important;
}

.filter-footer hr {
  margin-top:0px!important;
}

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


.section-header {
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 8px;
}

.section-header:hover {
  background-color: #e9ecef;
}

.section-header i {
  transition: transform 0.2s;
}

.section-header.collapsed i {
  transform: rotate(-90deg);
}

/* Checkbox spacing */
.form-check {
  margin-bottom: 3px;
  padding-left: 1.8rem;
}

/* Price slider styling */
.ui-slider {
  margin: 8px 10px;
  height: 5px;
  background: #e9ecef;
  border: none;
  border-radius: 3px;
  width: calc(100% - 20px);
}

.ui-slider .ui-slider-range {
  background: var(--bs-primary);
}

.ui-slider .ui-slider-handle {
  width: 16px;
  height: 16px;
  background: var(--bs-primary);
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  top: -6px;
  touch-action: none;
}

.ui-slider .ui-slider-handle:focus {
  outline: none;
}

/* Button styling for bedrooms */
.btn-group {
  margin-top: 5px;
}


/* Disclaimer text styling */
.disclaimer {
  color: #6c757d;
  font-size: 10px;
  line-height: 1.2;
  padding: 0 5px;
}

/* Filters button with slide indicator */
#show-filters-btn {
  position: relative;
  background-color: var(--bs-primary);
  color: white;
  border-color: var(--bs-primary);
}

#container-apply-filter-button {
  display:none;
  padding-top:18px;
}

.filter-section-smallinfo
{
  color: #6c757d;
  font-size: 10px;
  line-height: 1.2;
  padding: 0 5px;
}

/* Amenities toggle styling */
.amenities-toggle {
    margin-top: 8px;
    text-align: left;
    margin-left: 9px;
}

.amenities-toggle a {
  color: var(--bs-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.amenities-toggle a:hover {
  color: var(--bs-primary);
  text-decoration: underline !important;
}

.amenities-toggle i {
  transition: transform 0.2s ease;
  margin-right: 4px;
}