/* ============================================================
   GMCC Member Directory — members.css
   ============================================================ */

/* ---- Utility ---- */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Body override ---- */
.dir-body {
  background: #f0f2f5;
  min-height: 100vh;
}

/* ---- Header extras ---- */
.dir-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.01em;
}
.dir-header-badge {
  background: var(--color-accent, #c8922a);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}
.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}
.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-full { width: 100%; }

/* ============================================================
   LOGIN GATE
   ============================================================ */
.login-gate {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #1a2e4a 0%, #243d5c 60%, #1a2e4a 100%);
}

.login-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2.5rem 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.login-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.login-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1a2e4a;
  margin: 0 0 0.5rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: #5a6a7a;
  line-height: 1.6;
  margin: 0 0 1.75rem;
}

.login-form {
  text-align: left;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-input {
  padding-right: 3rem;
}

.toggle-pw-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #7a8a9a;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.toggle-pw-btn:hover { color: #1a2e4a; }

.login-error {
  display: block;
  color: #c53030;
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 0.4rem;
  min-height: 1.2em;
}

.login-note {
  font-size: 0.78rem;
  color: #9aa5b1;
  margin-top: 1.25rem;
  text-align: center;
}

/* ============================================================
   DIRECTORY CONTROLS BAR
   ============================================================ */
.dir-controls-bar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 70px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dir-controls-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Search */
.dir-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
}

.dir-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa5b1;
  pointer-events: none;
}

.dir-search-input {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 2.5rem;
  border: 1.5px solid #d1d9e0;
  border-radius: 0.5rem;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  color: #1a2e4a;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.dir-search-input:focus {
  outline: none;
  border-color: #c8922a;
  box-shadow: 0 0 0 3px rgba(200,146,42,0.15);
  background: #fff;
}

.dir-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9aa5b1;
  font-size: 0.85rem;
  padding: 0.2rem;
  line-height: 1;
}
.dir-clear-btn:hover { color: #c53030; }

/* Filters */
.dir-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dir-select {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid #d1d9e0;
  border-radius: 0.5rem;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  color: #1a2e4a;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s;
}
.dir-select:focus {
  outline: none;
  border-color: #c8922a;
  box-shadow: 0 0 0 3px rgba(200,146,42,0.15);
}

/* Stats row */
.dir-stats-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.dir-count {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a6a7a;
  white-space: nowrap;
}

/* View toggle */
.dir-view-toggle {
  display: flex;
  border: 1.5px solid #d1d9e0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.view-btn {
  background: #f8fafc;
  border: none;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  color: #7a8a9a;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}
.view-btn:hover { background: #e8edf2; color: #1a2e4a; }
.view-btn.active {
  background: #1a2e4a;
  color: #fff;
}

/* ============================================================
   DIRECTORY CONTENT
   ============================================================ */
.dir-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
}

/* ---- Grid View ---- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.member-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

/* ---- Member Card ---- */
.member-card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  padding: 1.4rem 1.5rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  position: relative;
  role: listitem;
}
.member-card:hover {
  box-shadow: 0 8px 24px rgba(26,46,74,0.12);
  border-color: #c8922a;
  transform: translateY(-2px);
}
.member-card:focus-visible {
  outline: 3px solid #c8922a;
  outline-offset: 2px;
}

/* Online directory badge */
.card-online-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: #e6f4ea;
  color: #2e7d32;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  border: 1px solid #a5d6a7;
}

.card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2e4a, #2d4a6e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #c8922a;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.card-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2e4a;
  margin: 0 0 0.2rem;
  line-height: 1.3;
  padding-right: 3rem;
}

.card-contact {
  font-size: 0.82rem;
  color: #5a6a7a;
  margin: 0 0 0.75rem;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #4a5a6a;
}

.card-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-detail-icon {
  flex-shrink: 0;
  width: 14px;
  color: #c8922a;
  margin-top: 1px;
}

