.country-selector {
  position: relative;
  display: inline-block;
  font-family: 'Roboto', sans-serif;
}

.country-selector.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.country-selector-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.8em 1em;
  background-color: #fff;
  border: 2px solid #464e58;
  border-radius: 10px;
  cursor: pointer;
  min-width: 110px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.country-selector-trigger:hover {
  border-color: #252c82;
}

.country-selector-trigger:focus {
  outline: none;
  border-color: #252c82;
  box-shadow: 0 0 0 3px rgba(37, 44, 130, 0.15);
}

.country-selector-trigger.open {
  border-color: #252c82;
  box-shadow: 0 0 0 3px rgba(37, 44, 130, 0.15);
}

.selected-country {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-country.placeholder {
  color: #71727a;
}

.country-flag {
  font-size: 1.25em;
  line-height: 1;
}

.country-prefix {
  font-weight: 500;
  color: #525252;
  font-size: 1em;
}

.selected-country.placeholder .country-prefix {
  color: #71727a;
  font-weight: 400;
}

.dropdown-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 280px;
  background-color: #fff;
  border: 2px solid #464e58;
  border-radius: 10px;
  box-shadow: 3px 3px 6px #00000029;
  z-index: 1000;
  overflow: hidden;
}

.country-search {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.country-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #464e58;
  border-radius: 8px;
  font-size: 0.9em;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.country-search-input:focus {
  border-color: #252c82;
  box-shadow: 0 0 0 2px rgba(37, 44, 130, 0.15);
}

.country-search-input::placeholder {
  color: #71727a;
}

.country-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 0;
}

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

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

.country-list::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.country-option:hover {
  background-color: #f5f5f5;
}

.country-option.selected {
  background-color: #e8eaf6;
}

.country-option.selected:hover {
  background-color: #d0d4ed;
}

.country-option.highlighted {
  background-color: #f0f1f8;
  outline: 2px solid #252c82;
  outline-offset: -2px;
}

.country-option.highlighted.selected {
  background-color: #d0d4ed;
}

.country-option .country-flag {
  font-size: 1.3em;
}

.country-option .country-prefix {
  min-width: 50px;
  font-weight: 600;
  color: #252c82;
}

.country-option .country-name {
  flex: 1;
  color: #525252;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-no-results {
  padding: 16px 12px;
  text-align: center;
  color: #71727a;
  font-size: 0.9em;
}

@media (max-width: 480px) {
  .country-selector-trigger {
    min-width: unset;
    padding: 0.7em 0.8em;
  }

  .country-dropdown {
    min-width: unset;
  }

  .country-option .country-name {
    font-size: 0.85em;
  }

  .country-list {
    max-height: 200px;
  }
}

@media (max-width: 320px) {
  .country-selector-trigger {
    padding: 0.6em 0.8em;
    gap: 6px;
  }

  .country-flag {
    font-size: 1.1em;
  }

  .country-prefix {
    font-size: 0.9em;
  }

  .country-option {
    padding: 8px 10px;
    gap: 8px;
  }

  .country-option .country-flag {
    font-size: 1.1em;
  }

  .country-option .country-prefix {
    min-width: 45px;
    font-size: 0.85em;
  }

  .country-option .country-name {
    font-size: 0.8em;
  }

  .country-search-input {
    padding: 8px 10px;
    font-size: 0.85em;
  }

  .country-list {
    max-height: 180px;
  }
}
