/* ARC AI Agents - Estilos customizados */

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.7); }
}

@keyframes thinking {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Tab content transitions */
.tab-content {
  animation: fadeIn 0.3s ease;
}

/* Tab buttons */
.tab-btn.active {
  color: #a78bfa;
  border-color: #7c3aed;
}

/* Cards de estatística */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Step cards */
.step-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(31, 41, 55, 0.6));
  transition: border-color 0.2s ease;
}

.step-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

/* Status badges */
.status-draft { background: rgba(75, 85, 99, 0.4); color: #9ca3af; border: 1px solid rgba(75, 85, 99, 0.5); }
.status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-completed { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.status-disputed { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.status-cancelled { background: rgba(107, 114, 128, 0.15); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.4); }

/* Payment status */
.pay-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.4); }
.pay-executed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.pay-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.pay-analyzing { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }

/* Agent status */
.agent-idle { color: #34d399; }
.agent-thinking { color: #a78bfa; animation: thinking 1s ease infinite; }
.agent-executing { color: #60a5fa; }
.agent-error { color: #f87171; }

/* Milestone progress bar */
.milestone-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(75, 85, 99, 0.5);
  overflow: hidden;
}

.milestone-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  transition: width 0.5s ease;
}

/* Risk level indicators */
.risk-low { color: #34d399; }
.risk-medium { color: #fbbf24; }
.risk-high { color: #f97316; }
.risk-critical { color: #f87171; }

/* Code blocks */
pre code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
}

/* Scrollbar customizado */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.8);
}

/* Toast notification */
#toast {
  transition: all 0.3s ease;
}

/* Glow effect para agentes ativos */
.agent-glow {
  animation: pulse-glow 2s ease infinite;
}

/* Contract card hover */
.contract-card {
  transition: all 0.2s ease;
}

.contract-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   WALLET STYLES
   ============================================================ */

/* Botão conectar com pulso */
.wallet-connect-pulse {
  position: relative;
  overflow: hidden;
}

.wallet-connect-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(139, 92, 246, 0.4);
  animation: wallet-ring 2s ease-out infinite;
  pointer-events: none;
}

@keyframes wallet-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Modal de wallet */
.animate-modal-in {
  animation: modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Botão de provedor com hover */
.wallet-provider-btn {
  transition: all 0.2s ease;
}

.wallet-provider-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

/* Wallet info no header */
#wallet-info {
  transition: all 0.2s ease;
}

#wallet-info:hover {
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4);
}

/* Avatar da wallet */
#wallet-avatar {
  font-size: 10px;
  letter-spacing: -0.5px;
}

/* Indicador de rede no header */
#wallet-network-display {
  cursor: default;
}

/* Painel de wallet */
#wallet-panel {
  min-height: 80px;
}

/* Responsive */
@media (max-width: 640px) {
  .tab-btn {
    padding: 12px 12px;
    font-size: 12px;
  }

  .tab-btn span {
    display: none;
  }
}


/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.7); }
}

@keyframes thinking {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Tab content transitions */
.tab-content {
  animation: fadeIn 0.3s ease;
}

/* Tab buttons */
.tab-btn.active {
  color: #a78bfa;
  border-color: #7c3aed;
}

/* Cards de estatística */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Step cards */
.step-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(31, 41, 55, 0.6));
  transition: border-color 0.2s ease;
}

.step-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

/* Status badges */
.status-draft { background: rgba(75, 85, 99, 0.4); color: #9ca3af; border: 1px solid rgba(75, 85, 99, 0.5); }
.status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-completed { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.status-disputed { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.status-cancelled { background: rgba(107, 114, 128, 0.15); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.4); }

/* Payment status */
.pay-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.4); }
.pay-executed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.pay-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.pay-analyzing { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }

/* Agent status */
.agent-idle { color: #34d399; }
.agent-thinking { color: #a78bfa; animation: thinking 1s ease infinite; }
.agent-executing { color: #60a5fa; }
.agent-error { color: #f87171; }

/* Milestone progress bar */
.milestone-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(75, 85, 99, 0.5);
  overflow: hidden;
}

.milestone-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  transition: width 0.5s ease;
}

/* Risk level indicators */
.risk-low { color: #34d399; }
.risk-medium { color: #fbbf24; }
.risk-high { color: #f97316; }
.risk-critical { color: #f87171; }

/* Code blocks */
pre code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
}

/* Scrollbar customizado */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.8);
}

/* Toast notification */
#toast {
  transition: all 0.3s ease;
}

/* Glow effect para agentes ativos */
.agent-glow {
  animation: pulse-glow 2s ease infinite;
}

/* Contract card hover */
.contract-card {
  transition: all 0.2s ease;
}

.contract-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
  .tab-btn {
    padding: 12px 12px;
    font-size: 12px;
  }

  .tab-btn span {
    display: none;
  }
}

/* ── Settings & Profile modals ── */
.settings-tab {
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

/* Toggle switch (peer-checked requires Tailwind JIT — force via CSS) */
input[type="checkbox"].sr-only:checked + div {
  background-color: #7c3aed;
}
input[type="checkbox"].sr-only:checked + div + div,
input[type="checkbox"].sr-only:checked ~ div > div {
  transform: translateX(1.25rem);
}

/* Peer checkbox workaround for CDN Tailwind */
.peer:checked ~ .peer-checked\:bg-purple-600 { background-color: #7c3aed !important; }
.peer:checked ~ .peer-checked\:translate-x-5 { transform: translateX(1.25rem) !important; }

/* ── Swap Steps Panel ── */
.swap-step { transition: all 0.2s ease; }

.swap-step-active .swap-step-icon {
  border-color: #a855f7;
  background: rgba(168,85,247,0.15);
  animation: swapStepPulse 1.2s ease-in-out infinite;
}
.swap-step-active .swap-step-icon i { color: #a855f7; }
.swap-step-active { color: #e2e8f0 !important; }

.swap-step-done .swap-step-icon {
  border-color: #22c55e;
  background: rgba(34,197,94,0.12);
}
.swap-step-done .swap-step-icon i { color: #22c55e; }
.swap-step-done .swap-step-icon i::before { content: "\f00c"; } /* fa-check */
.swap-step-done { color: #86efac !important; }

.swap-step-error .swap-step-icon {
  border-color: #ef4444;
  background: rgba(239,68,68,0.12);
}
.swap-step-error .swap-step-icon i { color: #ef4444; }
.swap-step-error .swap-step-icon i::before { content: "\f00d"; } /* fa-times */
.swap-step-error { color: #fca5a5 !important; }

@keyframes swapStepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(168,85,247,0); }
}

/* ── Chatbot compacto ── */
#chat-widget {
  width: 300px !important;
  max-width: calc(100vw - 20px) !important;
}
#chat-messages {
  scrollbar-width: thin;
  scrollbar-color: #4c1d95 #111827;
}
#chat-messages::-webkit-scrollbar { width: 3px; }
#chat-messages::-webkit-scrollbar-track { background: #111827; }
#chat-messages::-webkit-scrollbar-thumb { background: #4c1d95; border-radius: 4px; }

/* ── Payment Steps Panel ── */
.pay-step {
  color: #4b5563;
  transition: all 0.2s ease;
}

.pay-step-icon {
  border: 1.5px solid #374151;
  background: rgba(31,41,55,0.6);
  flex-shrink: 0;
}

.pay-step.pay-step-idle .pay-step-icon i { color: #4b5563; }
.pay-step.pay-step-idle { color: #6b7280; }

.pay-step.pay-step-active .pay-step-icon {
  border-color: #06b6d4;
  background: rgba(6,182,212,0.15);
  animation: payStepPulse 1.2s ease-in-out infinite;
}
.pay-step.pay-step-active .pay-step-icon i { color: #06b6d4; }
.pay-step.pay-step-active { color: #e2e8f0; }

.pay-step.pay-step-done .pay-step-icon {
  border-color: #22c55e;
  background: rgba(34,197,94,0.12);
}
.pay-step.pay-step-done .pay-step-icon i { color: #22c55e; }
.pay-step.pay-step-done .pay-step-icon i::before { content: "\f00c"; }
.pay-step.pay-step-done { color: #86efac; }

.pay-step.pay-step-error .pay-step-icon {
  border-color: #ef4444;
  background: rgba(239,68,68,0.12);
}
.pay-step.pay-step-error .pay-step-icon i { color: #ef4444; }
.pay-step.pay-step-error .pay-step-icon i::before { content: "\f00d"; }
.pay-step.pay-step-error { color: #fca5a5; }

@keyframes payStepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(6,182,212,0); }
}

/* ── Receipt Card ── */
.pay-receipt-card {
  background: linear-gradient(135deg, rgba(6,78,59,0.15), rgba(17,24,39,0.8));
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 1rem;
  padding: 1.25rem;
  animation: fadeIn 0.3s ease;
}

/* ── Details/Summary for batch panel ── */
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .fa-chevron-down { transform: rotate(180deg); }
details > summary .fa-chevron-down { transition: transform 0.2s ease; }

/* ── Contract Step Panel (ct-step-*) ── */
.ct-step {
  color: #4b5563;
  transition: all 0.2s ease;
}
.ct-step-icon {
  border: 1.5px solid #374151;
  background: rgba(31,41,55,0.6);
  flex-shrink: 0;
}
.ct-step.ct-step-idle .ct-step-icon i { color: #4b5563; }
.ct-step.ct-step-idle { color: #6b7280; }

.ct-step.ct-step-active .ct-step-icon {
  border-color: #22c55e;
  background: rgba(34,197,94,0.15);
  animation: ctStepPulse 1.2s ease-in-out infinite;
}
.ct-step.ct-step-active .ct-step-icon i { color: #22c55e; }
.ct-step.ct-step-active { color: #e2e8f0; }

.ct-step.ct-step-done .ct-step-icon {
  border-color: #22c55e;
  background: rgba(34,197,94,0.12);
}
.ct-step.ct-step-done .ct-step-icon i { color: #22c55e; }
.ct-step.ct-step-done .ct-step-icon i::before { content: "\f00c"; }
.ct-step.ct-step-done { color: #86efac; }

.ct-step.ct-step-error .ct-step-icon {
  border-color: #ef4444;
  background: rgba(239,68,68,0.12);
}
.ct-step.ct-step-error .ct-step-icon i { color: #ef4444; }
.ct-step.ct-step-error .ct-step-icon i::before { content: "\f00d"; }
.ct-step.ct-step-error { color: #fca5a5; }

@keyframes ctStepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ── Contract Receipt Panel (inside card) ── */
.ct-receipt-panel {
  background: linear-gradient(135deg, rgba(6,78,59,0.12), rgba(17,24,39,0.7));
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  animation: fadeIn 0.35s ease;
}

.ct-receipt-icon {
  width: 22px;
  height: 22px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ct-receipt-title {
  display: flex;
  align-items: center;
}

.ct-receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ct-receipt-label {
  font-size: 11px;
  color: #6b7280;
  flex-shrink: 0;
  width: 80px;
}

.ct-receipt-addr {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

/* Receipt action buttons */
.ct-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.ct-receipt-btn-view {
  background: rgba(31,41,55,0.8);
  border-color: rgba(34,197,94,0.3);
  color: #d1d5db;
}
.ct-receipt-btn-view:hover { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.6); }

.ct-receipt-btn-dl {
  background: rgba(31,41,55,0.8);
  border-color: rgba(34,197,94,0.3);
  color: #d1d5db;
}
.ct-receipt-btn-dl:hover { background: rgba(6,182,212,0.1); border-color: rgba(6,182,212,0.4); }

.ct-receipt-btn-pdf {
  background: rgba(31,41,55,0.8);
  border-color: rgba(34,197,94,0.3);
  color: #d1d5db;
}
.ct-receipt-btn-pdf:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); }

.ct-receipt-btn-ext {
  background: rgba(30,58,138,0.2);
  border-color: rgba(59,130,246,0.3);
  color: #60a5fa;
}
.ct-receipt-btn-ext:hover { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.6); }

/* ── Contract Receipt Modal ── */
#ct-receipt-modal .animate-modal-in {
  animation: modal-in 0.25s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* ═══════════════════════════════════════════════════════════════
   ARC DEX — AMM Liquidity Pool Styles
   Arc Testnet · x*y=k · 0.3% fee
   ═══════════════════════════════════════════════════════════════ */

/* ── DEX Stat Cards ── */
.dex-stat-card {
  background: linear-gradient(135deg, rgba(17,24,39,0.8), rgba(31,41,55,0.6));
  border: 1px solid rgba(75,85,99,0.4);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s ease;
}
.dex-stat-card:hover {
  border-color: rgba(6,182,212,0.3);
}

/* ── DEX Panel (glass card) ── */
.dex-panel {
  background: linear-gradient(135deg, rgba(17,24,39,0.85), rgba(31,41,55,0.7));
  border: 1px solid rgba(75,85,99,0.35);
  border-radius: 1.25rem;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease;
}
.dex-panel:hover {
  border-color: rgba(6,182,212,0.2);
}

/* ── DEX Card Header ── */
.dex-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(75,85,99,0.25);
}

/* ── Token Input Groups ── */
.dex-token-input-group {
  background: rgba(31,41,55,0.6);
  border: 1px solid rgba(75,85,99,0.4);
  border-radius: 0.875rem;
  padding: 0.75rem;
  transition: border-color 0.2s ease;
}
.dex-token-input-group:focus-within {
  border-color: rgba(6,182,212,0.5);
  background: rgba(8,47,73,0.3);
}

/* ── Token Selects ── */
.dex-token-select {
  background: rgba(17,24,39,0.9);
  border: 1px solid rgba(75,85,99,0.5);
  border-radius: 0.625rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 100px;
}
.dex-token-select:focus {
  border-color: rgba(6,182,212,0.6);
}

/* ── Amount Inputs ── */
.dex-amount-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  font-family: 'Courier New', monospace;
  min-width: 0;
  width: 100%;
}
.dex-amount-input::placeholder { color: rgba(107,114,128,0.6); }
.dex-amount-input::-webkit-inner-spin-button,
.dex-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dex-amount-input[type=number] { -moz-appearance: textfield; }

/* ── Quote Box ── */
.dex-quote-box {
  background: rgba(17,24,39,0.7);
  border: 1px solid rgba(75,85,99,0.3);
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  space-y: 0.375rem;
}

.dex-quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(75,85,99,0.15);
}
.dex-quote-row:last-child { border-bottom: none; }

/* ── Transaction Steps ── */
.dex-step {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0;
  color: #6b7280;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.dex-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(75,85,99,0.5);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.dex-step-idle .dex-step-dot { background: rgba(75,85,99,0.4); }
.dex-step-idle { color: #4b5563; }

.dex-step-active {
  color: #22d3ee;
  animation: dexStepPulseText 1.4s ease-in-out infinite;
}
.dex-step-active .dex-step-dot {
  background: #22d3ee;
  box-shadow: 0 0 0 0 rgba(34,211,238,0.4);
  animation: dexStepPulseDot 1.4s ease-in-out infinite;
}

.dex-step-done { color: #4ade80; }
.dex-step-done .dex-step-dot {
  background: #4ade80;
  box-shadow: 0 0 5px rgba(74,222,128,0.4);
}

.dex-step-error { color: #f87171; }
.dex-step-error .dex-step-dot {
  background: #f87171;
  box-shadow: 0 0 5px rgba(248,113,113,0.4);
}

@keyframes dexStepPulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(34,211,238,0); }
}
@keyframes dexStepPulseText {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ── Position Cards ── */
.dex-position-card {
  background: linear-gradient(135deg, rgba(17,24,39,0.8), rgba(31,41,55,0.5));
  border: 1px solid rgba(75,85,99,0.3);
  border-radius: 1rem;
  padding: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.dex-position-card:hover {
  border-color: rgba(139,92,246,0.4);
  transform: translateY(-1px);
}

.dex-pos-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 0.125rem 0;
}

/* ── Pool Table ── */
#dex-pools-table tr:hover td { background: rgba(6,182,212,0.04); }
#dex-pools-table td { transition: background 0.15s ease; }

/* ── Subtab active indicator ── */
.dex-subtab {
  position: relative;
  overflow: hidden;
}
.dex-subtab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: transparent;
  transition: all 0.2s ease;
  border-radius: 1px;
}
.dex-subtab.active::after,
.dex-subtab[class*="bg-cyan"]::after {
  left: 20%; right: 20%;
  background: rgba(34,211,238,0.6);
}

/* ── Network Badge ── */
#dex-network-badge {
  position: relative;
  overflow: hidden;
}
#dex-network-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(34,211,238,0.05) 50%, transparent 100%);
  animation: dexNetworkScan 4s ease-in-out infinite;
}
@keyframes dexNetworkScan {
  0%, 100% { transform: translateX(-100%); }
  50%       { transform: translateX(100%); }
}

/* ── Price impact indicators ── */
.dex-impact-low    { color: #4ade80; }
.dex-impact-medium { color: #facc15; }
.dex-impact-high   { color: #fb923c; }
.dex-impact-danger { color: #f87171; }

/* ── LP Token badge ── */
.dex-lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: linear-gradient(90deg, rgba(234,179,8,0.15), rgba(234,179,8,0.08));
  border: 1px solid rgba(234,179,8,0.25);
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fbbf24;
  font-family: 'Courier New', monospace;
}

/* ── Analytics Grid ── */
.dex-analytics-metric {
  background: rgba(31,41,55,0.5);
  border: 1px solid rgba(75,85,99,0.25);
  border-radius: 0.75rem;
  padding: 0.875rem;
  text-align: center;
  transition: all 0.2s ease;
}
.dex-analytics-metric:hover {
  border-color: rgba(6,182,212,0.3);
  background: rgba(8,47,73,0.25);
}

/* ── APR Badge ── */
.dex-apr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
}
.dex-apr-badge.high   { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.dex-apr-badge.medium { background: rgba(234,179,8,0.12); color: #fbbf24; border: 1px solid rgba(234,179,8,0.2); }
.dex-apr-badge.low    { background: rgba(6,182,212,0.1);  color: #22d3ee; border: 1px solid rgba(6,182,212,0.2); }

/* ── Swap Arrow Flip Animation ── */
.dex-flip-btn {
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.dex-flip-btn:active { transform: rotate(180deg) scale(0.9); }

/* ── Token Pair Icons ── */
.dex-token-pair {
  display: flex;
  align-items: center;
}
.dex-token-pair > span:first-child { z-index: 1; }
.dex-token-pair > span + span { margin-left: -6px; }

/* ── Glow effects for active pools ── */
.dex-pool-active-glow {
  box-shadow: 0 0 20px rgba(6,182,212,0.08), 0 0 40px rgba(6,182,212,0.04);
}

/* ── Receipt overlay ── */
#dex-receipt-modal,
#dex-lp-receipt-modal {
  animation: dexModalFadeIn 0.2s ease forwards;
}
@keyframes dexModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Dark scrollbar for DEX panels ── */
#dex-recent-swaps::-webkit-scrollbar,
#dex-positions-list::-webkit-scrollbar { width: 4px; }
#dex-recent-swaps::-webkit-scrollbar-track,
#dex-positions-list::-webkit-scrollbar-track { background: rgba(17,24,39,0.5); }
#dex-recent-swaps::-webkit-scrollbar-thumb,
#dex-positions-list::-webkit-scrollbar-thumb { background: rgba(75,85,99,0.5); border-radius: 2px; }

/* ── DEX loading skeleton ── */
.dex-skeleton {
  background: linear-gradient(90deg, rgba(31,41,55,0.5) 25%, rgba(55,65,81,0.5) 50%, rgba(31,41,55,0.5) 75%);
  background-size: 200% 100%;
  animation: dexSkeletonShimmer 1.5s infinite;
  border-radius: 0.5rem;
}
@keyframes dexSkeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Pool TVL bar ── */
.dex-tvl-bar {
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  transition: width 0.6s ease;
}

/* ── Info tooltip ── */
.dex-tooltip {
  position: relative;
  cursor: help;
}
.dex-tooltip::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17,24,39,0.95);
  border: 1px solid rgba(75,85,99,0.4);
  color: #d1d5db;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}
.dex-tooltip:hover::before { opacity: 1; }

/* ── "New Pool" badge ── */
.dex-new-pool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(90deg, rgba(139,92,246,0.2), rgba(59,130,246,0.15));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
}

/* ── Mobile responsive ── */
@media (max-width: 640px) {
  .dex-panel { padding: 1rem; }
  .dex-token-select { min-width: 80px; font-size: 0.75rem; }
  .dex-amount-input { font-size: 1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ESCROW WALLET MODULE — ARC Testnet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Escrow Card ─────────────────────────────────────────────────────────── */
.escrow-card {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.escrow-card:hover {
  box-shadow: 0 4px 24px rgba(6, 182, 212, 0.12);
  transform: translateY(-1px);
}

/* ─── Stat Card ───────────────────────────────────────────────────────────── */
.escrow-stat-card {
  transition: box-shadow 0.2s;
}
.escrow-stat-card:hover {
  box-shadow: 0 2px 16px rgba(6, 182, 212, 0.08);
}

/* ─── Progress Track ─────────────────────────────────────────────────────── */
.escrow-progress-track {
  background: rgba(75, 85, 99, 0.4);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.escrow-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0891b2, #06b6d4, #67e8f9);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  min-width: 0;
}

.escrow-progress-track-lg {
  background: rgba(75, 85, 99, 0.4);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.escrow-progress-fill-lg {
  height: 100%;
  background: linear-gradient(90deg, #0e7490, #0891b2, #06b6d4, #a5f3fc);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
  min-width: 0;
}

/* ─── Milestone Row ──────────────────────────────────────────────────────── */
.escrow-milestone-row {
  transition: background-color 0.2s;
}
.escrow-milestone-row:hover {
  background: rgba(6, 182, 212, 0.04);
}

/* ─── Milestone Button ───────────────────────────────────────────────────── */
.escrow-ms-btn {
  transition: all 0.15s;
  font-size: 12px;
  cursor: pointer;
}
.escrow-ms-btn:hover {
  transform: translateY(-1px);
}
.escrow-ms-btn:active {
  transform: translateY(0);
}

/* ─── Input Styles ───────────────────────────────────────────────────────── */
.escrow-input {
  transition: border-color 0.15s, box-shadow 0.15s;
}
.escrow-input:focus {
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

/* ─── Deposit Modal Animation ────────────────────────────────────────────── */
#escrow-deposit-modal {
  animation: escrowModalIn 0.2s ease-out;
}
#escrow-deposit-modal > div {
  animation: escrowSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes escrowModalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes escrowSlideIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── State Badge Colors ─────────────────────────────────────────────────── */
.escrow-state-created   { color: #fbbf24; background: rgba(120,53,15,0.3);  border: 1px solid rgba(120,53,15,0.5); }
.escrow-state-active    { color: #4ade80; background: rgba(20,83,45,0.3);   border: 1px solid rgba(20,83,45,0.5); }
.escrow-state-disputed  { color: #f87171; background: rgba(127,29,29,0.3);  border: 1px solid rgba(127,29,29,0.5); }
.escrow-state-completed { color: #60a5fa; background: rgba(30,58,138,0.3);  border: 1px solid rgba(30,58,138,0.5); }
.escrow-state-refunded  { color: #9ca3af; background: rgba(55,65,81,0.3);   border: 1px solid rgba(55,65,81,0.5); }

/* ─── Milestone State Colors ─────────────────────────────────────────────── */
.ms-pending    { color: #9ca3af; background: rgba(55,65,81,0.4); }
.ms-requested  { color: #fbbf24; background: rgba(120,53,15,0.3); }
.ms-verified   { color: #4ade80; background: rgba(20,83,45,0.3); }
.ms-released   { color: #60a5fa; background: rgba(30,58,138,0.3); }

/* ─── Escrow Address Label ───────────────────────────────────────────────── */
.escrow-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ─── Glow Effect for Active Escrow ─────────────────────────────────────── */
.escrow-active-glow {
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.3), 0 4px 24px rgba(6, 182, 212, 0.1);
}

/* ─── Receipt-style Event Log Row ────────────────────────────────────────── */
.escrow-event-row {
  border-left: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.escrow-event-row:hover {
  border-left-color: rgba(6, 182, 212, 0.5);
  background: rgba(6, 182, 212, 0.04);
}

/* ─── Escrow Milestone Input ──────────────────────────────────────────────── */
.escrow-milestone-input {
  animation: fadeInRow 0.2s ease-out;
}
@keyframes fadeInRow {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Tab Escrow Active Indicator ────────────────────────────────────────── */
#tab-escrow.active {
  border-bottom-color: #06b6d4 !important;
  color: #06b6d4 !important;
}
#tab-escrow.active i {
  color: #06b6d4;
}

/* ─── Escrow v2.0 — Additional Styles ────────────────────────────────────── */

/* Fade-in-up animation for floating chips */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fadeInUp 0.3s ease-out forwards;
}

/* Pulse animation for new events */
@keyframes pulseOnce {
  0%   { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(168, 85, 247, 0); }
  100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}
.animate-pulse-once {
  animation: pulseOnce 1.5s ease-out 3;
}

/* Data flow diagram arrows */
.escrow-flow-arrow {
  color: #4b5563;
  font-size: 12px;
}

/* Step indicators in create form */
[id^="ecstep-"] {
  transition: color 0.2s;
}
[id^="ecstep-"] .w-5 {
  transition: all 0.2s;
}
.text-green-400 [id^="ecstep-"] .w-5 {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
}
.text-cyan-400 [id^="ecstep-"] .w-5 {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
}

/* USDC info box in create form */
#escrow-usdc-info {
  border-left: 2px solid rgba(6, 182, 212, 0.3);
}

/* Escrow wallet chip */
#escrow-wallet-chip {
  min-width: 140px;
}
#escrow-wallet-chip.border-green-600\/50 {
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}

/* On-chain badge */
#escrow-onchain-badge {
  animation: fadeInUp 0.3s ease-out;
}

/* Tab badge */
#tab-escrow-badge {
  animation: scaleIn 0.2s ease-out;
}
@keyframes scaleIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
