/* Componentes compartidos */

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  padding: 0 var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
}

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn-primary {
  padding: var(--space-xs) var(--space-md);
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background var(--duration) var(--ease);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--muted);
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
}

.btn-sm:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.btn-sm.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* btn-primary wins over btn-sm when combined */
.btn-primary.btn-sm {
  color: white;
  background: var(--accent);
}

.btn-primary.btn-sm:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: var(--radius);
  transition: background var(--duration) var(--ease);
}

.btn-icon:hover { background: var(--surface-alt); }

.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-light);
}

/* ── Inputs ────────────────────────────────────────────────────────────── */
input[type="text"],
textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--input-border, var(--border));
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: all var(--duration) var(--ease);
}

.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Concept tags ──────────────────────────────────────────────────────── */
.concept-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-sm);
  font-size: var(--font-size-sm);
  border-radius: 999px;
  border: 1px solid;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.concept-tag:hover {
  filter: brightness(0.95);
}

/* ── Excerpt popup ─────────────────────────────────────────────────────── */
.excerpt-popup {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
}

.excerpt-popup:not([hidden]) {
  pointer-events: auto;
}

.popup-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.popup-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ── Autocomplete dropdown ─────────────────────────────────────────────── */
.autocomplete-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: var(--space-xs) var(--space-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: background var(--duration) var(--ease);
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--accent-light);
}

.autocomplete-item .match {
  font-weight: 700;
  color: var(--accent);
}

.autocomplete-item .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}

.autocomplete-new {
  color: var(--accent);
  font-style: italic;
}

/* ── Map controls ──────────────────────────────────────────────────────── */
.map-controls {
  display: flex;
  gap: 2px;
}
