/**
 * Portfolio Filters and Search Styles
 * Styles for filter controls and search functionality
 */

/* Filter Controls */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem auto;
  justify-content: center;
  padding: 0 1rem;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: left 0.3s ease;
  z-index: -1;
}

.filter-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.filter-btn:hover::before {
  left: 0;
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-btn.active::before {
  display: none;
}

/* Search Bar */
.portfolio-search-container {
  max-width: 500px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1rem;
  position: relative;
}

.portfolio-search {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1.25rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.portfolio-search:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.portfolio-search::placeholder {
  color: #9ca3af;
}

/* Search Icon */
.portfolio-search-container::after {
  content: '🔍';
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.125rem;
  color: #9ca3af;
  pointer-events: none;
}

/* Tag Filters */
.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  justify-content: center;
}

.tag-filter {
  padding: 0.375rem 0.875rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-filter:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.tag-filter.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* Loading States */
.portfolio-loading,
.testimonials-loading {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

.portfolio-loading::before,
.testimonials-loading::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

.no-results p {
  font-size: 1.125rem;
  margin: 0 0 1rem;
}

.no-results button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.no-results button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 0;
  justify-content: center;
  margin: 2rem auto;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 0.25rem;
  max-width: 300px;
}

.view-toggle button {
  flex: 1;
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-toggle button.active {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Sort Dropdown */
.portfolio-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem auto;
  justify-content: center;
}

.portfolio-sort label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.portfolio-sort select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #374151;
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

.portfolio-sort select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Results Count */
.results-count {
  text-align: center;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.results-count strong {
  color: #667eea;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .portfolio-filters {
    gap: 0.375rem;
  }
  
  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  
  .portfolio-search-container {
    padding: 0 1rem;
  }
  
  .portfolio-search {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.9375rem;
  }
  
  .view-toggle {
    width: 90%;
  }
}

@media (max-width: 480px) {
  .portfolio-filters {
    flex-direction: column;
    align-items: stretch;
    padding: 0 2rem;
  }
  
  .filter-btn {
    width: 100%;
  }
}