/* Program Search - Custom Filter Styles */

/* Utility: visually hidden but accessible to screen readers. */
.programm-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.programm-custom-search {
  margin: 20px 0 60px 0;
  font-family: inherit;
}

/* Search input container */
.programm-custom-search__search-form {
  margin-bottom: 25px;
}

.programm-custom-search__search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.programm-custom-search__search-input {
  width: 100%;
  height: 56px;
  padding: 10px 45px 10px 20px;
  border: 2px solid #12152a;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.programm-custom-search__search-input:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
}

.programm-custom-search__search-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #12152a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.programm-custom-search__search-submit:hover {
  background: #2a3160;
}

/* Filter Sections & Groups */
.programm-custom-search__filters {
  position: relative;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

/* Loading overlay for AJAX state centered on filters */
.programm-custom-search {
  position: relative;
}

.programm-custom-search.is-loading .programm-custom-search__filters::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  z-index: 10;
}

.programm-custom-search.is-loading .programm-custom-search__filters::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 3px solid #12152a;
  border-top-color: transparent;
  border-radius: 50%;
  animation: pgmspin 0.8s linear infinite;
  z-index: 11;
}

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

.programm-custom-search.is-loading .programm-chip,
.programm-custom-search.is-loading .programm-custom-select {
  pointer-events: none;
  opacity: 0.6;
}

.programm-custom-search.is-loading .programm-results-list,
.programm-custom-search.is-loading .programm-results-header,
.programm-custom-search.is-loading .programm-pager {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.programm-custom-search__group {
  margin-bottom: 20px;
}

.programm-custom-search__group:last-child {
  margin-bottom: 0;
}

.programm-custom-search__group-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #12152a;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.programm-custom-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Select Dropdown */
.programm-custom-search__select-wrapper {
  position: relative;
  max-width: 450px;
}

.programm-custom-search__select-wrapper--with-search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.programm-custom-search__inline-input {
  width: 100%;
  height: 40px;
  padding: 8px 14px;
  border: 1px solid #ced4da;
  border-radius: 20px;
  background-color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.programm-custom-search__inline-input:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
}

.programm-custom-select {
  width: 100%;
  padding: 8px 36px 8px 16px;
  border: 1px solid #ced4da;
  border-radius: 22px;
  background-color: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #212529;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2312152a' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.programm-custom-select:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
}

.programm-custom-select option {
  color: #212529;
  padding: 6px;
}

/* Select2 cohesion (theme-aligned) */
.programm-custom-search .select2-container {
  width: 100% !important;
}

.programm-custom-search .select2-container .select2-selection--single {
  height: 44px;
  border: 1px solid #ced4da;
  border-radius: 22px;
  background-color: #fff;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.programm-custom-search .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #212529;
  line-height: 42px;
  padding-left: 16px;
  font-size: 14px;
}

.programm-custom-search .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 12px;
}

.programm-custom-search .select2-container--open .select2-selection--single,
.programm-custom-search .select2-container--default .select2-selection--single:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
  outline: none;
}

.programm-custom-search .select2-dropdown {
  border-color: #ced4da;
  border-radius: 12px;
  overflow: hidden;
}

.programm-custom-search .select2-results__option {
  padding: 8px 12px;
  font-size: 14px;
}

.programm-custom-search .select2-results__option--highlighted[aria-selected] {
  background-color: #12152a;
}

.programm-custom-search .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #2a3160;
  color: #fff;
}

.programm-custom-search .select2-results__option[aria-disabled=true] {
  color: #adb5bd;
  cursor: not-allowed;
}

/* Filter Chip / Pill */
.programm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #ced4da;
  color: #212529;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  max-width: 100%;
  box-sizing: border-box;
}

.programm-chip i {
  font-weight: 900;
}

.programm-chip:hover {
  border-color: #12152a;
  color: #12152a;
  text-decoration: none;
  background: #f1f3f5;
}

.programm-chip--active {
  background: #12152a !important;
  color: #fff !important;
  border-color: #12152a !important;
}

.programm-chip--active:hover {
  background: #2a3160 !important;
  color: #fff !important;
}

/* Disabled chip (no results available) */
.programm-chip--disabled,
.programm-chip--disabled:hover {
  background: #f1f3f5 !important;
  color: #7c8797 !important;
  border-color: #dee2e6 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

.programm-chip__color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Active Filters Summary Bar */
.programm-active-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
  padding: 12px 16px;
  background: #eef2f7;
  border-radius: 8px;
}

.programm-active-bar__title {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.programm-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #b8c2cc;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 14px;
  color: #12152a;
  text-decoration: none;
  transition: background 0.15s ease;
}

.programm-active-tag:hover {
  background: #ffe3e3;
  border-color: #e03131;
  color: #c92a2a;
  text-decoration: none;
}

.programm-active-tag__remove {
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
}

.programm-reset-all {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: #bf0e1f;
  text-decoration: underline;
  cursor: pointer;
}

.programm-reset-all:hover {
  color: #a71d2a;
}

/* Results Header & Counter */
.programm-results-header {
  margin-bottom: 20px;
}

.programm-results-count {
  font-size: 18px;
  font-weight: 600;
  color: #12152a;
  margin: 0;
}

/* Results List */
.programm-results-list {
  list-style: none;
  padding: 0;
  margin: 0 0 40px 0;
}

.programm-results-list > li {
  margin-bottom: 20px;
}

/* Empty State */
.programm-empty-state {
  padding: 40px 20px;
  text-align: center;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 12px;
  margin: 30px 0;
}

.programm-empty-state__icon {
  font-size: 36px;
  color: #868e96;
  margin-bottom: 12px;
}

.programm-empty-state__text {
  font-size: 16px;
  color: #495057;
  max-width: 500px;
  margin: 0 auto 16px auto;
}

.programm-empty-state__reset {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  background: #12152a;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}

.programm-empty-state__reset:hover {
  background: #2a3160;
  color: #fff;
  text-decoration: none;
}

/* Responsive adjustments for mobile viewports */
@media (max-width: 768px) {
  .programm-custom-search {
    margin: 15px 0 40px 0;
  }

  .programm-custom-search__filters {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
  }

  .programm-custom-search__group {
    margin-bottom: 16px;
  }

  .programm-custom-search__group-title {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .programm-chip {
    padding: 6px 12px;
    font-size: 13px;
  }

  .programm-custom-search__search-input {
    height: 48px;
    font-size: 14px;
    padding: 8px 42px 8px 16px;
  }

  .programm-custom-search__search-submit {
    width: 32px;
    height: 32px;
    right: 8px;
  }

  .programm-custom-select {
    padding: 8px 32px 8px 14px;
    font-size: 13px;
  }

  .programm-active-bar {
    padding: 10px 12px;
    gap: 8px;
  }

  .programm-active-tag {
    font-size: 13px;
    padding: 3px 8px;
  }
}
