.currency-selector {
  position: relative;
  z-index: 1200;
  flex: 0 0 auto;
  font-family: 'Poppins', sans-serif;
}

.currency-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 96px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(128, 173, 224, 0.22);
  border-radius: 999px;
  color: #dcecff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)), rgba(9, 18, 38, 0.94);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.currency-select-trigger:hover,
.currency-selector.is-open .currency-select-trigger {
  border-color: rgba(42, 218, 255, 0.52);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 47, 247, 0.16));
  box-shadow: 0 11px 28px rgba(0, 212, 255, 0.15);
}

.currency-select-trigger:focus-visible,
.currency-option:focus-visible {
  outline: 2px solid #2bdcff;
  outline-offset: 2px;
}

.currency-current-flag,
.currency-option-flag {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
}

.currency-current-code {
  font: 800 0.72rem/1 'Orbitron', sans-serif;
  letter-spacing: 0.05em;
}

.currency-select-trigger > i {
  color: #8094ad;
  font-size: 0.62rem;
  transition: transform 180ms ease;
}

.currency-selector.is-open .currency-select-trigger > i {
  transform: rotate(180deg);
}

.currency-selector[data-rate-status='loading'] .currency-select-trigger::after,
.currency-selector[data-rate-status='error'] .currency-select-trigger::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.currency-selector[data-rate-status='loading'] .currency-select-trigger::after {
  background: #f8bc58;
  box-shadow: 0 0 10px rgba(248, 188, 88, 0.6);
  animation: currency-status-pulse 1s ease-in-out infinite;
}

.currency-selector[data-rate-status='error'] .currency-select-trigger::after {
  background: #ff527b;
  box-shadow: 0 0 10px rgba(255, 82, 123, 0.55);
}

@keyframes currency-status-pulse {
  50% { opacity: 0.35; }
}

.currency-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  padding: 9px;
  border: 1px solid rgba(68, 219, 255, 0.24);
  border-radius: 16px;
  background: radial-gradient(circle at 100% 0%, rgba(117, 64, 255, 0.18), transparent 42%), rgba(8, 17, 36, 0.98);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.48), 0 0 26px rgba(0, 212, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 170ms ease, visibility 170ms ease, transform 170ms cubic-bezier(0.16, 1, 0.3, 1);
}

.currency-selector.is-open .currency-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.currency-menu-header {
  display: block;
  padding: 7px 9px 9px;
  color: #78dff5;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.currency-option {
  display: grid;
  grid-template-columns: 28px 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 45px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #a9bbcf;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.currency-option:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.currency-option.is-active {
  color: #ffffff;
  border-color: rgba(44, 219, 255, 0.22);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.12), rgba(123, 47, 247, 0.1));
}

.currency-option-code {
  color: #ecf6ff;
  font: 800 0.67rem/1 'Orbitron', sans-serif;
}

.currency-option-name {
  font-size: 0.7rem;
  font-weight: 600;
}

.currency-option i {
  color: #31e1ff;
  font-size: 0.68rem;
  opacity: 0;
}

.currency-option.is-active i {
  opacity: 1;
}

@media (max-width: 760px) {
  .currency-select-trigger {
    gap: 5px;
    min-width: 66px;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 12px;
  }

  .currency-current-flag { font-size: 0.84rem; }
  .currency-current-code { font-size: 0.57rem; }
  .currency-select-trigger > i { font-size: 0.5rem; }

  .currency-menu {
    position: fixed;
    top: 64px;
    right: 10px;
    width: min(250px, calc(100vw - 20px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .currency-select-trigger,
  .currency-select-trigger > i,
  .currency-menu {
    transition: none;
  }
}
