/*
 * Flexible Search frontend styles.
 *
 * Class prefix: hrtk-fs-
 *
 * Inherits the host theme's typography and color palette where possible.
 * Layout matches the screenshot reference: pill toggle at top, two
 * sections (How long, When), chip strip footer with Clear / Apply.
 */

.hrtk-fs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: #f3f4f6;
  width: max-content;
}

/* When the toggle lives inside the Explorer modal header, give it room
 * below the "When" title so it doesn't crowd the calendar icon. */
.hk-modal-header .hrtk-fs-toggle {
  margin-top: 12px;
  margin-bottom: 4px;
}

/* Header in the date modal uses a single column flow — let the toggle
 * sit on its own row, centered. */
.hfse-form-date-options .hk-modal-header {
  display: block;
}
.hfse-form-date-options .hk-modal-header > .hk-h4 {
  display: block;
  text-align: left;
}
.hfse-form-date-options .hk-modal-header > .hrtk-fs-toggle {
  display: flex;
  margin-left: auto;
  margin-right: auto;
}

.hrtk-fs-toggle-btn {
  padding: 8px 18px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  line-height: 1.2;
}

.hrtk-fs-toggle-btn.is-active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  outline: 1px solid #2c5282;
  outline-offset: -1px;
}

.hrtk-fs-panel {
  padding: 8px 0 16px;
}

/* When the panel lives inside the modal body, mirror the body's own
 * horizontal padding and use full vertical flow. */
.hfse-form-date-options .hrtk-fs-panel {
  padding: 8px 24px 16px;
}

.hrtk-fs-heading {
  font-size: 18px;
  font-weight: 600;
  margin: 16px 0 12px;
  color: inherit;
}

.hrtk-fs-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hrtk-fs-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  min-height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hrtk-fs-chip:hover {
  border-color: #9ca3af;
}

.hrtk-fs-chip.is-active {
  border-color: #2c5282;
  border-width: 2px;
  padding: 7px 17px; /* keep dimensions stable when border grows */
}

.hrtk-fs-month-strip-wrap {
  position: relative;
  margin: 0 -8px;
  padding: 4px 8px;
}

.hrtk-fs-month-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hrtk-fs-month-strip::-webkit-scrollbar {
  display: none;
}

.hrtk-fs-month-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  color: #374151;
  padding: 0;
}

.hrtk-fs-month-arrow:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.hrtk-fs-month-arrow[hidden] {
  display: none;
}

.hrtk-fs-month-arrow-left {
  left: -4px;
}

.hrtk-fs-month-arrow-right {
  right: -4px;
}

.hrtk-fs-or {
  color: #6b7280;
  font-size: 13px;
}

.hrtk-fs-month-chip {
  flex-direction: column;
  min-width: 84px;
  min-height: 76px;
  border-radius: 12px;
  padding: 10px 12px;
  gap: 2px;
}

.hrtk-fs-chip-icon {
  width: 20px;
  height: 20px;
  color: #6b7280;
  flex-shrink: 0;
}

.hrtk-fs-month-chip-anytime .hrtk-fs-chip-icon {
  color: #4b5563;
}

.hrtk-fs-month-chip.is-active .hrtk-fs-chip-icon {
  color: #2c5282;
}

.hrtk-fs-chip-primary {
  font-weight: 500;
  font-size: 14px;
}

.hrtk-fs-chip-secondary {
  font-size: 12px;
  color: #6b7280;
}

.hrtk-fs-panel-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.hrtk-fs-clear {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  text-decoration: underline;
}

.hrtk-fs-apply {
  background: #2c5282;
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  padding: 10px 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.hrtk-fs-apply:hover {
  background: #2a4d76;
}

/* Alternative-dates section, rendered inside the flex panel below the
 * month strip. Lets users pick a specific matching range without leaving
 * the modal. Headline is intentionally low-contrast — it's a secondary
 * affordance to the primary stay+month selection above. */
.hrtk-fs-alt-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.hrtk-fs-alt-heading {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #6b7280;
}

.hrtk-fs-alt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hrtk-fs-alt-chip {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
}

.hrtk-fs-alt-chip:hover {
  border-color: #9ca3af;
}

.hrtk-fs-alt-chip.is-active {
  border-color: #2c5282;
  border-width: 2px;
  padding: 5px 13px;
}

/* Form-side chip strip — appears below the search bar after a flex search
 * is committed. Lets users swap to a different specific range without
 * reopening the modal. */
/* Selector intentionally scoped under .hfse-form to outscore Explorer's
 * `.hfse-form > div + div { margin-top: 15px; }` rule, which would
 * otherwise win on specificity and crush our top margin. */
.hfse-form .hrtk-fs-form-strip,
.hrtk-fs-form-strip {
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.hrtk-fs-form-strip[hidden] {
  display: none;
}

.hrtk-fs-form-strip-heading {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.hrtk-fs-form-strip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 640px) {
  .hrtk-fs-form-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

.hrtk-fs-form-strip-chip {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  color: inherit;
  white-space: nowrap;
}

.hrtk-fs-form-strip-chip:hover {
  border-color: #9ca3af;
}

.hrtk-fs-form-strip-chip.is-active {
  border-color: #2c5282;
  border-width: 2px;
  padding: 4px 11px;
  background: #f0f5fa;
}

/* Empty-state replacement — shown when Explorer renders zero results
 * while we're in flex mode. Uses the suggested chips inline so the
 * guest can pivot in one click. */
.hrtk-fs-empty {
  padding: 32px 24px;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  margin: 16px 0;
}

.hrtk-fs-empty-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #111827;
}

.hrtk-fs-empty-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 16px;
}

.hrtk-fs-empty-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hrtk-fs-empty-chip {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hrtk-fs-empty-chip:hover {
  border-color: #2c5282;
  background: #f0f5fa;
}

/* Admin settings */
.hrtk-flexible-search-stay-lengths {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 4px;
}

.hrtk-flexible-search-stay-length-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hrtk-flexible-search-months-ahead {
  width: 80px;
}

.hrtk-flexible-search-status {
  margin-left: 12px;
  color: #4b7c2f;
  font-size: 13px;
}
