/**
 * DealerSearch Styles
 * Following STYLE_GUIDE.md dark theme specification
 */

.container {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-md, 16px);
  margin-bottom: var(--spacing-lg, 24px);
  flex-wrap: wrap;
}

.searchWrapper {
  flex: 1 1 auto;
  min-width: 250px;
  position: relative;
}

.searchIcon {
  position: absolute;
  left: var(--spacing-md, 16px);
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-text-tertiary, rgba(148, 163, 184, 0.85));
  pointer-events: none;
}

.searchInput {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px 12px 2.75rem;
  border: 1px solid var(--color-border, rgba(148, 163, 184, 0.25));
  border-radius: 8px;
  font-size: 1rem;
  color: var(--color-text-primary, #f8fafc);
  background: rgba(15, 23, 42, 0.75);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.searchInput::placeholder {
  color: var(--color-text-tertiary, rgba(148, 163, 184, 0.85));
}

.searchInput:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.searchInput:disabled {
  background: rgba(30, 41, 59, 0.5);
  opacity: 0.65;
  cursor: not-allowed;
}

.filters {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-sm, 8px);
  align-items: center;
}

.select {
  padding: 12px 2.5rem 12px 16px;
  border: 1px solid var(--color-border, rgba(148, 163, 184, 0.25));
  border-radius: 8px;
  font-size: 1rem;
  color: var(--color-text-primary, #f8fafc);
  background: rgba(15, 23, 42, 0.75);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2338bdf8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  transition: border-color 0.2s;
}

.select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.select:disabled {
  background-color: rgba(30, 41, 59, 0.5);
  opacity: 0.65;
  cursor: not-allowed;
}

.clearButton {
  padding: 12px var(--spacing-md, 16px);
  background: transparent;
  border: 1px solid var(--color-border, rgba(148, 163, 184, 0.25));
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary, rgba(203, 213, 225, 0.9));
  cursor: pointer;
  transition: all 0.2s;
}

.clearButton:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
}

.clearButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .searchWrapper {
    min-width: 100%;
  }

  .filters {
    flex-wrap: wrap;
  }

  .select {
    flex: 1;
    min-width: 120px;
  }
}
