/* Auto Filter Widget Styles */

.auto-filter-widget {
  --primary-color: #1e3a8a;
  --button-color: #1e3a8a;
  --border-color: #1e3a8a;
  --hover-bg: #f0f4ff;
  --text-color: #1e3a8a;
  --field-padding: 24px;
}

.auto-filter-counter {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 16px;
  text-align: left;
  padding-bottom: 20px;
}

.auto-filter-container {
  background: transparent;
  padding: 0;
  border-radius: 0;
}
  
.auto-filter-field {
  margin-bottom: var(--field-padding, 24px);
}

.auto-filter-field h3 {
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 12px;
  font-size: 14px;
}

/* Dropdown Styles */
.auto-filter-dropdown-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-color);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
  position: relative;
}

.auto-filter-dropdown-btn::after {
  content: '';
  width: 17px;
  height: 17px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 17 17' fill='none'%3e%3cg clip-path='url(%23clip0_2084_13002)'%3e%3cpath d='M2.36371 5.63843L9.00217 12.2769L15.6406 5.63843' stroke='%23102C7D' stroke-width='2' stroke-linecap='square'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_2084_13002'%3e%3crect width='17' height='17' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.auto-filter-dropdown.open .auto-filter-dropdown-btn::after {
  transform: rotate(180deg);
}

.auto-filter-dropdown-btn:hover,
.auto-filter-dropdown-btn:focus {
  background-color: var(--hover-bg);
  outline: none;
}

.auto-filter-dropdown-btn:hover::after,
.auto-filter-dropdown-btn:focus::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 17 17' fill='none'%3e%3cg clip-path='url(%23clip0_2084_13002)'%3e%3cpath d='M2.36371 5.63843L9.00217 12.2769L15.6406 5.63843' stroke='%23ffffff' stroke-width='2' stroke-linecap='square'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_2084_13002'%3e%3crect width='17' height='17' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
}

.auto-filter-dropdown-menu {
  border: 2px solid var(--border-color);
  border-top: none;
  background: white;
  position: absolute;
  width: 100%;
  z-index: 1000;
  max-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.3s ease;
}

.auto-filter-dropdown.open .auto-filter-dropdown-menu {
  max-height: 300px;
}

.auto-filter-option {
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.auto-filter-option:last-child {
  border-bottom: none;
}

.auto-filter-option:hover {
  background-color: var(--hover-bg);
}

/* Range Styles */
.auto-filter-range-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auto-filter-range-inputs input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  text-align: center;
  font-weight: 600;
  transition: background-color 0.2s;
}

.auto-filter-range-inputs input:focus {
  background-color: white;
  outline: none;
  border-color: var(--border-color);
}

.auto-filter-range-slider-container {
  position: relative;
  width: 100%;
  height: 8px;
}

.auto-filter-range-slider-min,
.auto-filter-range-slider-max {
  position: absolute;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.auto-filter-range-slider-min {
  z-index: 3;
}

.auto-filter-range-slider-max {
  z-index: 4;
}

.auto-filter-range-slider-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #bfdbfe;
  border-radius: 4px;
  z-index: 1;
}

.auto-filter-range-slider-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: var(--range-left, 0%);
  width: var(--range-width, 100%);
  bottom: 0;
  background: #0779CA;
  border-radius: 4px;
  z-index: 2;
}

.auto-filter-range-slider-min::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 23px;
  height: 23px;
  background: white;
  border: 2px solid #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
}

.auto-filter-range-slider-max::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 23px;
  height: 23px;
  background: #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
}

.auto-filter-range-slider-min::-moz-range-thumb {
  width: 23px;
  height: 23px;
  background: white;
  border: 2px solid #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
  border: none;
}

.auto-filter-range-slider-max::-moz-range-thumb {
  width: 23px;
  height: 23px;
  background: #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
  border: none;
}



.auto-filter-input-field {
  width: 100%;
  padding: 12px 16px !important;
  border: 2px solid #1e3a8a !important;
  text-align: center;
  font-weight: 600;
  margin-bottom: 16px;
  transition: background-color 0.2s !important;
}

.auto-filter-input-field:focus {
  background-color: white;
  outline: none;
  border-color: #1e3a8a !important;
}

.auto-filter-input-slider-container {
  position: relative;
  width: 100%;
  height: 8px;
}

.auto-filter-input-slider-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #bfdbfe;
  border-radius: 4px;
  z-index: 1;
}

.auto-filter-input-slider-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--input-slider-width, 20%);
  bottom: 0;
  background: #0779CA;
  border-radius: 4px;
  z-index: 2;
}

.auto-filter-input-slider {
  position: absolute;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 3;
}

.auto-filter-input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0779CA;
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 4;
}

.auto-filter-input-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0779CA;
  cursor: pointer;
  border: none;
}



/* Checkbox Styles */
.auto-filter-checkbox-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-color);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}

.auto-filter-checkbox-btn:hover,
.auto-filter-checkbox-btn:focus {
  background-color: var(--hover-bg);
  outline: none;
}

.auto-filter-checkbox-menu {
  border: 2px solid var(--border-color);
  border-top: none;
  background: white;
  position: absolute;
  width: 100%;
  z-index: 1000;
}

.auto-filter-checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auto-filter-checkbox-label:last-child {
  border-bottom: none;
}

.auto-filter-checkbox-label:hover {
  background-color: var(--hover-bg);
}

.auto-filter-checkbox-input {
  margin-right: 12px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.auto-filter-checkbox-label span {
  color: var(--text-color);
}

/* Toggle Switch Styles */
.auto-filter-toggle {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 8px;
  margin-right: 16px;
  margin-bottom: 8px;
  width: auto;
}

.auto-filter-toggle h3 {
  font-family: Geomanist;
  font-size: 24px;
  font-style: normal;
  font-weight: 500;
  line-height: 120%;
  color: #1E1E1E;
  margin: 0;
}

/* Mobile styles for toggles */
@media (max-width: 768px) {
  .auto-filter-toggle {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    margin-right: 0;
    margin-bottom: 16px;
    width: 100%;
  }

  .auto-filter-toggle h3 {
    font-family: Geomanist;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
  }
}

.auto-filter-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.auto-filter-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-filter-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.auto-filter-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .auto-filter-toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .auto-filter-toggle-slider:before {
  transform: translateX(22px);
}

/* Reset Button */
.auto-filter-reset-btn {
  width: auto;
  padding: 12px 24px;
  margin-top: var(--field-padding, 24px);
  background: var(--button-color);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auto-filter-reset-btn:hover,
.auto-filter-reset-btn:focus {
  background: var(--button-color);
  outline: none;
}

/* Button Styles */
.auto-filter-button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.auto-filter-button-item {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  border-radius: 24px;
  transition: all 0.2s;
  font-size: 14px;
}

.auto-filter-button-item:hover {
  background-color: var(--hover-bg);
}

.auto-filter-button-item.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .auto-filter-container {
    max-width: 100%;
  }

  .auto-filter-button-container {
    gap: 6px;
  }

  .auto-filter-button-item {
    padding: 6px 12px;
    font-size: 12px;
  }
}
