/**
 * Styles pour le système de recherche avancée des voitures
 * 
 * @package Divi
 * @since 1.0.0
 */

/* Conteneur principal */
.cars-advanced-search {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Section des filtres */
.search-filters {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

.cars-search-form {
  width: 100%;
}

/* Grille des filtres */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.filter-select,
.filter-input {
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #ffffff;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: #e12020;
  box-shadow: 0 0 0 3px rgba(225, 32, 32, 0.1);
}

.filter-select {
  cursor: pointer;
}

/* Actions de recherche */
.search-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.search-btn,
.reset-btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  min-width: 140px;
  justify-content: center;
}

.search-btn {
  background: linear-gradient(135deg, #e12020, #c41e3a);
  color: #ffffff;
}

.search-btn:hover {
  background: linear-gradient(135deg, #c41e3a, #a01830);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 32, 32, 0.3);
}

.search-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.reset-btn {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px solid #e1e5e9;
}

.reset-btn:hover {
  background: #e9ecef;
  color: #495057;
  transform: translateY(-2px);
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Section des résultats */
.search-results {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

/* En-tête des résultats */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f8f9fa;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-count {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.results-count span {
  color: #e12020;
  font-weight: 700;
}

.results-sort {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.results-sort label {
  font-weight: 600;
  color: #666;
  font-size: 0.9rem;
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-select:focus {
  outline: none;
  border-color: #e12020;
  box-shadow: 0 0 0 3px rgba(225, 32, 32, 0.1);
}

/* Grille des résultats */
.results-grid {
  margin-bottom: 2rem;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Pagination */
.results-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #f8f9fa;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
  color: #666;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.pagination-link:hover {
  border-color: #e12020;
  color: #e12020;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 32, 32, 0.2);
}

.pagination-link.active {
  background: #e12020;
  border-color: #e12020;
  color: #ffffff;
}

.pagination-ellipsis {
  color: #999;
  font-weight: 600;
  padding: 0 0.5rem;
}

/* Aucun résultat */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.no-results-content {
  max-width: 400px;
  margin: 0 auto;
}

.no-results-content i {
  font-size: 4rem;
  color: #ccc;
  margin-bottom: 1rem;
}

.no-results-content h3 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1rem;
  font-weight: 600;
}

.no-results-content p {
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Messages d'erreur */
.error {
  color: #e12020;
  text-align: center;
  padding: 2rem;
  background: #fff5f5;
  border: 2px solid #fed7d7;
  border-radius: 8px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .cars-advanced-search {
    padding: 1rem;
  }

  .search-filters,
  .search-results {
    padding: 1.5rem;
  }

  .filters-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .results-sort {
    justify-content: center;
  }

  .search-actions {
    flex-direction: column;
    width: 100%;
  }

  .search-btn,
  .reset-btn {
    width: 100%;
  }

  .cars-grid {
    grid-template-columns: 1fr;
  }

  .pagination {
    gap: 0.25rem;
  }

  .pagination-link {
    min-width: 35px;
    height: 35px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .search-filters,
  .search-results {
    padding: 1rem;
  }

  .filters-grid {
    gap: 0.75rem;
  }

  .filter-select,
  .filter-input {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
  }

  .search-btn,
  .reset-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .results-count {
    font-size: 1rem;
  }

  .sort-select {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-grid {
  animation: fadeIn 0.5s ease-out;
}

/* États de chargement */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #e12020;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
