/* =============================================================
   KingPulse Studio - Route Visualizer, MEV Protection & Swap Receipt Modal
   ============================================================= */

/* Route Visualizer */
.swap-route-visual {
  margin: 10px 0 6px;
  min-height: 0;
  transition: all 0.3s ease;
}

.route-visual-wrapper {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.route-dex-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: rgba(122, 231, 193, 0.1);
  border: 1px solid rgba(122, 231, 193, 0.2);
  border-radius: 6px;
  padding: 2px 7px;
}

.route-nodes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 0;
}

.route-node-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: fadeInPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.route-token-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid;
  background: rgba(15, 17, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s;
}
.route-token-bubble:hover { transform: scale(1.1); }

.route-token-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.route-token-fallback {
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
}

.route-token-label {
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}

.route-arrow-group {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 36px;
  max-width: 60px;
  justify-content: center;
  animation: fadeInPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.route-arrow-line {
  height: 2px;
  width: 100%;
  border-radius: 2px;
  opacity: 0.6;
}

.route-arrow-head {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid;
  margin-left: -1px;
}

.route-hop-fee {
  position: absolute;
  top: -12px;
  font-size: 9px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  background: rgba(15, 17, 26, 0.9);
  padding: 0 4px;
  border-radius: 4px;
}

@keyframes fadeInPop {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* MEV Banner */
.swap-mev-banner {
  margin: 6px 0 10px;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.mev-banner-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mev-risk-low {
  background: rgba(122, 231, 193, 0.08);
  border: 1px solid rgba(122, 231, 193, 0.25);
}
.mev-risk-medium {
  background: rgba(245, 176, 65, 0.08);
  border: 1px solid rgba(245, 176, 65, 0.25);
}
.mev-risk-high {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.mev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mev-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.mev-badge-low    { background: rgba(122, 231, 193, 0.2); color: #7ae7c1; }
.mev-badge-medium { background: rgba(245, 176, 65, 0.2); color: #f5b041; }
.mev-badge-high   { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

.mev-reasons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mev-reasons li {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mev-tip {
  font-size: 11px;
  color: #f5b041;
  background: rgba(245, 176, 65, 0.07);
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 2px;
}

/* Swap Receipt Modal */
.swap-receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInReceipt 0.25s ease-out;
}

@keyframes fadeInReceipt {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.swap-receipt-modal {
  background: linear-gradient(145deg, #131728 0%, #0d1020 100%);
  border: 1px solid rgba(122, 231, 193, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(122, 231, 193, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  animation: slideUpReceipt 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpReceipt {
  from { transform: translateY(24px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.receipt-success-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 231, 193, 0.2) 0%, rgba(122, 231, 193, 0.05) 70%);
  border: 2px solid #7ae7c1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(122, 231, 193, 0.3);
  animation: popScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popScale {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.receipt-checkmark {
  font-size: 28px;
  color: #7ae7c1;
  font-weight: 900;
}

.receipt-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-color, #fff);
}

.receipt-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.receipt-swap-visual {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.receipt-token {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.receipt-token-amount {
  font-size: 17px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
}
.receipt-token-symbol {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.receipt-arrow-anim {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(122, 231, 193, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.receipt-arrow-pulse {
  color: #7ae7c1;
  font-size: 16px;
  animation: pulseArrow 1.2s infinite ease-in-out;
}
@keyframes pulseArrow {
  0%, 100% { transform: translateX(-2px); }
  50%      { transform: translateX(2px); }
}

.receipt-details {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: right;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.receipt-row span { color: var(--muted); }
.receipt-row b    { font-weight: 600; }

.receipt-actions {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.receipt-explorer-btn { flex: 2; text-decoration: none; display: flex; align-items: center; justify-content: center; }
#btn-close-receipt   { flex: 1; }

.receipt-share-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  opacity: 0.75;
}
