/* ============================================
   BOR COMMUNITY CANADA — DIRECTORY PAGE
   Designed by Achiek Kuol
   ============================================ */

/* --- CONTAINER --- */
.dir-container {
  padding-top: 36px;
  padding-bottom: 60px;
}

/* --- SEARCH BAR --- */
.dir-search-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dir-search-input-wrap {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.dir-search-input-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mid-gray);
  font-size: 0.9rem;
}

.dir-search-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
}

.dir-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.1);
}

.dir-city-filter {
  position: relative;
  min-width: 200px;
}

.dir-city-filter > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 0.85rem;
  z-index: 2;
  pointer-events: none;
}

.dir-city-select {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  appearance: none;
  cursor: pointer;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.dir-city-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.1);
}

/* --- STATS --- */
.dir-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.dir-stat-item strong { color: var(--primary); }

.dir-stat-divider {
  color: var(--mid-gray);
}

/* --- CITY GROUP --- */
.dir-city-group {
  margin-bottom: 36px;
}

.dir-city-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--light-gray);
}

.dir-city-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.dir-city-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
}

.dir-city-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--off-white);
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* --- MEMBERS GRID --- */
.dir-members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.dir-member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: default;
}

.dir-member-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.dir-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid rgba(27,67,50,0.15);
}

.dir-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(27,67,50,0.15);
}

.dir-member-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.dir-member-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-member-city {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.dir-member-city i {
  color: var(--primary);
  font-size: 0.7rem;
}

/* --- NO RESULTS --- */
.dir-no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.dir-no-results i {
  font-size: 3rem;
  color: var(--mid-gray);
  margin-bottom: 16px;
}

.dir-no-results h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.dir-no-results p {
  font-size: 0.9rem;
}

/* --- MAP SECTION --- */
.dir-map-section {
  margin-top: 48px;
}

.dir-map-section > h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dir-map-section > h3 i { color: var(--primary); }

.dir-map-placeholder {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.map-visual {
  position: relative;
  height: 320px;
  background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 30%, #a5d6a7 60%, #81c784 100%);
  overflow: hidden;
}

.map-visual::before {
  content: '🇨🇦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  opacity: 0.08;
}

.map-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.map-dot.large {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-width: 3px;
}

.map-dot:hover {
  transform: scale(1.3);
  z-index: 3;
}

.map-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: var(--white);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.map-label small {
  color: var(--accent-light);
  font-weight: 700;
}

.map-dot:hover .map-label {
  opacity: 1;
}

.map-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--primary-dark);
}

.map-note {
  text-align: center;
  padding: 16px 20px;
  font-size: 0.88rem;
  color: var(--text-light);
  background: var(--off-white);
  border-top: 1px solid var(--border);
  font-weight: 500;
}

/* --- DIRECTORY RESPONSIVE --- */
@media (max-width: 1024px) {
  .dir-members-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dir-members-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dir-search-bar {
    flex-direction: column;
  }

  .dir-search-input-wrap {
    min-width: auto;
  }

  .dir-city-filter {
    min-width: auto;
  }

  .map-visual {
    height: 240px;
  }
}

@media (max-width: 480px) {
  .dir-members-grid {
    grid-template-columns: 1fr;
  }

  .map-visual {
    height: 200px;
  }

  .map-dot { width: 10px; height: 10px; }
  .map-dot.large { width: 14px; height: 14px; }
}