/* Closely mirrors /doctors cards in nobatbeski frontend (brand #1e4b84, Vazirmatn, RTL). */

.hdb-wrap {
  --hdb-brand-25: #f4f7fb;
  --hdb-brand-50: #e9eff6;
  --hdb-brand-100: #d3dfec;
  --hdb-brand-400: #4f7fb4;
  --hdb-brand-500: #1e4b84;
  --hdb-brand-600: #163865;
  --hdb-border: #e5e7eb;
  --hdb-text: #111827;
  --hdb-muted: #6b7280;
  --hdb-gray-400: #9ca3af;
  --hdb-bg: #ffffff;
  --hdb-radius: 24px;
  --hdb-cols-desktop: 3;
  --hdb-cols-tablet: 2;
  --hdb-cols-mobile: 1;
  --hdb-btn-font-size: 14px;
  --hdb-btn-min-height: 44px;
  --hdb-filter-font-size: 15px;
  --hdb-filter-min-height: 48px;
  box-sizing: border-box;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: var(--hdb-text);
  line-height: 1.6;
  direction: rtl;
}

.hdb-wrap *,
.hdb-wrap *::before,
.hdb-wrap *::after {
  box-sizing: border-box;
}

.hdb-wrap--message,
.hdb-message,
.hdb-empty {
  margin: 0;
  color: var(--hdb-muted);
  text-align: center;
}

.hdb-empty-box {
  border: 1px dashed var(--hdb-border);
  border-radius: 20px;
  background: var(--hdb-bg);
  padding: 2.5rem 1rem;
  text-align: center;
}

.hdb-fallback-link {
  color: var(--hdb-brand-500);
  font-weight: 700;
  text-decoration: underline;
}

/* Filters — match /doctors toolbar: flex icon+input, no absolute overlay */
.hdb-filters {
  position: relative;
  margin-bottom: 1.25rem;
  border: 1px solid var(--hdb-border);
  border-radius: 20px;
  background: var(--hdb-bg);
  padding: 0.85rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.hdb-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hdb-filters__search-wrap {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--hdb-filter-min-height, 48px);
  border: 1px solid var(--hdb-border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  background: #f9fafb;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hdb-filters__search-wrap:focus-within {
  border-color: var(--hdb-brand-500);
  background: #fff;
}

.hdb-filters__icon {
  flex-shrink: 0;
  color: var(--hdb-gray-400);
  pointer-events: none;
}

.hdb-filters__search {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  border-radius: 0;
  padding: 0 !important;
  background: transparent !important;
  color: var(--hdb-text);
  font: inherit;
  font-size: var(--hdb-filter-font-size, 15px);
  font-weight: 500;
  outline: none;
  box-shadow: none !important;
}

.hdb-filters__search::placeholder {
  color: var(--hdb-gray-400);
  opacity: 1;
}

.hdb-filters__select {
  flex: 0 1 240px;
  width: 100%;
  min-height: var(--hdb-filter-min-height, 48px);
  border: 1px solid var(--hdb-border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  background: #f9fafb;
  color: var(--hdb-text);
  font: inherit;
  font-size: var(--hdb-filter-font-size, 15px);
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hdb-filters__select:focus {
  border-color: var(--hdb-brand-500);
  background: #fff;
}

.hdb-filters__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--hdb-btn-min-height, 44px);
  border: 0;
  border-radius: 14px;
  padding: 0.7rem 1.15rem;
  background: linear-gradient(135deg, var(--hdb-brand-500), var(--hdb-brand-400));
  color: #fff !important;
  font: inherit;
  font-weight: 800;
  font-size: var(--hdb-btn-font-size, 14px);
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 75, 132, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hdb-filters__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(30, 75, 132, 0.4);
}

/* Hidden submit — Enter / no-JS fallback without showing "اعمال فیلتر" */
.hdb-filters__submit--sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  box-shadow: none !important;
}

.hdb-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--hdb-btn-min-height, 44px);
  border: 0;
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  background: linear-gradient(135deg, var(--hdb-brand-500), var(--hdb-brand-400));
  color: #fff !important;
  font: inherit;
  font-weight: 800;
  font-size: var(--hdb-btn-font-size, 14px);
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 75, 132, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hdb-card__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(30, 75, 132, 0.4);
}

