/* Estilos para el filtro de propiedades */

/* Sección del botón de filtro */
.filter-section {
  margin: 10px 0;
  text-align: left;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.filter-btn {
  background: linear-gradient(135deg, #2d5a3d, #39a452);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(45, 90, 61, 0.2);
}

.filter-btn:hover {
  background: linear-gradient(135deg, #39a452, #2d5a3d);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(45, 90, 61, 0.3);
}

.filter-btn i {
  font-size: 0.9rem;
}

/* Modal del filtro */
.filter-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.filter-content {
  background: white;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.filter-modal.show .filter-content {
  transform: scale(1);
}

/* Header del modal */
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0 20px;
  border-bottom: 1px solid #e5e7eb;
}

.filter-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d5a3d;
  margin: 0;
}

.filter-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.filter-close:hover {
  background-color: #f3f4f6;
  color: #374151;
}

/* Body del modal */
.filter-body {
  padding: 20px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.filter-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.filter-input:focus {
  outline: none;
  border-color: #2d5a3d;
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

.filter-input::placeholder {
  color: #9ca3af;
}

/* Footer del modal */
.filter-footer {
  display: flex;
  gap: 12px;
  padding: 0 20px 20px 20px;
  justify-content: flex-end;
}

.btn-filter-clear,
.btn-filter-apply {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-filter-clear {
  background-color: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.btn-filter-clear:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.btn-filter-apply {
  background: linear-gradient(135deg, #2d5a3d, #39a452);
  color: white;
}

.btn-filter-apply:hover {
  background: linear-gradient(135deg, #39a452, #2d5a3d);
  transform: translateY(-1px);
}

.btn-filter-apply:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Resultados del filtro */
.filter-results {
  margin-top: 15px;
  padding: 15px;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.filter-results h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #374151;
}

.filter-results-count {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 480px) {
  .filter-content {
    width: 95%;
    margin: 20px;
  }
  
  .filter-footer {
    flex-direction: column;
  }
  
  .btn-filter-clear,
  .btn-filter-apply {
    width: 100%;
    justify-content: center;
  }
}

/* Animaciones */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-modal.show .filter-content {
  animation: slideInDown 0.3s ease;
}

/* Estado de carga */
.filter-loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: #6b7280;
}

.filter-loading.show {
  display: block;
}

.filter-loading i {
  animation: spin 1s linear infinite;
}

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

/* Estilos para el botón "Ver Todas" */
#showAllBtn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 4px rgba(107, 114, 128, 0.2);
}

#showAllBtn:hover {
  background: #5a606b;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
}

#showAllBtn i {
  font-size: 0.9rem;
}

/* Estilos para autocomplete */
.autocomplete-container {
  position: relative;
  width: 100%;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestions.show {
  display: block;
}

.autocomplete-suggestion {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.autocomplete-suggestion:hover {
  background-color: #f8f9fa;
}

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

.autocomplete-suggestion.selected {
  background-color: #e7f3ff;
}

.suggestion-title {
  font-weight: 600;
  color: #2d5a3d;
  margin-bottom: 2px;
}

.suggestion-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.suggestion-count {
  font-size: 0.8rem;
  color: #9ca3af;
  float: right;
  margin-top: 2px;
}

/* Estilos para el select de propiedades */
#propiedadesCliente {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
}

#propiedadesCliente:focus {
  border-color: #39a452;
  box-shadow: 0 0 0 3px rgba(57, 164, 82, 0.2);
  outline: none;
}
