/* =========================================================
   Doctory — Search Results Page Styles
   ========================================================= */

/* ---- Search Strip (compact bar at top) ---- */
.search-strip {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  box-shadow: 0 2px 12px rgba(27, 58, 107, 0.06);
}

.search-bar--compact {
  box-shadow: none;
  padding: 0;
  background: transparent;
  border-radius: 0;
  margin-top: 0;
  align-items: stretch;
  gap: 0;
  max-width: none;
}

.search-bar--compact .search-bar__field label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.search-bar--compact .search-bar__input {
  height: 42px;
  padding: 0 12px;
  background: var(--paper);
  border-color: var(--line);
}

.search-bar--compact .search-bar__input input {
  font-size: 13px;
}

.search-bar--compact .search-bar__submit {
  height: 42px;
  padding: 0 20px;
  width: auto;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* =========================================================
   Search Page Layout
   ========================================================= */
.search-page {
  padding: 32px 0 64px;
  min-height: calc(100vh - var(--nav-h) - 75px);
}

.search-page__inner {
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 32px;
  align-items: start;
}

/* =========================================================
   Filters Sidebar
   ========================================================= */
.filters-sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 24px;
  position: sticky;
  top: calc(var(--nav-h) + 75px + 16px);
  max-height: calc(100vh - var(--nav-h) - 75px - 32px);
  overflow-y: auto;
}

.filters-sidebar::-webkit-scrollbar { width: 4px; }
.filters-sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.filters-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.filters-sidebar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-sidebar__title svg { color: var(--accent-teal); }

.filters-sidebar__reset {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.filters-sidebar__reset:hover { background: var(--lilac-100); }

/* ---- Filter Groups ---- */
.filter-group {
  margin-bottom: 24px;
}

.filter-group:last-child { margin-bottom: 0; }

.filter-group__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-900);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent-teal);
  color: var(--ink-700);
  background: var(--lilac-100);
}

.filter-chip.is-active {
  background: var(--ink-700);
  border-color: var(--ink-700);
  color: var(--white);
  font-weight: 600;
}

.filter-chip svg { flex-shrink: 0; }
.filter-chip.is-active svg path { fill: var(--white); }

/* =========================================================
   Results Area
   ========================================================= */
.results-area {
  min-width: 0;
}

/* ---- Results Header ---- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.results-header__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink-900);
  margin-bottom: 2px;
}

.results-header__count {
  font-size: 13px;
  color: var(--text-muted);
}

.results-header__count span {
  font-weight: 700;
  color: var(--accent-teal);
}

.results-header__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 36px 8px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}
.sort-select:focus { border-color: var(--accent-teal); }

.sort-select__chevron {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  position: relative;
}

.mobile-filter-btn__badge {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-teal);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---- Active Tags ---- */
.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  min-height: 0;
}

.active-tags:empty { margin-bottom: 0; }

.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  background: var(--lilac-100);
  border: 1px solid var(--lilac-300);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
}

.active-tag__remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lilac-300);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease;
  flex-shrink: 0;
}
.active-tag__remove:hover { background: var(--ink-700); color: var(--white); }
.active-tag__remove svg { color: var(--ink-700); }
.active-tag__remove:hover svg { color: var(--white); }

/* =========================================================
   Doctor Cards Grid
   ========================================================= */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ---- Doctor Card ---- */
.doctor-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.doctor-card:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-3px);
  border-color: rgba(14, 165, 164, 0.25);
}

.doctor-card__top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

/* Avatar */
.doctor-card__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.doctor-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--lilac-100);
  flex-shrink: 0;
}

.doctor-card__avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--lilac-100), var(--lilac-300));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink-700);
  flex-shrink: 0;
}

.doctor-card__badge {
  position: absolute;
  bottom: -4px;
  left: -4px;
  background: var(--accent-teal);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  font-family: var(--font-display);
}

.doctor-card__badge--verified {
  background: #10B981;
}

.doctor-card__badge--premium {
  background: #F59E0B;
}

/* Info */
.doctor-card__info {
  flex: 1;
  min-width: 0;
}

.doctor-card__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--ink-900);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doctor-card__specialty {
  font-size: 13px;
  color: var(--accent-teal);
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.doctor-card__degree {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Rating */
.doctor-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.doctor-card__stars {
  display: flex;
  gap: 1px;
}

.star {
  width: 14px;
  height: 14px;
  color: #F59E0B;
}

.star--empty { color: #E2E8F0; }

.doctor-card__rating-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-900);
}

.doctor-card__reviews {
  font-size: 12px;
  color: var(--text-muted);
}

/* Meta pills */
.doctor-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.doctor-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-700);
  white-space: nowrap;
}