.hdb-grid {
  display: grid;
  grid-template-columns: repeat(var(--hdb-cols-mobile, 1), minmax(0, 1fr));
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .hdb-grid {
    grid-template-columns: repeat(var(--hdb-cols-tablet, 2), minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hdb-grid {
    grid-template-columns: repeat(var(--hdb-cols-desktop, 3), minmax(0, 1fr));
  }
}

/* Doctor card — layout inspired by DoctorBrowseCard */
.hdb-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--hdb-border);
  border-radius: var(--hdb-radius);
  background: var(--hdb-bg);
  padding: 1.1rem 1.1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  .hdb-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12);
  }
}

.hdb-card__glow {
  position: absolute;
  top: -30px;
  left: 50%;
  z-index: 0;
  display: none;
  width: 220px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(30, 75, 132, 0.12), transparent 75%);
  filter: blur(6px);
  transform: translateX(-50%);
  pointer-events: none;
}

@media (min-width: 640px) {
  .hdb-card {
    padding: 1.35rem 1.35rem 1.5rem;
  }

  .hdb-card__glow {
    display: block;
  }
}

.hdb-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
}

.hdb-card__verified {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border-radius: 999px;
  background: var(--hdb-brand-50);
  padding: 0.3rem 0.65rem;
  color: var(--hdb-brand-600);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.hdb-card__avatar-wrap {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  margin: 0.65rem auto 0.85rem;
}

@media (min-width: 640px) {
  .hdb-card__avatar-wrap {
    width: 96px;
    height: 96px;
  }
}

.hdb-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hdb-brand-500), var(--hdb-brand-400));
  outline: 2px solid var(--hdb-brand-50);
  box-shadow: 0 10px 24px rgba(30, 75, 132, 0.22);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}

.hdb-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hdb-card__check {
  position: absolute;
  right: 0;
  bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--hdb-brand-500);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.hdb-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  text-align: center;
}

.hdb-card__name {
  margin: 0;
  color: var(--hdb-text);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.hdb-card__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.hdb-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--hdb-brand-50);
  padding: 0.2rem 0.65rem;
  color: var(--hdb-brand-600);
  font-size: 0.72rem;
  font-weight: 700;
}

.hdb-card__meta {
  margin: 0;
  color: var(--hdb-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.hdb-card__council {
  margin: 0;
  color: var(--hdb-gray-400);
  font-size: 0.72rem;
}

.hdb-card__stats {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0.35rem 0 0.15rem;
  border-top: 1px solid var(--hdb-border);
  border-bottom: 1px solid var(--hdb-border);
  padding: 0.85rem 0.25rem;
}

.hdb-stat {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.hdb-stat strong {
  color: var(--hdb-text);
  font-size: 0.9rem;
  font-weight: 800;
}

.hdb-stat span {
  color: var(--hdb-gray-400);
  font-size: 0.65rem;
  font-weight: 700;
}

.hdb-card__btn {
  width: 100%;
  margin-top: auto;
}

.hdb-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 0.25rem;
}

.hdb-pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hdb-pagination__btn,
.hdb-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--hdb-border);
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
  background: #fff;
  color: var(--hdb-text) !important;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hdb-pagination__btn:hover,
.hdb-pagination__page:hover {
  border-color: var(--hdb-brand-500);
  background: var(--hdb-brand-50);
  color: var(--hdb-brand-600) !important;
}

.hdb-pagination__page--current {
  border-color: var(--hdb-brand-500);
  background: linear-gradient(135deg, var(--hdb-brand-500), var(--hdb-brand-400));
  color: #fff !important;
}

.hdb-pagination__btn--disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.hdb-pagination__ellipsis {
  color: var(--hdb-gray-400);
  font-weight: 700;
  padding: 0 0.15rem;
}

.hdb-pagination__meta {
  flex-basis: 100%;
  margin: 0.15rem 0 0;
  color: var(--hdb-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

