:root {
  --select-arrow-bg-color: var(--color-bg-medium);
  --select-border-color: color(var(--color-border) blackness(+5%));
  --select-bg-color: var(--color-bg-white);
  --select-text-color: var(--color-text-medium);

  --select-border-radius: 4px;
}
.Select {
  position: relative;
  display: inline-block;
  color: var(--color-text-medium);
}

/* custom arrows */
.Select:before,
.Select:after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1em;
  width: 0;
  height: 0;
  pointer-events: none; /* no clicks since arrow is just for appearance */
}

/* arrow pointing up */
.Select:before {
  margin-top: -0.25rem;
  border-left: 0.3rem solid transparent;
  border-right: 0.3rem solid transparent;
  border-bottom: 0.3rem solid var(--color-border);
}

/* arrow pointing down */
.Select:after {
  margin-top: 0.2rem;
  border-left: 0.3rem solid transparent;
  border-right: 0.3rem solid transparent;
  border-top: 0.3rem solid var(--color-border);
}

.Select select {
  display: inline-block;
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  font-size: 0.8em;
  line-height: 1;
  color: var(--color-text-medium);

  border: 1px solid var(--color-border);
  background: var(--color-bg-white);

  border-radius: var(--select-border-radius);
  -webkit-appearance: none;
  -moz-appearance: none;

  box-shadow: 0 1px 2px var(--color-shadow);
}

.Select--blue select {
  color: var(--color-brand);
  border-color: var(--color-border);
  background-color: var(--color-bg-medium);
}
.Select--blue:after {
  border-top: 0.3rem solid var(--color-brand);
}
.Select--blue:before {
  border-bottom: 0.3rem solid var(--color-brand);
}

.Select--purple select {
  color: var(--color-accent2);
  border-color: var(--color-accent2);
  background-color: var(--color-bg-medium);
}
.Select--purple:after {
  border-top: 0.3rem solid var(--color-accent2);
}
.Select--purple:before {
  border-bottom: 0.3rem solid var(--color-accent2);
}

.Select--small select {
  padding: 0.25rem 1.5rem 0.25rem 0.5rem;
  font-size: 0.7em;
  line-height: 1.5em;
}
.Select--small:after {
  margin-top: -0.1rem;
  right: 0.5em;
}
.Select--small:before {
  border-bottom: none;
}

.Select select:focus {
  outline: none;
}

/* fix the outline that appears when interacting with metabase/components/Select */
.MB-Select:focus {
  outline: none;
}
