/* Choices.js customization for dark theme */

/* Style original select elements to match Choices.js styling */
select.coin-select {
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid #2a2f4a;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 1rem;
  min-width: 200px;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  width: 100%;
}

select.coin-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select.coin-select option {
  background-color: #1a1f3a;
  color: #ffffff;
  padding: 12px 16px;
}

/* Hide original select elements after Choices.js initializes */
.choices {
  margin-bottom: 0;
  min-width: 200px;
  width: 100%;
}

.choices__inner {
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid #2a2f4a;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 12px;
  color: #ffffff;
  transition: all 0.2s ease;
}

.choices__input {
  background-color: transparent;
  font-size: 1rem;
  color: #2a2f4a;
}

.choices__input::placeholder {
  color: #a0a0b8;
}

.choices__list--dropdown {
  border: 2px solid #667eea;
  border-radius: 8px;
  background: #1a1f3a;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
}

.choices__list--dropdown .choices__item {
  padding: 12px 16px;
  font-size: 1rem;
  color: #ffffff;
  border-bottom: 1px solid #2a2f4a;
  transition: all 0.2s ease;
}

.choices__list--dropdown .choices__item--selectable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.choices__list--dropdown .choices__item--selectable:hover {
  background-color: #667eea;
  color: white;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: #667eea;
  color: white;
}

.choices.is-focused .choices__inner {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.choices__list--single {
  padding: 0;
}

.choices__list--single .choices__item {
  color: #ffffff;
  font-size: 1rem;
}

/* Dark theme for dropdown when open */
.choices.is-open .choices__inner {
  border-color: #667eea;
  background-color: rgba(255, 255, 255, 0.15);
}

.choices.is-open .choices__list--dropdown {
  background: #1a1f3a;
  border-color: #667eea;
}

/* Ensure dropdown items maintain dark theme */
.choices__list--dropdown .choices__item--selectable {
  background-color: transparent;
  color: #d0d0e8;
}

.choices__list--dropdown .choices__item--selectable:hover {
  background-color: #d0d0e8;
  color: #0a0e27;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: #d0d0e8;
  color: #0a0e27;
}

/* Custom scrollbar for dropdown */
.choices__list--dropdown::-webkit-scrollbar {
  width: 6px;
}

.choices__list--dropdown::-webkit-scrollbar-track {
  background: #2a2f4a;
  border-radius: 3px;
}

.choices__list--dropdown::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.choices__list--dropdown::-webkit-scrollbar-thumb:hover {
  background: #5a6fd8;
}

/* Additional dark theme overrides */
.choices__list--dropdown .choices__item--selectable.is-selected {
  background-color: #d0d0e8;
  color: #0a0e27;
}

.choices__list--dropdown .choices__item--selectable.is-active {
  background-color: #d0d0e8;
  color: #0a0e27;
}

/* Coin logo styling */
.choice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.coin-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

/* Ensure choice items in dropdown show icons */
.choices__list--dropdown .choice-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.choices__list--single .choice-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Force display of coin logos */
.choices__list--dropdown .coin-logo,
.choices__list--single .coin-logo {
  display: inline-block !important;
  width: 20px !important;
  height: 20px !important;
  margin-right: 8px !important;
}

/* Debug styling to make sure items are visible */
.choices__list--dropdown .choices__item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Ensure HTML content in choices is rendered properly */
.choices__list--dropdown .choices__item img,
.choices__list--single .choices__item img {
  display: inline-block !important;
  vertical-align: middle !important;
}

.choices__list--dropdown .choices__item {
  padding: 8px 16px;
}

/* Mobile responsive for choices */
@media (max-width: 768px) {
  .choices {
    min-width: 100%;
  }
}
