/* ===== Live Rates — USD & Crypto ===== */

.live-rates-section {
  padding-top: 48px;
  padding-bottom: 56px;
  position: relative;
  overflow: hidden;
}

.live-rates-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(0, 240, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.live-rates-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
  animation: live-pulse-beat 1.6s ease-in-out infinite;
}

@keyframes live-pulse-beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.live-rates-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.live-rates-updated {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: monospace;
}

.live-rates-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}

.live-rates-refresh:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.live-rates-refresh.spinning svg {
  animation: rates-spin 0.8s linear infinite;
}

@keyframes rates-spin {
  to { transform: rotate(360deg); }
}

.live-rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.live-rate-card {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius-lg, 16px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.live-rate-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(168, 85, 247, 0.15), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.live-rate-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(0, 240, 255, 0.08);
}

.live-rate-card:hover::before {
  opacity: 1;
}

.live-rate-card--featured {
  grid-column: span 1;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(168, 85, 247, 0.06));
  border-color: rgba(0, 240, 255, 0.18);
}

.live-rate-card--featured::before {
  opacity: 0.6;
}

.live-rate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.live-rate-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-rate-icon--usd { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.live-rate-icon--btc { color: #f7931a; background: rgba(247, 147, 26, 0.12); }
.live-rate-icon--eth { color: #627eea; background: rgba(98, 126, 234, 0.12); }
.live-rate-icon--usdt { color: #26a17b; background: rgba(38, 161, 123, 0.12); }
.live-rate-icon--bnb { color: #f3ba2f; background: rgba(243, 186, 47, 0.12); }
.live-rate-icon--sol { color: #9945ff; background: rgba(153, 69, 255, 0.12); }
.live-rate-icon--ton { color: #0098ea; background: rgba(0, 152, 234, 0.12); }

.live-rate-symbol {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.live-rate-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.live-rate-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  word-break: break-word;
}

.live-rate-price small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.live-rate-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
}

.live-rate-change.up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.live-rate-change.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.live-rate-change.neutral {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.live-rate-source {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.live-rates-skeleton .live-rate-card {
  min-height: 120px;
  animation: rates-shimmer 1.4s ease-in-out infinite;
}

@keyframes rates-shimmer {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.live-rates-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

[data-theme="light"] .live-rate-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .live-rate-card--featured {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(168, 85, 247, 0.04));
}

@media (min-width: 900px) {
  .live-rates-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .live-rate-card--featured {
    grid-column: span 2;
  }

  .live-rate-card--featured .live-rate-price {
    font-size: 1.45rem;
  }
}

@media (max-width: 480px) {
  .live-rates-grid {
    grid-template-columns: 1fr 1fr;
  }

  .live-rate-card--featured {
    grid-column: span 2;
  }
}
