.members-filter-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* align-self: stretch; - might not be needed depending on your parent container */
  margin-bottom: 24px;
  /* Add some space below the filters */
}

.members-filter-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 25px;
  display: flex;
  flex-direction: column;
}

.members-filters {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
}

/* --- SEARCH BAR --- */
.members-search {
  position: relative;
  width: 100%;
  flex: 1;
  /* Allow search to take available space */
}

.members-search .members-input {
  padding-left: 36px !important;
  /* Space for the icon */
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 14px;
  pointer-events: none;
}

/* --- SHARED STYLE FOR INPUT & SELECT --- */
.members-input,
.members-select-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  color: #000;
  background-color: #fff;
  font-family: inherit;
  transition: border-color 0.2s ease;
  appearance: none;
  height: 42px;
  /* fixed height for alignment */
}

.members-input:focus,
.members-select-input:focus {
  border-color: #3369d5;
  outline: none;
}

.members-select-wrapper {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex: 1;
  /* Allow selects to take available space */
}

/* Optional: Custom dropdown arrow */
.members-select-input {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5.5 7l4.5 4.5L14.5 7z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px auto;
  padding-right: 32px;
  /* moved from padding shorthand to ensure space for arrow */
}

/* Disable Chosen.js for these selects */
.no-chosen {
  display: block !important;
  visibility: visible !important;
}

/* Member Count */
.member-count {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 -15px 15px;
  text-align: left;
}

/* Member Card Grid */
.member-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.member-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.member-card-top {
  margin-top: 25px;
  margin-bottom: 25px;
}

.member-card .profile-photo img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 2px solid #eee;
}

.member-card h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.member-card .position,
.member-card .company {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.member-card .position {
  margin-bottom: 2px;
}

.member-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Membership Badges */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 10px;
}

.badge-basic {
  background-color: #e7f8ed;
  color: #2a7f46;
  border: 1px solid #b2e0c2;
}

.badge-business {
  background-color: #f9f1d0;
  color: #c49a00;
  border: 1px solid #f5de85;
}

.badge-enterprise {
  background-color: #eae6fd;
  color: #5a44c1;
  border: 1px solid #c7b8ff;
}

.badge-default {
  background-color: #f0f0f0;
  color: #666;
  border: 1px solid #d8d8d8;
}

/* Members' card detail buttons */
.member-card-bottom {
  border-top: 1px solid #eee;
  padding-top: 0px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.member-card-bottom a {
  color: #555;
  text-decoration: none;
  font-size: 0.9rem;
  flex-grow: 1;
  padding: 12px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.member-card-bottom a:hover {
  color: #007bff;
  background-color: #f8f9fa;
}

/* Blur covered */
.blur-cover {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-text {
  position: relative;
  z-index: 10;
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.overlay-text h3 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #13294b;
}

.overlay-text p {
  font-size: 16px;
  margin-bottom: 20px;
  color: #666;
}

.blurred-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  filter: blur(10px);
  opacity: 0.3;
  pointer-events: none;
}

.blur-item {
  background: #f5f5f5;
  padding: 20px;
  margin: 10px;
  border-radius: 8px;
}

/* Pagination */
.pagination {
  margin-top: 30px;
  text-align: center;
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Responsive Design */
@media (max-width: 768px) {
  .members-filters {
    flex-direction: column;
    gap: 12px;
  }

  .members-select-wrapper {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .member-filters .row {
    flex-direction: column;
  }

  .member-filters .d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }

  .search-container {
    position: relative;
    width: 100%;
    align-self: stretch;
  }

  #membership_id,
  #regionFilter {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }

  .active-filters {
    justify-content: center;
  }

  .member-grid-container {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
  }

  .member-card {
    max-width: 100%;
  }

  .member-card .profile-photo img {
    width: 70px;
    height: 70px;
  }

  .member-card h5 {
    font-size: 1rem;
  }

  .member-card .position,
  .member-card .company {
    font-size: 0.85rem;
  }

  .member-card-bottom a {
    font-size: 0.85rem;
    padding: 10px 5px;
  }
}

@media (max-width: 480px) {
  .members-header {
    padding: 20px 12px;
  }

  .member-card-top {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .member-card .profile-photo img {
    width: 60px;
    height: 60px;
  }

  .badge {
    font-size: 0.8rem;
    padding: 4px 10px;
  }
}

/* ========================================
   PAGINATION STYLES
   ======================================== */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0;
  margin-top: 40px;
  border-top: 1px solid #e5e7eb;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination ul {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.pagination li {
  display: inline-block;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pagination a:hover {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border-color: #007bff;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25);
}

.pagination .active span,
.pagination li.active a {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border-color: #007bff;
  color: #fff;
  font-weight: 700;
  cursor: default;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transform: scale(1.05);
}

.pagination .active span:hover,
.pagination li.active a:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.pagination .disabled span,
.pagination .disabled a {
  color: #d1d5db;
  background: #f9fafb;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.pagination .disabled a:hover {
  transform: none;
  box-shadow: none;
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #d1d5db;
}

.pagination .page-link .fa-angle-right,
.pagination .page-link .fa-angle-double-right,
.pagination .page-link .fa-angle-left,
.pagination .page-link .fa-angle-double-left{
  border:0 !important;
  background:transparent !important;
  box-shadow:none;
}

/* First/Last/Prev/Next buttons */
.pagination .pagination-start a,
.pagination .pagination-prev a,
.pagination .pagination-next a,
.pagination .pagination-end a {
  font-weight: 700;
  background: transparent;
  border: none;
  box-shadow: none;
}

.pagination .pagination-start a:hover,
.pagination .pagination-prev a:hover,
.pagination .pagination-next a:hover,
.pagination .pagination-end a:hover {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  color: #fff;
}

/* Loading overlay for pagination */
/*.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 8px;
}*/

.spinner-border {
  width: 3rem;
  height: 3rem;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.text-primary {
  color: #007bff !important;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination-wrapper {
    padding: 20px 0;
    margin-top: 30px;
  }

  .pagination a,
  .pagination span {
    min-width: 38px;
    height: 38px;
    padding: 8px 10px;
    font-size: 14px;
    border-width: 1.5px;
  }

  .pagination {
    gap: 5px;
  }

  .pagination ul {
    gap: 5px;
  }

  .pagination .pagination-start a,
  .pagination .pagination-prev a,
  .pagination .pagination-next a,
  .pagination .pagination-end a {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination ul {
    gap: 4px;
  }
}

/*Membership Plan*/
input#historySearchInput {
    padding-left: 40px !important;
}