/**
 * Specialty Dropdown – GF Field
 *
 * Uses high-specificity selectors (.ginput_container_ejb_specialty prefix)
 * to avoid being overridden by Gravity Forms or theme CSS.
 */

/* ── Container ── */
.gform_wrapper .ginput_container_ejb_specialty {
  position: relative;
}

.ginput_container_ejb_specialty .ejb-spec-field {
  position: relative;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Input row ── */
.ginput_container_ejb_specialty .ejb-spec-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.ginput_container_ejb_specialty .ejb-spec-field.active .ejb-spec-input-wrap {
  border-color: #1a9a9a;
  box-shadow: 0 0 0 3px rgba(26, 154, 154, 0.12);
}

.ginput_container_ejb_specialty .ejb-spec-input {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #222;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  line-height: normal !important;
}

.ginput_container_ejb_specialty .ejb-spec-input::placeholder {
  color: #888;
  font-weight: 400;
}

/* ── SVG chevron – force size so theme/GF can't blow it up ── */
.ginput_container_ejb_specialty .ejb-spec-chev {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  max-width: 22px;
  min-height: 22px;
  max-height: 22px;
  stroke: #666;
  fill: none !important;
  stroke-width: 2.5;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
  display: inline-block;
}

.ginput_container_ejb_specialty .ejb-spec-chev path {
  fill: none !important;
  stroke: inherit;
}

.ginput_container_ejb_specialty .ejb-spec-chev.flipped {
  transform: rotate(180deg);
  stroke: #1a9a9a;
}

/* When specs selected and NOT active, hide the text input */
.ginput_container_ejb_specialty .ejb-spec-field.has-specs:not(.active) .ejb-spec-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ginput_container_ejb_specialty .ejb-spec-field.has-specs:not(.active) .ejb-spec-input-wrap {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ── Dropdown panel ── */
.ginput_container_ejb_specialty .ejb-spec-dd {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10);
  padding: 4px;
  z-index: 9999;
  box-sizing: border-box;
}

.ginput_container_ejb_specialty .ejb-spec-dd::-webkit-scrollbar { width: 5px; }
.ginput_container_ejb_specialty .ejb-spec-dd::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.ginput_container_ejb_specialty .ejb-spec-dd::-webkit-scrollbar-thumb:hover { background: #999; }

.ginput_container_ejb_specialty .ejb-spec-dd.open {
  display: block;
  animation: ejbSpecDdIn 0.15s ease-out;
}

@keyframes ejbSpecDdIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Dropdown items ── */
.ginput_container_ejb_specialty .ejb-spec-dd-item {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #eee;
  background: #fff;
  margin: 0;
  line-height: 1.4;
}

.ginput_container_ejb_specialty .ejb-spec-dd-item:last-child {
  border-bottom: none;
}

.ginput_container_ejb_specialty .ejb-spec-dd-item:hover {
  background: #edf8f8;
  color: #0d6e6e;
}

.ginput_container_ejb_specialty .ejb-spec-arrow {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  color: #999;
  flex-shrink: 0;
}

.ginput_container_ejb_specialty .ejb-spec-back {
  font-weight: 600;
  color: #1a9a9a;
  font-size: 14px;
}

.ginput_container_ejb_specialty .ejb-spec-back:hover {
  background: #edf8f8;
}

/* ── Sub-item layout ── */
.ginput_container_ejb_specialty .ejb-spec-item-text {
  flex: 1;
  min-width: 0;
}

.ginput_container_ejb_specialty .ejb-spec-item-cat {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  white-space: nowrap;
  margin-left: 8px;
}

.ginput_container_ejb_specialty .ejb-spec-field.searching .ejb-spec-item-cat {
  display: inline;
}

/* ── Checkbox indicator ── */
.ginput_container_ejb_specialty .ejb-spec-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #1a3a4a;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.ginput_container_ejb_specialty .ejb-spec-sub-item.selected .ejb-spec-check {
  background: #1a3a4a;
  border-color: #1a3a4a;
}

.ginput_container_ejb_specialty .ejb-spec-sub-item.selected .ejb-spec-check::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.ginput_container_ejb_specialty .ejb-spec-sub-item.selected {
  color: #0d6e6e;
  font-weight: 600;
}

/* ── No match message ── */
.ginput_container_ejb_specialty .ejb-spec-no-match {
  padding: 24px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #888;
}

/* ── Tags ── */
.ginput_container_ejb_specialty .ejb-spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  min-height: 0;
}

.ginput_container_ejb_specialty .ejb-spec-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #edf8f8;
  border: 1px solid #a0dede;
  color: #0d6e6e;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px 3px 10px;
  border-radius: 50px;
  white-space: nowrap;
  animation: ejbSpecTagIn 0.15s ease-out;
}

@keyframes ejbSpecTagIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.ginput_container_ejb_specialty .ejb-spec-tag-x {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(13, 110, 110, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 10px;
  line-height: 1;
  color: #0d6e6e;
}

.ginput_container_ejb_specialty .ejb-spec-tag-x:hover {
  background: rgba(13, 110, 110, 0.3);
}

/* ── Gravity Forms error state ── */
.gform_wrapper .gfield_error .ejb-spec-input-wrap {
  border-color: #c02b0a;
}

.gform_wrapper .gfield_error .ejb-spec-field.active .ejb-spec-input-wrap {
  box-shadow: 0 0 0 3px rgba(192, 43, 10, 0.12);
}
