/* ============================================================
   OpenTripFilters.module.css — Filter Bar & Sort Controls
   Clean Floating Card with Modern Form Controls
   ============================================================ */

.filterSection {
  margin-top: -28px; /* overlapping slightly with the hero bottom for a cohesive card look */
  margin-bottom: 28px;
  position: relative;
  z-index: 10;
}

/* ── 1. Main Filter Card ───────────────────────────────────── */

.filterCard {
  background-color: #FFFFFF;
  border: 1px solid #E5E9E6;
  border-radius: 18px;
  padding: 16px 24px;
  box-shadow: 0 6px 24px rgba(20, 35, 25, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.filterControls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.filterGroup {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 140px;
}

.groupIcon {
  color: var(--ppt-primary, #269436);
  flex-shrink: 0;
}

.selectInput,
.dateInput {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 14.5px;
  font-weight: 600;
  color: #17232F;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 24px 6px 0;
  font-family: inherit;
}

.dateInput {
  color: #17232F;
}

.dateInput::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.chevronIcon {
  position: absolute;
  right: 4px;
  color: #9CA3AF;
  pointer-events: none;
}

.groupDivider {
  width: 1px;
  height: 32px;
  background-color: #E8EDE9;
  flex-shrink: 0;
}

/* Reset Filter Button */
.resetWrap {
  flex-shrink: 0;
}

.resetBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--ppt-primary, #269436);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 180ms ease;
  white-space: nowrap;
}

.resetBtn:hover {
  background-color: #EEF8EF;
  color: #1F7F2E;
}

.resetIcon {
  transition: transform 300ms ease;
}

.resetBtn:hover .resetIcon {
  transform: rotate(-90deg);
}

.resetBtnActive {
  color: var(--ppt-primary, #269436);
}

/* ── 2. Result Header & Sorting ────────────────────────────── */

.resultHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  margin-bottom: 22px;
  gap: 16px;
}

.resultCountWrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.resultCount {
  font-size: 22px;
  font-weight: 800;
  color: #17232F;
  letter-spacing: -0.01em;
  margin: 0;
}

.resultCount span {
  color: #17232F;
}

.pendingIndicator {
  font-size: 13.5px;
  color: var(--ppt-primary, #269436);
  font-weight: 600;
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Sorting Dropdown */
.sortWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #FFFFFF;
  border: 1px solid #E5E9E6;
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 0 2px 8px rgba(20, 35, 25, 0.02);
}

.sortIcon {
  color: #667085;
}

.sortLabel {
  font-size: 13.5px;
  font-weight: 600;
  color: #667085;
}

.sortSelect {
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: #17232F;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 18px;
  font-family: inherit;
}

.sortChevron {
  position: absolute;
  right: 12px;
  color: #9CA3AF;
  pointer-events: none;
}

/* ── Responsive Breakpoints ───────────────────────────────── */

/* Tablet (< 1024px) */
@media (max-width: 1023px) {
  .filterSection {
    margin-top: -16px;
  }

  .filterCard {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px;
    gap: 16px;
  }

  .filterControls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .groupDivider {
    display: none;
  }

  .resetWrap {
    border-top: 1px solid #E8EDE9;
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
  }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
  .filterSection {
    margin-top: -12px;
  }

  .filterCard {
    padding: 16px;
    border-radius: 16px;
  }

  .filterControls {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filterGroup {
    border-bottom: 1px solid #F0F4F1;
    padding-bottom: 10px;
  }

  .filterGroup:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .resetWrap {
    justify-content: center;
    width: 100%;
  }

  .resetBtn {
    width: 100%;
    justify-content: center;
  }

  .resultHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 18px;
  }

  .sortWrap {
    width: 100%;
    justify-content: space-between;
  }
}