.doctor-card__pill svg { flex-shrink: 0; color: var(--text-muted); }

.doctor-card__pill--location { color: var(--text-muted); }

.doctor-card__pill--exp {
  background: var(--lilac-100);
  border-color: var(--lilac-300);
  color: var(--ink-700);
}

.doctor-card__pill--online {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.doctor-card__pill--today {
  background: #FFF7ED;
  border-color: #FED7AA;
  color: #92400E;
}

/* Divider */
.doctor-card__divider {
  height: 1px;
  background: var(--line);
  margin: 0 -24px 16px;
}

/* Footer */
.doctor-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doctor-card__price-wrap {
  display: flex;
  flex-direction: column;
}

.doctor-card__price-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.doctor-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink-900);
}

.doctor-card__price span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.doctor-card__actions {
  display: flex;
  gap: 8px;
}

.btn--book {
  background: var(--ink-700);
  color: var(--white);
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn--book:hover { background: var(--accent-teal); transform: translateY(-1px); }

.btn--profile {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn--profile:hover { border-color: var(--accent-teal); color: var(--accent-teal); background: var(--lilac-100); }

/* Featured card highlight */
.doctor-card--featured {
  border-color: var(--accent-teal);
  background: linear-gradient(135deg, #F0FAFA 0%, var(--white) 60%);
}

.doctor-card__featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent-teal);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* =========================================================
   Empty State
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 80px 32px;
}

.empty-state__icon {
  font-size: 56px;
  margin-bottom: 20px;
  display: block;
}

.empty-state__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink-900);
  margin-bottom: 10px;
}

.empty-state__text {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.7;
}

/* =========================================================
   Pagination
   ========================================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-700);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.12s ease;
}

.page-btn:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  background: var(--lilac-100);
}

.page-btn.is-active {
  background: var(--ink-700);
  border-color: var(--ink-700);
  color: var(--white);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn:disabled:hover {
  border-color: var(--line);
  color: var(--ink-700);
  background: var(--white);
}

.page-btn--nav {
  gap: 4px;
  width: auto;
  padding: 0 14px;
  font-size: 13px;
}

.page-ellipsis {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-weight: 700;
}

/* =========================================================
   Skeleton Loading
   ========================================================= */
.skeleton {
  background: linear-gradient(90deg, var(--lilac-100) 25%, #E8E4F5 50%, var(--lilac-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.doctor-card--skeleton {
  pointer-events: none;
}

.skeleton-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  flex-shrink: 0;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* =========================================================
   Mobile Filters Overlay
   ========================================================= */
.filters-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 76, 0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.filters-overlay.is-open { display: block; }

/* Screenreader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .search-page__inner {
    grid-template-columns: 240px 1fr;
    gap: 24px;
  }
}

@media (max-width: 860px) {
  .search-page__inner {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 300px;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    z-index: 200;
    transition: right 0.25s ease;
    padding-top: 32px;
  }

  .filters-sidebar.is-open {
    right: 0;
    box-shadow: var(--shadow-pop);
  }

  .mobile-filter-btn { display: inline-flex; }

  .doctors-grid {
    grid-template-columns: 1fr;
  }

  .search-bar--compact {
    flex-wrap: wrap;
  }

  .search-bar--compact .search-bar__field {
    flex: 1 1 45%;
  }

  .search-bar--compact .search-bar__submit {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }
}


/* Search bar separator (matches homepage) */
.search-bar__sep {
  width: 1px;
  background: rgba(16,42,76,0.08);
  margin: 10px 0;
  flex-shrink: 0;
}

/* Ensure dropdowns appear above sticky strip */
.search-strip {
  overflow: visible;
}
.search-strip .search-bar {
  overflow: visible;
}
.search-strip .search-dropdown {
  z-index: 9999;
}

@media (max-width: 640px) {
  .search-bar--compact {
    flex-direction: column;
  }

  .search-bar--compact .search-bar__field {
    border-inline-end: none;
    border-bottom: 1px solid var(--line);
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-header__controls {
    width: 100%;
    justify-content: space-between;
  }

  .doctors-grid {
    grid-template-columns: 1fr;
  }

  .doctor-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .doctor-card__actions {
    width: 100%;
  }

  .btn--book {
    flex: 1;
    justify-content: center;
  }
}
