/* Advanced Filters Styling */

.filter-panel {
  background: var(--bs-light);
  padding: 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Filter Button Badge */
.btn .badge.rounded-pill {
  position: relative;
  top: -2px;
  font-size: 0.7rem;
  min-width: 1.25rem;
  padding: 0.25rem 0.4rem;
}

/* Date Range Filter */
.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.date-range-inputs .separator {
  color: var(--bs-secondary);
  font-weight: 500;
}

/* Select2 Integration */
.select2-container--bootstrap-5 .select2-selection {
  min-height: calc(1.5em + 0.5rem + 2px);
}

.select2-container--bootstrap-5 .select2-selection--single {
  padding: 0.25rem 0.5rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
  border-color: var(--bs-border-color);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--bs-primary);
  color: white;
}

/* Dark mode support for Select2 */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--bs-primary);
  color: white;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__rendered {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__arrow b {
  border-color: var(--bs-body-color) transparent transparent transparent;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background-color: #3d3d56;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e4e4e7;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
  color: #e4e4e7;
  border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
  background-color: #4a4a66;
  color: #fff;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field {
  color: #e4e4e7;
}

/* Filter Panel Animations */
.collapse {
  transition: height 0.3s ease;
}

.collapsing {
  transition: height 0.3s ease;
}

/* Filter Form Loading State */
.filter-form-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.filter-form-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 3px solid var(--bs-primary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .filter-panel {
    padding: 1rem;
  }
}

/* Dark Mode Support */
[data-bs-theme="dark"] .filter-panel {
  background: var(--bs-dark);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
}
