/*
  Scoped tightly to the custom directory wrapper so we don't affect other inputs.
  Markup (from inspect):
  <div id="my-groups-directory">
    <div class="mgd-search">
      <input type="text" id="mgd-search-input" ...>
      <button id="mgd-search-clear">×</button>
    </div>
  </div>
*/

#my-groups-directory .mgd-search{
  position: relative;
  display: flex;
  align-items: center;
}

#my-groups-directory #mgd-search-input{
  -webkit-appearance: none;
  appearance: none;
  width: min(520px, 62vw);
  max-width: 100%;
  height: 46px;
  padding: 0 56px 0 18px; /* space for the clear button */
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.92);
  color: #1f2937;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

#my-groups-directory #mgd-search-input::placeholder{
  color: rgba(31,41,55,.45);
  opacity: 1;
}

#my-groups-directory #mgd-search-input:focus{
  outline: none;
  border-color: rgba(201, 112, 74, .65); /* JR accent */
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0,0,0,.08), 0 0 0 4px rgba(201, 112, 74, .18);
}

#my-groups-directory #mgd-search-clear{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(245,246,247,.95);
  color: rgba(201, 112, 74, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transition: transform .12s ease, background-color .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease;
}

#my-groups-directory #mgd-search-clear:hover{
  background: rgba(201, 112, 74, 1);
  color: #ffffff;
  border-color: rgba(201, 112, 74, 1);
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}

#my-groups-directory #mgd-search-clear:active{
  transform: translateY(-50%) scale(0.96);
}

#my-groups-directory #mgd-search-clear:focus{
  outline: none;
  box-shadow: 0 10px 22px rgba(0,0,0,.10), 0 0 0 4px rgba(201, 112, 74, .18);
}

/* Reduce footprint on very small screens */
@media (max-width: 520px){
  #my-groups-directory #mgd-search-input{
    width: 100%;
  }
}
