/* =========================================
   SEARCH UI SPECIFIC STYLING
   ========================================= */

.search-header {
  margin-bottom: var(--s-16);
  border-bottom: none;
  padding-bottom: 0;
}

/* SEARCH INPUT WRAPPER */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--s-24);
  width: 100%;
}

.search-icon {
  position: absolute;
  left: var(--s-16);
  width: 20px;
  height: 20px;
  color: var(--c-text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 48px;
  font-size: 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  color: var(--c-text-main);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-focus-ring);
}

.search-input:focus + .search-icon,
.search-input-wrapper:focus-within .search-icon {
  color: var(--c-primary);
}

.search-clear {
  position: absolute;
  right: var(--s-8);
  width: 32px;
  height: 32px;
  padding: var(--s-4);
}

.hidden {
  display: none !important;
}

/* FILTER PILLS */
.search-filters-wrapper {
  margin-bottom: var(--s-24);
  margin-left: calc(var(--s-24) * -1);
  margin-right: calc(var(--s-24) * -1);
  padding: 0 var(--s-24);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.search-filters-wrapper::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.search-filters {
  display: flex;
  gap: var(--s-8);
  width: max-content;
  padding-bottom: var(--s-8); /* Room for focus rings/shadows */
}

.filter-pill {
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-muted);
  background: transparent;
  border: 1px solid var(--c-border);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-pill:hover {
  background: var(--c-border);
  color: var(--c-text-main);
}

.filter-pill.active {
  background: var(--c-primary);
  color: var(--c-surface);
  border-color: var(--c-primary);
}

/* RESULTS AREA */
.search-results-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* EMPTY / DEFAULT STATES */
.search-empty-state,
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-48) var(--s-16);
  color: var(--c-text-muted);
  animation: fadeIn var(--transition-normal) forwards;
}

.empty-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-16);
  color: var(--c-text-muted);
}

.empty-icon-wrapper svg {
  width: 32px;
  height: 32px;
}

.search-empty-state h3 {
  color: var(--c-text-main);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--s-8);
}

.search-empty-state p {
  font-size: 14px;
}

/* LOADING SHIMMER / SPINNER */
.search-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--s-16);
}

/* RESULT CARDS */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
  padding-bottom: var(--s-64);
}

.result-card {
  display: flex;
  align-items: center;
  padding: var(--s-16);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid var(--c-border);
  animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-hover);
}

.result-card:active {
  transform: translateY(0);
}

.result-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: var(--s-16);
}

.result-content {
  flex-grow: 1;
  min-width: 0; /* allows truncation */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-title {
  font-weight: 600;
  color: var(--c-text-main);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-subtitle {
  font-size: 13px;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* Specific item type styling */
.type-property .result-icon-box {
  background: #cbe5ed;
  color: #1c404e;
}
.type-client .result-icon-box {
  background: #dce1f8;
  color: #1b1f4c;
}
.type-transaction .result-icon-box {
  background: var(--c-income-bg);
  color: var(--c-income);
}

.type-property .result-meta {
  background: #cbe5ed;
  color: #1c404e;
}
.type-client .result-meta {
  background: #dce1f8;
  color: #1b1f4c;
}
.type-transaction .result-meta {
  background: var(--c-income-bg);
  color: var(--c-income);
}

/* ANIMATIONS */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
