@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --ar-primary: #0ea5b5;
  --ar-primary-light: #14c8db;
  --ar-primary-dark: #0b8a98;
  --ar-dark: #0a1f24;
  --ar-accent: #10b981;
  --ar-light-bg: #f7fafa;
  --ar-white: #ffffff;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-placeholder: #9ca3af;
  --border: #e5eaeb;
  --shadow-lg: 0 12px 32px rgba(10, 31, 36, 0.1), 0 4px 12px rgba(10, 31, 36, 0.06);
  --shadow-xl: 0 24px 56px rgba(10, 31, 36, 0.16), 0 8px 20px rgba(10, 31, 36, 0.08);
  --ar-sb-wrap-border: rgba(255, 255, 255, 0.12);
  --ar-sb-wrap-bg: rgba(255, 255, 255, 0.06);
  --ar-sb-label-upper: rgba(255, 255, 255, 0.5);
  --ar-sb-label-link: rgba(20, 200, 219, 0.9);
  --ar-sb-optional-bg: rgba(14, 165, 181, 0.12);
  --ar-sb-optional-border: rgba(14, 165, 181, 0.25);
  --ar-sb-focus-ring: rgba(14, 165, 181, 0.1);
  --ar-sb-field-hover: #f8fbfb;
}

.search-bar-wrap {
  position: relative;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--ar-sb-wrap-bg);
  border: 1px solid var(--ar-sb-wrap-border);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.1rem;
}

.search-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ar-sb-label-upper);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.search-bar-label a {
  color: var(--ar-sb-label-link);
  text-decoration: none;
  font-weight: 600;
}

.search-bar-label a:hover {
  color: var(--ar-primary-light);
}

.search-bar {
  display: flex;
  align-items: stretch;
  background: var(--ar-white);
  border-radius: 12px;
  overflow: visible;
  box-shadow: var(--shadow-xl);
  position: relative;
  min-height: 68px;
}

.sb-below-text {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.75rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sb-field {
  flex: 1;
  position: relative;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.sb-field:last-of-type {
  border-right: none;
}

.sb-field-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem 1.1rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  height: 100%;
  border-radius: 0;
}

.sb-field:first-child .sb-field-inner {
  border-radius: 12px 0 0 12px;
}

.sb-field-inner:hover {
  background: var(--ar-sb-field-hover);
}

.sb-field-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 0.35rem;
  white-space: nowrap;
}

.sb-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 22px;
}

.sb-val-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.93rem;
  font-weight: 400;
  color: var(--text-placeholder);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.sb-val-text.has-value {
  font-weight: 600;
  color: var(--ar-dark);
}

.sb-arrow {
  color: var(--text-placeholder);
  font-size: 0.75rem;
  transition: transform 0.22s ease;
  flex-shrink: 0;
  line-height: 1;
}

.sb-field.open .sb-arrow {
  transform: rotate(180deg);
  color: var(--ar-primary);
}

.sb-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--ar-white);
  border-radius: 14px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  display: none;
  animation: ar-dd-fade 0.18s ease;
}

.sb-dropdown.open {
  display: block;
}

@keyframes ar-dd-fade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sb-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sb-dropdown ul::-webkit-scrollbar {
  width: 4px;
}

.sb-dropdown ul::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sb-dropdown li {
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sb-dropdown li:hover {
  background: var(--ar-light-bg);
  color: var(--ar-primary);
}

.sb-dropdown li.selected {
  color: var(--ar-primary);
  font-weight: 600;
}

.sb-dropdown li.selected::after {
  content: '\F26D';
  font-family: 'bootstrap-icons';
  margin-left: auto;
  font-size: 0.8rem;
}

.sb-dropdown li i {
  font-size: 0.88rem;
  color: var(--ar-primary);
  width: 16px;
  flex-shrink: 0;
}

.sb-dropdown li.dd-empty {
  color: var(--text-muted);
  font-weight: 400;
  cursor: default;
  font-style: italic;
  font-size: 0.83rem;
}

.sb-dropdown li.dd-empty:hover {
  background: none;
  color: var(--text-muted);
}

.sb-dropdown .dd-opt-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.55rem 1.1rem 0.28rem;
  border-top: 1px solid var(--border);
  margin-top: 0.2rem;
}

