/* ============================================
   Bridge (Multicadena)
   ============================================ */

.bridge-networks {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.network-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.network-chip:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.network-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.network-dot.tron { background: linear-gradient(135deg, #ff060a, #b80506); }
.network-dot.eth { background: linear-gradient(135deg, #8a92b2, #627eea 60%, #3c5dc9); }
.network-dot.bsc { background: linear-gradient(135deg, #f0b90b, #c29000); color: #1a1a2e; }
.network-dot.sol { background: linear-gradient(135deg, #14f195, #9945ff); }
.network-dot.btc { background: linear-gradient(135deg, #f7931a, #c47410); }

.network-chip.active {
  background: rgba(96, 165, 250, 0.12);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.bridge-swap-card {
  max-width: 520px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.04), rgba(167, 139, 250, 0.03));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px;
  position: relative;
}

.bridge-row {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.bridge-row:hover {
  border-color: var(--border-glow);
}

.bridge-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.bridge-row-header .balance {
  color: var(--text-muted);
  font-size: 12px;
}

.bridge-row-header .balance strong {
  color: var(--text-secondary);
}

.bridge-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bridge-token-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
  transition: all 0.2s;
  min-width: 160px;
}

.bridge-token-select:hover {
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.07);
}

.bridge-token-select .chev {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  transition: transform 0.2s;
  margin-left: auto;
}

.bridge-token-select.open .chev {
  transform: rotate(180deg);
}

.bridge-amount {
  background: transparent;
  border: none;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  width: 100%;
  outline: none;
  font-family: inherit;
  min-width: 0;
  padding: 0;
}

.bridge-amount::placeholder {
  color: var(--text-muted);
}

.bridge-amount:read-only {
  color: var(--accent-blue);
  cursor: default;
}

.swap-flip-btn {
  align-self: center;
  margin: -10px auto;
  width: 40px;
  height: 40px;
  background: var(--gradient-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 4px solid var(--bg-primary);
  font-size: 18px;
  font-weight: 700;
  color: var(--bg-primary);
  z-index: 2;
  transition: transform 0.3s;
  position: relative;
}

.swap-flip-btn:hover {
  transform: rotate(180deg);
}

.swap-flip-btn svg {
  width: 18px;
  height: 18px;
}

.token-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
  display: none;
}

.bridge-token-select.open .token-dropdown {
  display: block;
}

.token-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.token-option:hover {
  background: var(--bg-card-hover);
}

.token-option .network-dot {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.token-option-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.bridge-details {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bridge-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.bridge-detail-row .value {
  color: var(--text-secondary);
  font-weight: 600;
}

.bridge-detail-row .value.green {
  color: var(--accent-green);
}

.bridge-action {
  width: 100%;
  margin-top: 16px;
}

.popular-routes {
  margin-top: 64px;
}

.popular-routes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.popular-routes-header h3 {
  font-size: 22px;
  font-weight: 700;
}

.popular-routes-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all 0.2s;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.route-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.route-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.route-pair .arrow {
  color: var(--accent-blue);
  font-size: 14px;
}

.route-pair .network-dot {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.route-pair .token-symbol {
  color: var(--text-primary);
}

.route-pair .chain-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  margin-left: -4px;
}

.route-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.route-meta .fee {
  color: var(--accent-green);
  font-weight: 600;
}

.bridge-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 32px;
  padding: 18px 22px;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius-md);
}

.bridge-info-banner .icon {
  font-size: 22px;
  flex-shrink: 0;
}

.bridge-info-banner .info-title {
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.bridge-info-banner .info-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 568px) {
  .bridge-amount {
    font-size: 22px;
  }

  .bridge-token-select {
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }

  .bridge-swap-card {
    padding: 14px;
  }
}

/* ============================================ */
/* Wallet status bar (above the swap card)     */
/* ============================================ */

.wallet-status {
  max-width: 480px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.wallet-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 999px;
  color: #c7d2fe;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wallet-connect-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.wallet-connected {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: center;
}

.wallet-network-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.wallet-network-badge.net-tron     { background: linear-gradient(135deg, #ff060a, #c00007); }
.wallet-network-badge.net-ethereum { background: linear-gradient(135deg, #627eea, #3c5fc4); }
.wallet-network-badge.net-bsc      { background: linear-gradient(135deg, #f3ba2f, #d49d10); color: #1a1a1a; }
.wallet-network-badge.net-solana   { background: linear-gradient(135deg, #14f195, #9945ff); }

.wallet-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d4d4d8;
  font-size: 13px;
}

.wallet-balance {
  color: #fbbf24;
  font-weight: 600;
  font-size: 13px;
}

.wallet-disconnect-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.wallet-disconnect-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
}

/* ============================================ */
/* Wallet picker modal                          */
/* ============================================ */

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-modal[hidden] { display: none; }

.wallet-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wallet-modal-content {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  background: linear-gradient(180deg, #1a1b2e 0%, #0f1024 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

.wallet-modal-content h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #f4f4f5;
  text-align: center;
}

.wallet-modal-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: #a1a1aa;
  text-align: center;
}

.wallet-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: 0;
  color: #a1a1aa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.18s ease;
}
.wallet-modal-close:hover { color: #f4f4f5; background: rgba(255,255,255,0.06); }

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #f4f4f5;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}
.wallet-option:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateX(2px);
}

.wallet-option-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
}

.wallet-option-name {
  flex: 1;
}

.wallet-option-arrow {
  color: #a1a1aa;
  font-size: 16px;
}

.wallet-empty, .wallet-connecting, .wallet-error {
  padding: 20px 16px;
  text-align: center;
  color: #d4d4d8;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  line-height: 1.5;
}

.wallet-error {
  color: #fca5a5;
}

.wallet-retry-btn {
  margin-top: 8px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================ */
/* Connected state — primary action button      */
/* ============================================ */

.btn-primary.bridge-action.connected {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}
.btn-primary.bridge-action.connected:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

/* ============================================ */
/* Mobile adjustments                           */
/* ============================================ */

@media (max-width: 600px) {
  .wallet-status { margin-bottom: 14px; }
  .wallet-connected {
    gap: 8px;
    padding: 6px 6px 6px 12px;
    font-size: 12px;
  }
  .wallet-modal-content { padding: 24px 18px 18px; }
}

/* ============================================ */
/* Live price status indicator                  */
/* ============================================ */

.price-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.price-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.price-dot.live {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse-live 2s ease-out infinite;
}

.price-dot.offline {
  background: #f59e0b;
}

.price-status.live {
  color: #4ade80;
}

.price-status.offline {
  color: #fbbf24;
}

@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ============================================ */
/* Network chips — interactive                  */
/* ============================================ */

.network-chip {
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.network-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.network-chip:active {
  transform: translateY(0);
}

/* Active state when a network is currently the "from" token */
.network-chip.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ============================================ */
/* Network chips — hint text                     */
/* ============================================ */

.bridge-networks-hint {
  margin: 12px auto 0;
  max-width: 480px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.bridge-networks-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #d4d4d8;
  margin: 0 2px;
}