.card-detail-text {
  word-break: break-word;
}

.card-detail-text a {
  color: #1a6fb5;
  text-decoration: none;
}
.card-detail-text a:hover { text-decoration: underline; }

.card-minority-tag {
  display: inline-block;
  margin-top: 0.6rem;
  background: #fff8e1;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

/* ---- List View Card ---- */
.member-grid.list-view .member-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.5rem;
}

.member-grid.list-view .card-avatar {
  width: 40px;
  height: 40px;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.member-grid.list-view .card-body {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr auto;
  align-items: center;
  gap: 0.75rem;
}

.member-grid.list-view .card-name {
  margin: 0;
  padding-right: 0;
  font-size: 0.88rem;
}

.member-grid.list-view .card-contact {
  margin: 0;
  font-size: 0.8rem;
}

.member-grid.list-view .card-details {
  gap: 0.15rem;
}

.member-grid.list-view .card-minority-tag {
  margin-top: 0;
}

.member-grid.list-view .card-online-badge {
  position: static;
  margin-left: auto;
}

/* ---- No Results ---- */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #7a8a9a;
}
.no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results p { font-size: 1rem; margin: 0 0 1rem; }

/* ============================================================
   PAGINATION
   ============================================================ */
.dir-pagination {
  max-width: 1400px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 0.6rem;
  border: 1.5px solid #d1d9e0;
  border-radius: 0.4rem;
  background: #fff;
  color: #1a2e4a;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover {
  background: #f0f4f8;
  border-color: #c8922a;
}
.page-btn.active {
  background: #1a2e4a;
  border-color: #1a2e4a;
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-ellipsis {
  color: #9aa5b1;
  font-size: 0.9rem;
  padding: 0 0.25rem;
}

/* ============================================================
   MEMBER DETAIL MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: #fff;
  border-radius: 1rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f0f2f5;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #5a6a7a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}
.modal-close:hover { background: #e2e8f0; color: #1a2e4a; }

.modal-header {
  background: linear-gradient(135deg, #1a2e4a, #2d4a6e);
  padding: 2rem 2rem 1.5rem;
  border-radius: 1rem 1rem 0 0;
  color: #fff;
}

.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(200,146,42,0.2);
  border: 3px solid #c8922a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #c8922a;
  margin-bottom: 1rem;
}

.modal-biz-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  line-height: 1.3;
}

.modal-contact-name {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  margin: 0;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.modal-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.modal-badge-online { background: rgba(46,125,50,0.25); color: #a5d6a7; border: 1px solid rgba(165,214,167,0.4); }
.modal-badge-minority { background: rgba(200,146,42,0.2); color: #fde68a; border: 1px solid rgba(253,230,138,0.3); }

.modal-body {
  padding: 1.5rem 2rem 2rem;
}

.modal-section {
  margin-bottom: 1.25rem;
}

.modal-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c8922a;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f0f2f5;
}

.modal-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.modal-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9aa5b1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-field-value {
  font-size: 0.88rem;
  color: #1a2e4a;
  word-break: break-word;
}

.modal-field-value a {
  color: #1a6fb5;
  text-decoration: none;
}
.modal-field-value a:hover { text-decoration: underline; }

.modal-field-value.empty { color: #c0cad4; font-style: italic; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .dir-controls-inner {
    padding: 0.75rem 1rem;
  }

  .dir-stats-row {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .member-grid {
    grid-template-columns: 1fr;
  }

  .member-grid.list-view .card-body {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .member-grid.list-view .card-online-badge {
    margin-left: 0;
  }

  .modal-field-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .modal-header {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .login-card {
    padding: 2rem 1.5rem 1.5rem;
  }

  .dir-header-title {
    display: none;
  }
}

@media (max-width: 480px) {
  .dir-filters {
    width: 100%;
  }
  .dir-select {
    flex: 1 1 140px;
  }
}
