/* ASN Members Directory — v2 Clean Build */

/* ===== GRID ===== */
#members-list.asn-members-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
#members-list.asn-members-grid > li {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  width: 100% !important;
}

/* ===== CARD ===== */
.asn-member-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  transition: all 0.25s;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.asn-member-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

/* ===== PHOTO ===== */
.asn-card-photo-wrap {
  display: block;
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
}
.asn-card-photo-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  max-width: none !important;
  transition: transform 0.3s;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.asn-member-card:hover .asn-card-photo-wrap img {
  transform: scale(1.03);
}
.asn-card-online-dot {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  z-index: 2;
  animation: asn-pulse 2s ease-in-out infinite;
}
@keyframes asn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4), 0 1px 4px rgba(0,0,0,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0), 0 1px 4px rgba(0,0,0,0.15); }
}

/* ===== NAME BAR ===== */
.asn-card-name-bar {
  background: linear-gradient(135deg, #1176C1 0%, #122B46 100%);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.asn-card-name-bar .asn-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.asn-card-name-bar .asn-card-name:hover {
  color: #5bb8f5;
}
.asn-card-name-bar .asn-card-age {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}

/* ===== BODY ===== */
.asn-card-body {
  padding: 12px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}
/* Verified badge — bottom right of photo */
.asn-card-verified-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: #1176C1;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
  white-space: nowrap;
  line-height: 1.3;
}
.asn-card-verified-badge svg {
  width: 11px;
  height: 11px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
}
/* Override any BB member-type styles inside our badge */
.asn-card-verified-badge *,
#members-list .asn-card-verified-badge * {
  color: #fff !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  display: inline !important;
}
.asn-card-location {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.asn-card-location svg {
  width: 13px;
  height: 13px;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}
.asn-card-bio {
  font-size: 13px;
  color: #64748b;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  margin-bottom: 10px;
}
.asn-card-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: auto;
  padding-top: 4px;
}
.asn-card-meta span + span::before {
  content: ' · ';
}

/* ===== ACTION BUTTONS ===== */
.asn-card-actions {
  border-top: 1px solid #f1f5f9 !important;
  display: flex !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #fff !important;
}
.asn-action-slot {
  flex: 1 !important;
  display: flex !important;
  align-items: stretch !important;
  min-width: 0 !important;
}
.asn-action-slot + .asn-action-slot {
  border-left: 1px solid #f1f5f9 !important;
}
/* Style ALL links and buttons inside action slots */
.asn-action-slot a,
.asn-action-slot button,
.asn-action-slot .generic-button a,
.asn-action-slot .generic-button button,
.asn-action-slot .follow-button a,
.asn-action-slot .follow-button button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 12px 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  text-decoration: none !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  cursor: pointer !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  white-space: nowrap !important;
  transition: all 0.15s !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-height: auto !important;
  height: auto !important;
  gap: 6px !important;
}
.asn-action-slot a:hover,
.asn-action-slot button:hover,
.asn-action-slot .generic-button a:hover,
.asn-action-slot .generic-button button:hover,
.asn-action-slot .follow-button a:hover,
.asn-action-slot .follow-button button:hover {
  background: #f8fafc !important;
  color: #1176C1 !important;
}
/* Follow slot gets primary color */
.asn-action-slot:first-child a,
.asn-action-slot:first-child button {
  color: #1176C1 !important;
  font-weight: 600 !important;
}
.asn-action-slot:first-child a:hover,
.asn-action-slot:first-child button:hover {
  background: #f0f7ff !important;
}
/* Hide BB button wrapper elements but keep the actual link/button */
.asn-action-slot .generic-button,
.asn-action-slot .follow-button,
.asn-action-slot > div {
  display: flex !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Hide BB icons inside buttons — we want text only */
.asn-action-slot .bb-icon,
.asn-action-slot i {
  display: none !important;
}
/* Contain button text — prevent overflow on state changes */
.asn-card-actions .asn-action-slot,
.asn-card-actions .asn-action-slot .generic-button,
.asn-card-actions .asn-action-slot .follow-button,
.asn-card-actions .asn-action-slot > div {
  overflow: hidden !important;
  min-width: 0 !important;
}
.asn-card-actions .asn-action-slot a,
.asn-card-actions .asn-action-slot button,
.asn-card-actions .generic-button a,
.asn-card-actions .generic-button button,
.asn-card-actions .follow-button a,
.asn-card-actions .follow-button button {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
/* Override BB hover text swap — show "Cancel" instead of "Cancel Request" */
.asn-card-actions a,
.asn-card-actions button,
.asn-card-actions a:hover,
.asn-card-actions button:hover {
  font-size: 13px !important;
}
.asn-card-actions a::before,
.asn-card-actions a::after,
.asn-card-actions button::before,
.asn-card-actions button::after {
  display: none !important;
  content: none !important;
}
/* BB sets font-size:0 on hover to hide text, then uses ::after with data-title. Override both. */
.asn-card-actions .pending_friend:hover,
.asn-card-actions a.pending_friend:hover,
.asn-card-actions button.pending_friend:hover,
.asn-card-actions [data-title]:hover {
  font-size: 13px !important;
}
.asn-card-actions .pending_friend:hover::after,
.asn-card-actions a.pending_friend:hover::after,
.asn-card-actions button.pending_friend:hover::after,
.asn-card-actions [data-title]:hover::after {
  display: none !important;
  content: none !important;
}

/* ===== THREE-DOT MENU (BB native dropdown) ===== */
.asn-member-card .asn-card-menu-wrap {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 5 !important;
}
.asn-member-card .asn-card-menu-wrap .bb_more_options_action {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,0.3) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  color: #fff !important;
}
.asn-member-card .asn-card-menu-wrap .bb_more_options_action:hover {
  background: rgba(0,0,0,0.5) !important;
}
.asn-member-card .asn-card-menu-wrap .bb_more_options_action i {
  color: #fff !important;
  font-size: 16px !important;
  display: block !important;
}
.asn-member-card .asn-card-menu-wrap .bb_more_dropdown {
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
  min-width: 160px !important;
}

/* ===== HIDE DEFAULT BB ELEMENTS ===== */
#members-list.asn-members-grid .list-wrap-inner,
#members-list.asn-members-grid .list-wrap > .item-avatar,
#members-list.asn-members-grid .list-wrap > .item,
#members-list.asn-members-grid .list-wrap > .item-block,
#members-list.asn-members-grid .list-wrap > .member-buttons-wrap,
#members-list.asn-members-grid .list-wrap > .follow-container,
#members-list.asn-members-grid .list-wrap > .bp-members-list-hook,
#members-list.asn-members-grid .list-wrap > .bb_more_options {
  display: none !important;
}

