:root {
  --bg-base: #09090E;
  --bg-card: rgba(255, 255, 255, 0.04);
  --accent-primary: #00F5C8;
  --accent-secondary: #6C63FF;
  --text-primary: #E8EAF0;
  --text-muted: #5A5F7A;
  --border-glow: rgba(0, 245, 200, 0.15);
  --danger: #FF4D6D;
  --success: #00F5C8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.bg-mesh {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(0, 61, 53, 0.3), transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(26, 14, 58, 0.4), transparent 50%);
  animation: meshShift 12s infinite alternate ease-in-out;
  z-index: -1;
}

@keyframes meshShift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-10%, 10%) scale(1.1);
  }
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 245, 200, 0.12);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 0 60px rgba(0, 245, 200, 0.06), 0 24px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  transition: all 0.2s ease;
}

.glass-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 60px rgba(0, 245, 200, 0.1), 0 24px 48px rgba(0, 0, 0, 0.6);
}

.header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.header-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-primary);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.input-group {
  animation: slideUpFade 0.6s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

.input-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border-bottom: 2px solid rgba(0, 245, 200, 0.3);
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-bottom: 2px solid var(--accent-primary);
  box-shadow: 0 4px 20px rgba(0, 245, 200, 0.15);
}

.currency-symbol {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.8rem;
  color: var(--text-primary);
  margin-right: 8px;
}

input[type="number"] {
  width: 100%;
  background: transparent;
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.8rem;
  color: var(--text-primary);
  padding: 16px 0;
  outline: none;
  min-width: 0;
}

input[type="number"]::placeholder {
  color: #3A3F55;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

.currency-selectors {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUpFade 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.input-group.half {
  flex: 1;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.select-wrapper:hover {
  border-color: rgba(0, 245, 200, 0.3);
  transform: translateY(-1px);
}

select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 14px 40px 14px 16px;
  outline: none;
  cursor: pointer;
}

select option {
  background: var(--bg-base);
  color: var(--text-primary);
  font-weight: 500;
}

.dropdown-icon {
  position: absolute;
  right: 14px;
  pointer-events: none;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.select-wrapper:focus-within .dropdown-icon {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.switch-btn-container {
  display: flex;
  justify-content: center;
  z-index: 2;
}

.icon-btn {
  background: rgba(0, 245, 200, 0.1);
  border: 1px solid rgba(0, 245, 200, 0.3);
  color: var(--accent-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(0, 245, 200, 0.2);
  transform: scale(1.08);
}

.icon-btn:active {
  transform: rotate(180deg) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.primary-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: slideUpFade 0.6s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  letter-spacing: 0.05em;
}

.primary-btn:hover {
  background: rgba(0, 245, 200, 0.1);
  border-color: rgba(0, 245, 200, 0.3);
  color: var(--accent-primary);
}

.result-box {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--accent-primary);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-box.hidden {
  display: none;
}

.result-box.show-anim {
  animation: resultPulse 1s ease-out;
}

@keyframes resultPulse {
  0% {
    box-shadow: inset 0 0 0 rgba(0, 245, 200, 0);
  }

  20% {
    box-shadow: inset 0 0 20px rgba(0, 245, 200, 0.15);
  }

  100% {
    box-shadow: inset 0 0 0 rgba(0, 245, 200, 0);
  }
}

.result-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent-primary);
  word-break: break-all;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 245, 200, 0.4);
}

.result-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.popular-pairs {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  animation: slideUpFade 0.6s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  z-index: 10;
}

.pair-chip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pair-chip:hover {
  background: rgba(0, 245, 200, 0.06);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .glass-panel {
    max-width: 100%;
    padding: 24px 20px;
  }

  .currency-symbol,
  input[type="number"] {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }

  .result-value {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .popular-pairs {
    flex-wrap: wrap;
    justify-content: center;
  }
}