/**
 * Currency Selector Component Styles
 * Handles styling for the currency selection dropdown
 */

.currency-selector-wrapper {
  position: relative;
  display: inline-block;
}

.currency-selector-current {
  display: inline-block;
}

.currency-selector-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.currency-selector-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.currency-selector-btn .currency-code {
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.currency-selector-btn i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.currency-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 320px;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  min-width: 280px;
}

.currency-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.currency-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.close-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #333;
}

.currency-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.currency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #333;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
}

.currency-item:hover {
  background-color: #f5f5f5;
}

.currency-item.active {
  background-color: #f0f7ff;
  color: #0066cc;
  font-weight: 500;
}

.currency-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.currency-symbol {
  font-size: 1.2rem;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  color: inherit;
}

.currency-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.currency-code {
  font-weight: 600;
  font-size: 0.9rem;
}

.currency-name {
  font-size: 0.8rem;
  color: #999;
}

.currency-item.active .currency-name {
  color: #0066cc;
}

.currency-item i {
  font-size: 1.1rem;
  color: #0066cc;
  margin-left: auto;
  margin-right: 0;
}

/* Scrollbar styling for currency list */
.currency-list::-webkit-scrollbar {
  width: 6px;
}

.currency-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.currency-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.currency-list::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .currency-selector-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .currency-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    max-width: none;
    min-width: auto;
    border-radius: 12px 12px 0 0;
    border: none;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  }

  .currency-dropdown.open {
    transform: translateY(0);
  }

  .currency-list {
    max-height: 60vh;
  }

  .currency-item {
    padding: 1rem;
    font-size: 1rem;
  }

  .currency-symbol {
    font-size: 1.4rem;
  }
}

/* Accessibility improvements */
.currency-item:focus {
  outline: 2px solid #0066cc;
  outline-offset: -2px;
}

.currency-selector-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .currency-dropdown {
    background: #2a2a2a;
    border-color: #444;
  }

  .currency-dropdown-header {
    color: #fff;
    border-bottom-color: #444;
  }

  .currency-item {
    color: #e0e0e0;
  }

  .currency-item:hover {
    background-color: #3a3a3a;
  }

  .currency-item.active {
    background-color: #1a3a4a;
    color: #4aa4ff;
  }

  .currency-name {
    color: #999;
  }

  .currency-item.active .currency-name {
    color: #4aa4ff;
  }

  .close-btn {
    color: #666;
  }

  .close-btn:hover {
    color: #e0e0e0;
  }

  .currency-list::-webkit-scrollbar-track {
    background: #3a3a3a;
  }

  .currency-list::-webkit-scrollbar-thumb {
    background: #555;
  }

  .currency-list::-webkit-scrollbar-thumb:hover {
    background: #777;
  }
}