/* ===== SEARCH SIDEBAR ===== */
.bps-form {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.bps-form .bps-label {
  display: block !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #122B46 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 6px !important;
}
.bps-form .bps-label strong { font-weight: 600 !important; }
.bps-form .bps-label span { display: none !important; }
.bps-form input[type="search"],
.bps-form input[type="text"],
.bps-form input[type="number"],
.bps-form input[type="date"],
.bps-form select {
  width: 100% !important;
  padding: 10px 14px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  color: #122B46 !important;
  background: #f8fafc !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.bps-form input:focus,
.bps-form select:focus {
  border-color: #1176C1 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(17,118,193,0.1) !important;
}
.bps-form select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
}
.bps-form .bps-integer-range input[type="number"],
.bps-form .bps-range input[type="text"] {
  width: 80px !important;
  text-align: center !important;
  display: inline-block !important;
}
.bps-form .bps-integer-range span,
.bps-form .bps-range span {
  color: #94a3b8 !important;
  padding: 0 4px !important;
}
.bps-form button[type="submit"] {
  width: 100% !important;
  padding: 12px !important;
  background: #1176C1 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  margin-top: 8px !important;
}
.bps-form button[type="submit"]:hover {
  background: #0d5fa3 !important;
}
.bps-form > div,
.bps-form > .bps-selectbox,
.bps-form > .bps-textbox,
.bps-form > .bps-integer-range,
.bps-form > .bps-range,
.bps-form > .bps-distance {
  margin-bottom: 16px !important;
}
.bps-form br { display: none !important; }
.bps-form .ui-accordion-header { background: none !important; border: none !important; padding: 0 !important; }
#buddypress .bps-form,
.widget_bps_widget .bps-form { padding: 0 !important; }
.bps-form-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #122B46 !important;
  display: block !important;
  margin-bottom: 20px !important;
}
.bps-form .bps-distance input[type="number"] { width: 70px !important; display: inline-block !important; }
.bps-form .bps-distance select { width: auto !important; display: inline-block !important; padding-right: 32px !important; }
.bps-form .bps-distance input[type="search"] { width: 100% !important; margin-top: 8px !important; }

/* ===== PAGINATION ===== */
#buddypress .bp-pagination,
.buddypress-wrap .bp-pagination {
  text-align: center !important;
  margin-top: 32px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  #members-list.asn-members-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 600px) {
  #members-list.asn-members-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .asn-card-photo-wrap { height: 220px; }
  .asn-action-btn span { display: none; }
  .asn-action-btn { padding: 12px !important; }
}
