/* AllBridge — Tier-1 Production Web3 Interface Styling */

:root {
  --bg-app: #090A0F;
  --bg-card: #12141D;
  --bg-card-hover: #181B26;
  --bg-input: #0B0D14;
  
  --border-subtle: #1B1E2B;
  --border-focus: #2E344A;
  --border-active: #3B82F6;

  --accent-blue: #3B82F6;
  --accent-blue-hover: #2563EB;
  --accent-green: #10B981;
  --accent-purple: #8B5CF6;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dim: #475569;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient accent */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #3B82F6, transparent 70%);
  top: -200px;
  left: 30%;
}

.orb-2, .orb-3 { display: none; }

/* Top Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language Dropdown */
.lang-dropdown-wrapper {
  position: relative;
}

.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #181b28;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px;
  min-width: 140px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-menu.hidden {
  display: none !important;
}

.lang-opt {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.12s ease;
}

.lang-opt:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.lang-opt.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.network-badge-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.network-badge-btn:hover {
  border-color: var(--border-focus);
}

.chain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.connect-wallet-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.connect-wallet-btn:hover {
  background: var(--accent-blue-hover);
}

/* Main App Body */
.app-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 36px auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Main Bridge Card */
.bridge-card-wrapper {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tab-pill-group {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.pill-btn.active {
  background: var(--bg-card);
  color: #fff;
}

.card-controls {
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* IO Box (Pay from & Receive on) */
.io-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  transition: border-color 0.15s ease;
}

.io-box:focus-within {
  border-color: var(--border-focus);
}

.io-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.io-balance {
  display: flex;
  gap: 4px;
  color: var(--text-secondary);
}

.io-balance strong {
  color: #fff;
  font-family: var(--font-mono);
}

.arrival-time {
  color: var(--accent-green);
  font-weight: 600;
}

.io-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Selector Button */
.selector-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.selector-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.chain-logo-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #627EEA;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-logo-circle.ink, .ink-sm { background: #903BE6; }
.chain-logo-circle.base, .base-sm { background: #0052FF; }
.chain-logo-circle.giwa, .giwa-sm { background: #059669; }
.chain-logo-circle.arc, .arc-sm { background: #2775CA; }
.eth-sm { background: #627EEA; }

.selector-meta {
  text-align: left;
}

.selector-primary {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}

.selector-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Input Containers */
.input-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1;
}

.input-container input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-align: right;
  width: 100%;
}

.receive-number {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-align: right;
}

.quick-percentages {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.pct-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}

.pct-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.io-footer {
  margin-top: 6px;
  text-align: right;
}

.usd-value {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Switch Row */
.switch-row {
  display: flex;
  justify-content: center;
  margin: -10px 0;
  position: relative;
  z-index: 2;
}

.switch-direction-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.switch-direction-btn:hover {
  border-color: var(--border-focus);
  color: #fff;
  transform: rotate(180deg);
}

/* Route Summary Panel */
.route-summary-panel {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.summary-line:last-child {
  margin-bottom: 0;
}

.summary-label {
  color: var(--text-muted);
}

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

.route-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.route-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Primary Action Button */
.primary-submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}

.primary-submit-btn:hover {
  background: var(--accent-blue-hover);
}

.card-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Wide Content Cards (Routes, Activity, Analytics) */
.content-card-wide {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.panel-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: var(--border-focus);
  color: #fff;
}

.routes-table-container {
  overflow-x: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.clean-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
}

.clean-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.table-chain-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-chain-cell span {
  width: 22px;
  height: 22px;
  font-size: 0.55rem;
}

.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-pill.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

.link-mono {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.8rem;
}

/* Analytics Metrics */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  border-radius: 14px;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-trend {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.stat-trend.positive {
  color: var(--accent-green);
}

/* Network Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h4 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

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

.net-opt {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s;
}

.net-opt:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.net-opt-info {
  text-align: left;
}

.net-opt-info strong {
  display: block;
  font-size: 0.9rem;
}

.net-opt-info small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 24px;
  background: var(--bg-app);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.brand-sub {
  color: #fff;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #fff;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent-blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: all 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

@media (max-width: 768px) {
  .header-container { padding: 0 16px; }
  .brand-group { gap: 16px; }
  .nav-links { display: none; }
  .metrics-row { grid-template-columns: 1fr; }
  .footer-container { flex-direction: column; gap: 12px; text-align: center; }
}

/* Official Chain Images */
.chain-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.giwa-img {
  background: rgba(16, 185, 129, 0.15);
  padding: 3px;
  border-radius: 8px;
}

.table-chain-cell img, .net-opt img {
  border-radius: 50%;
  object-fit: cover;
}

.arc-img {
  background: rgba(39, 117, 202, 0.15);
  padding: 3px;
  border-radius: 8px;
}

/* WalletConnect Modal Styles */
.wc-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1E2333;
  border: 1px solid rgba(59, 153, 252, 0.4);
  transition: all 0.2s ease;
}

.wc-btn:hover {
  background: #252D42;
  border-color: #3B99FC;
  box-shadow: 0 0 16px rgba(59, 153, 252, 0.25);
}

.wc-modal-box {
  max-width: 380px;
  background: #141724;
  border: 1px solid #23293D;
  text-align: center;
}

.wc-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  text-align: left;
}

.wc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wc-brand h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.wc-brand small {
  color: #8E98B0;
  font-size: 0.75rem;
}

.wc-qr-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 20px;
  margin: 0 auto 16px auto;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.wc-qr-canvas img, .wc-qr-canvas canvas {
  width: 210px !important;
  height: 210px !important;
  display: block;
}

.wc-qr-badge {
  position: absolute;
  width: 36px;
  height: 36px;
  background: #FFFFFF;
  border: 2px solid #3B99FC;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wc-actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.wc-action-btn {
  background: #1C2130;
  border: 1px solid #283046;
  color: #E2E8F0;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wc-action-btn:hover {
  background: #272F44;
  border-color: #3B99FC;
  color: #fff;
}

.wc-wallet-chips {
  border-top: 1px solid #1E2333;
  padding-top: 14px;
}

.wc-chips-title {
  display: block;
  font-size: 0.72rem;
  color: #64748B;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wc-supported-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.wc-pill {
  background: #0E1018;
  border: 1px solid #1A1F2C;
  color: #94A3B8;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

/* WalletConnect Tabs & Item List */
.wc-tabs {
  display: flex;
  background: #0C0E17;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid #1E2333;
}

.wc-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #8E98B0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wc-tab-btn.active {
  background: #1C2130;
  color: #fff;
}

.wc-view {
  display: none;
}

.wc-view.active {
  display: block;
}

.wc-wallet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.wc-wallet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1C2130;
  border: 1px solid #283046;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s ease;
  width: 100%;
}

.wc-wallet-item:hover {
  background: #252D42;
  border-color: #3B99FC;
}

.wc-item-info {
  text-align: left;
  flex: 1;
}

.wc-item-info strong {
  display: block;
  font-size: 0.88rem;
}

.wc-item-info small {
  font-size: 0.72rem;
  color: #8E98B0;
}

.wc-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
