/**
 * Profile Search and Filter Styles
 * Styling for search input, filters, and results
 */

.search-filter-container {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

body.dark-mode .search-filter-container {
  background-color: #2a2a2a;
  border-color: #404040;
}

.search-box {
  margin-bottom: 1.5rem;
}

.search-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

body.dark-mode .search-box label {
  color: #e0e0e0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .fa-search {
  position: absolute;
  left: 12px;
  color: var(--primary-color);
  pointer-events: none;
}

.profile-search-input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: 'Raleway', sans-serif;
  background-color: #fff;
  color: #333;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .profile-search-input {
  background-color: #333;
  color: #e0e0e0;
  border-color: #555;
}

.profile-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(144, 50, 237, 0.1);
}

.profile-search-input::placeholder {
  color: #999;
}

body.dark-mode .profile-search-input::placeholder {
  color: #666;
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0.5rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover {
  color: var(--primary-color);
}

.clear-search-btn:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.search-box small {
  display: block;
  margin-top: 0.4rem;
  color: #666;
  font-size: 0.85rem;
}

body.dark-mode .search-box small {
  color: #999;
}

.filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-end;
}

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

.filter-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 0.9rem;
}

body.dark-mode .filter-group label {
  color: #e0e0e0;
}

.filter-group select {
  padding: 0.6rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: 'Raleway', sans-serif;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

body.dark-mode .filter-group select {
  background-color: #333;
  color: #e0e0e0;
  border-color: #555;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.reset-filters-btn {
  align-self: flex-end;
  width: 100%;
}

.search-results-info {
  text-align: center;
  padding: 1rem;
  background-color: rgba(144, 50, 237, 0.05);
  border-radius: 4px;
  border-left: 4px solid var(--primary-color);
}

body.dark-mode .search-results-info {
  background-color: rgba(144, 50, 237, 0.1);
}

.results-count {
  margin: 0;
  color: #666;
  font-weight: 500;
}

body.dark-mode .results-count {
  color: #ccc;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .search-filter-container {
    padding: 1rem;
  }

  .filter-controls {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .reset-filters-btn {
    width: 100%;
    max-width: none;
  }

  .search-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-search-input {
    min-height: 44px;
  }

  .search-box {
    margin-bottom: 1rem;
  }

  .filter-group select {
    min-height: 44px;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .filter-controls {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large screens - show all 4 filters in a row */
@media (min-width: 1025px) {
  .filter-controls {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .profile-search-input,
  .filter-group select {
    transition: none;
  }
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
