/* =======================
   New Currency Cards for Rates Section
   ======================= */

/* Segmented Control */
.segmented-control {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
}

.segmented-control button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.segmented-control button:hover {
  background: color-mix(in srgb, var(--primary-500) 10%, transparent);
}

.segmented-control button.active {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-500) 90%, var(--card)) 0%,
    color-mix(in srgb, var(--primary-600) 95%, transparent) 100%);
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-600) 25%, transparent);
}

/* Amount Input */
.amount-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
}

.amount-input input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  outline: none;
}

.amount-input .currency {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* Country Select (ui-select component) */
.ui-select {
  position: relative;
  margin-bottom: 16px;
}

.ui-select__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.ui-select__btn:hover {
  border-color: var(--primary-500);
}

.ui-select__btn.active {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500) 10%, transparent);
}

.ui-select__label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 8px;
}

.ui-select__arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.2s;
  margin-left: auto;
}

.ui-select__btn.active .ui-select__arrow {
  transform: rotate(180deg);
}

.ui-select__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 15%, transparent);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.ui-select__panel.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ui-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.ui-option:hover {
  background: color-mix(in srgb, var(--primary-500) 10%, transparent);
}

.ui-option.selected {
  background: color-mix(in srgb, var(--primary-500) 15%, transparent);
  color: var(--primary-600);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

/* Hint */
.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  padding: 12px;
  background: color-mix(in srgb, var(--primary-500) 5%, transparent);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary-600) 15%, transparent);
}

/* Rates currency cards grid */
.rates-currency-cards {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

/* Individual currency card */
.rates-currency-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.rates-currency-card:hover {
  border-color: color-mix(in srgb, var(--primary-600) 40%, transparent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-600) 15%, transparent);
}

/* Card header with icon and currency info */
.rates-card-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rates-currency-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-500) 20%, var(--card)) 0%,
    color-mix(in srgb, var(--primary-600) 15%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--primary-600) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.rates-currency-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.rates-currency-info {
  flex: 1;
  min-width: 0;
}

.rates-currency-code {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: var(--text);
}

.rates-currency-pair {
  font-size: 12px;
  color: var(--muted);
}

/* Rate display section */
.rates-rate-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rates-rate-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.rates-rate-unit {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}

.rates-rate-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-500) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-600) 25%, transparent);
  color: var(--primary-600);
  font-weight: 600;
}

/* Card details section */
.rates-card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rates-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.rates-detail-label {
  color: var(--muted);
}

.rates-detail-value {
  font-weight: 600;
  color: var(--text);
}

.rates-warning-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red, #ef4444) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--red, #ef4444) 25%, transparent);
  color: var(--red, #ef4444);
  margin-left: 6px;
}

/* Tiers container and cards */
.rates-tiers-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rates-tier-card {
  background: color-mix(in srgb, var(--primary-500) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-600) 15%, transparent);
  border-radius: 10px;
  padding: 12px;
  transition: all 0.2s;
}

.rates-tier-card:hover {
  background: color-mix(in srgb, var(--primary-500) 8%, transparent);
  border-color: color-mix(in srgb, var(--primary-600) 25%, transparent);
}

.rates-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary-600) 15%, transparent);
}

.rates-tier-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rates-tier-range {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 3px 10px;
  background: var(--card);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.rates-tier-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rates-detail-row--highlight {
  background: color-mix(in srgb, var(--primary-500) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-600) 20%, transparent);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}

.rates-detail-value--highlight {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-600);
}

/* Utility class for margin-top */
.mt-3 {
  margin-top: 12px;
}