.sb-dropdown .dd-opt-label:first-child {
  border-top: none;
  margin-top: 0;
}

.dd-search-wrap {
  padding: 0.6rem 0.8rem 0.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--ar-white);
  z-index: 1;
}

.dd-search-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  font-size: 0.86rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ar-dark);
  background: var(--ar-light-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%236B7280' d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 0.65rem center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dd-search-input:focus {
  border-color: var(--ar-primary);
  box-shadow: 0 0 0 3px var(--ar-sb-focus-ring);
  background-color: var(--ar-white);
}

.dd-search-input::placeholder {
  color: var(--text-placeholder);
}

.optional-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ar-sb-optional-bg);
  color: var(--ar-primary);
  border: 1px solid var(--ar-sb-optional-border);
  padding: 0.1rem 0.45rem;
  border-radius: 100px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.sb-btn {
  background: var(--ar-primary);
  color: var(--ar-white);
  border: none;
  border-radius: 0 12px 12px 0;
  padding: 0 1.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
  min-width: 148px;
  justify-content: center;
}

.sb-btn:hover {
  background: var(--ar-primary-light);
}

@media (max-width: 768px) {
  .search-bar {
    flex-direction: column;
    border-radius: 12px;
  }

  .sb-field {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sb-field:last-of-type {
    border-bottom: none;
  }

  .sb-field:first-child .sb-field-inner {
    border-radius: 12px 12px 0 0;
  }

  .sb-btn {
    border-radius: 0 0 12px 12px;
    padding: 1rem;
  }

  .sb-dropdown {
    min-width: 100%;
  }
}

/* Specialty field — hidden until further notice */
#field-specialty,
#mp-field-specialty {
  display: none !important;
}

/* Advertiser popup */
.sb-below-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--ar-primary-light);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(20, 200, 219, 0.35);
  transition: color 0.15s;
}

.sb-below-link:hover {
  color: #fff;
}

.sb-ad-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background: var(--ar-white);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow:
    0 8px 30px rgba(10, 31, 36, 0.18),
    0 2px 8px rgba(10, 31, 36, 0.1);
  z-index: 500;
  text-align: left;
}

.sb-ad-popup.open {
  display: block;
}

.sb-ad-popup__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.sb-ad-popup__close:hover {
  color: #374151;
}

.sb-ad-popup__body {
  font-size: 0.78rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 0.85rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding-right: 0.5rem;
}

.sb-ad-popup__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ar-primary);
  text-decoration: none;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: color 0.15s;
}

.sb-ad-popup__link:hover {
  color: var(--ar-primary-dark);
  text-decoration: none;
}

/* === Inline variant (light background) === */

.sb-inline-wrap {
  width: 100%;
  padding: 2rem 0;
}

.sb-inline-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 1.45rem;
  color: var(--ar-dark);
  text-align: center;
  margin-bottom: 1.1rem;
  line-height: 1.3;
  font-weight: 400;
}

/* Override search-bar dark styles for
   inline light background variant */
.sb-inline-wrap .search-bar {
  background: var(--ar-white);
  border: 1.5px solid var(--border, #e5e7eb);
  box-shadow: 0 2px 12px rgba(10, 31, 36, 0.08);
  border-radius: 12px;
  max-width: 100%;
}

.sb-inline-wrap .sb-field-label {
  color: #6b7280;
}

.sb-inline-wrap .sb-val-text {
  color: var(--ar-dark);
}

.sb-inline-wrap .sb-field {
  border-right-color: #e5e7eb;
}

.sb-inline-below {
  text-align: center;
  margin-top: 0.75rem;
  position: relative;
  display: flex;
  justify-content: center;
}

.sb-inline-ad-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--ar-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(14, 165, 181, 0.35);
  transition: color 0.15s;
}

.sb-inline-ad-btn:hover {
  color: var(--ar-primary-dark);
}

/* Popup opens upward on inline variant */
.sb-ad-popup--up {
  bottom: auto;
  top: calc(100% + 0.5rem);
}
