/* ============================================================
   CUSTOM SEARCHABLE COUNTRY PICKER
   ============================================================ */

.country-picker-group {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px !important;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: visible !important;
}

.country-picker-group:focus-within {
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.country-picker {
  position: relative;
  flex-shrink: 0;
  z-index: 12;
  width: 132px;
  min-width: 132px;
  align-self: stretch;
  display: flex;
}

.country-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 100%;
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 10px !important;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1;
}

#countryPickerFlag {
  font-size: 16px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
  min-width: 18px;
  text-align: center;
  display: inline-block;
}

#countryPickerCode {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.country-picker-group input#phone {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(0, 0, 0, 0.32) !important;
  color: #f4f7fb !important;
  font-size: 15px !important;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 14px !important;
  position: relative;
  top: 1px;
}

.country-picker-group input#phone::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  font-weight: 400;
}

.country-picker-group input#phone:focus {
  border-color: rgba(212, 175, 55, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14) !important;
}

.country-picker-btn:hover,
.country-picker-btn:focus {
  border-color: var(--color-gold, #d4af37) !important;
  background: rgba(0, 0, 0, 0.6) !important;
  outline: none;
}

.country-picker-btn[aria-expanded="true"] {
  border-color: var(--color-gold, #d4af37) !important;
}

.country-picker-arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
  margin-left: 2px;
}

.country-picker-btn[aria-expanded="true"] .country-picker-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.country-picker-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 100005;
  background: #1a1d24;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  width: min(360px, calc(100vw - 40px));
  max-width: 360px;
  min-width: 280px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: none;
  animation: countryDropIn 0.18s ease-out;
}

.country-picker-dropdown.is-open {
  display: block;
}

.country-picker-dropdown.drop-up {
  top: auto;
  bottom: calc(100% + 8px);
}

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

/* Search bar */
.country-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}

.country-search-wrap i {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  flex-shrink: 0;
}

#countrySearch {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff !important;
  font-size: 13px !important;
  width: 100%;
  padding: 0 !important;
  box-shadow: none !important;
}

#countrySearch::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

/* Country list */
.country-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

.country-list::-webkit-scrollbar {
  width: 4px;
}

.country-list::-webkit-scrollbar-track {
  background: transparent;
}

.country-list::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 2px;
}

.country-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI", Tahoma, Arial, sans-serif;
}

.country-option:hover,
.country-option.highlighted {
  background: rgba(212, 175, 55, 0.12);
  color: #fff;
}

.country-option.selected {
  background: rgba(212, 175, 55, 0.18);
  color: #f3c74b;
}

.country-option span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  font-family: monospace;
  margin-left: auto;
}

.country-no-result {
  padding: 12px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

/* Mobile adjustments */
@media (max-width: 575px) {
  .country-picker-group {
    padding: 8px !important;
    gap: 8px !important;
  }
  .country-picker {
    width: 118px;
    min-width: 118px;
  }
  .country-picker-dropdown {
    width: min(88vw, 300px);
    min-width: 0;
    left: 0;
  }
  .country-picker-btn {
    height: 42px;
    min-width: 72px;
    font-size: 12px;
  }
  .country-picker-group input#phone {
    height: 42px !important;
    font-size: 14px !important;
    top: 0;
  }
}
