/* User Search Page & Global Combobox Styling (Light Theme) */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
  --accent-purple: #4f46e5;
  --border-color: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

body.user-search-body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

.user-search-main {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.search-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.search-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.search-subtitle {
  color: #64748b;
  font-size: 1.1rem;
  margin-top: 0;
}

.search-filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.filters-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 1rem;
  align-items: end;
  width: 100%;
}

@media (max-width: 1024px) {
  .filters-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-actions {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .filters-form {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .filter-actions {
    grid-column: span 1;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
}

.filter-input, .filter-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.results-header {
  margin-bottom: 1.25rem;
}

.results-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
}

@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
  }
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  height: 100%;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
}

.user-card:hover {
  transform: translateY(-4px);
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}

.card-avatar-wrap {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #f1f5f9;
  border: 2px solid #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.card-avatar {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: 50%;
  display: block;
}

.card-badge-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.role-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  display: inline-block;
  letter-spacing: 0.025em;
}

.role-badge.landlord {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.role-badge.agent {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.role-badge.tenant {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.card-verified-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.card-verified-badge--verified {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.card-verified-badge--basic {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.card-trust-pill {
  font-size: 0.78rem;
  font-weight: 500;
  color: #334155;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e2e8f0;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-username {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.5rem 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-city {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.card-headline {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 1.25rem;
  line-height: 1.4;
  height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cta {
  margin-top: auto;
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  transition: all 0.2s;
}

.user-card:hover .card-cta {
  background: #2563eb;
  color: #ffffff;
}

.pagination-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.page-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.page-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  font-weight: 700;
}

.empty-state-box, .error-state-box {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid #e2e8f0;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  color: #0f172a;
}

.empty-state-box h3, .error-state-box h3 {
  color: #0f172a;
  margin-top: 0;
}

.empty-state-box p, .error-state-box p {
  color: #64748b;
}

.card-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
  height: 320px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.search-combobox-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-combobox-wrapper:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #0f172a;
  font-size: 0.95rem;
  outline: none;
  padding: 0.4rem 0;
}

.search-suggestions-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 350px;
  overflow-y: auto;
  z-index: 200;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.focused {
  background: #f8fafc;
}

.suggestion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.suggestion-info {
  display: flex;
  flex-direction: column;
}

.suggestion-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
}

.suggestion-meta {
  font-size: 0.75rem;
  color: #64748b;
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .global-search-container {
    max-width: 100%;
  }
}
