/**
 * search.css — overrides cho trang /plant-search
 * Base styles từ shared-styles.css
 */

/* ── Match badge ── */
.plant-match-badge {
  padding: 3px 8px;
  background: rgba(16,185,129,.85);
  color: #fff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ── Active filter tags ── */
.filter-tag-clear {
  background: transparent !important;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}
.filter-tag-clear:hover { border-color: var(--primary); color: var(--primary); }

/* ── Load More button ── */
.btn-load-more {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 10px 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-load-more:hover:not(:disabled) { background: var(--primary); color: #0f172a; }
.btn-load-more:disabled { opacity: .5; cursor: not-allowed; }

/* ── Loading ── */
#loadingIndicator { display: none; text-align: center; padding: 32px 0; }
#loadingIndicator .spinner {
  width: 32px; height: 32px; margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Safety icon colors ── */
.item-icon.safe    { color: #10b981; }
.item-icon.caution { color: #f59e0b; }
.item-icon.danger  { color: #ef4444; }

/* ── Sort Chips ── */
.sort-chips {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.sort-chip {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s;
  display: flex;
  align-items: center;
}
.sort-chip:hover { border-color: var(--primary); color: var(--primary); }
.sort-chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.sort-chip-arrow { font-size: 11px; margin-left: 2px; }

/* ── Advanced Filter Bar ── */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 8px 0 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.filter-bar:empty { display: none; }

.filter-bar-group { position: relative; flex-shrink: 0; }

.filter-bar-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .2s;
}
.filter-bar-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-bar-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.fbar-arrow { font-size: 10px; opacity: .7; }
.fbar-badge {
  background: var(--primary);
  color: var(--bg);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
}

.filter-bar-dropdown {
  display: none;
  position: fixed;        /* fixed để thoát overflow:hidden của parent */
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
  min-width: 180px;
  z-index: 500;
  padding: 6px 0;
}
.filter-bar-dropdown.open { display: block; }

.fbar-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background .12s;
  user-select: none;
}
.fbar-option:hover { background: var(--card-hover); }
.fbar-option.active { color: var(--primary); font-weight: 600; }
.fbar-check { flex-shrink: 0; font-size: 14px; color: var(--text-muted); }
.fbar-option.active .fbar-check { color: var(--primary); }
