/* pgX.finance - Tier 1 DEX Quality */

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

:root {
  --bg: #000000;
  --card-bg: #111111;
  --card-border: rgba(255, 255, 255, 0.06);
  --primary: #9B27FF;
  --secondary: #FF2D78;
  --gradient: linear-gradient(135deg, #9B27FF, #FF2D78);
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --success: #00C48C;
  --error: #FF4D4D;
  --inset-bg: #0d0d0d;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Animated background gradients */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat linear infinite;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(155,39,255,0.18) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  animation-duration: 20s;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,45,120,0.12) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-duration: 25s;
  animation-delay: -10s;
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(155,39,255,0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation-duration: 15s;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(40px, -30px) scale(1.05); }
  50%  { transform: translate(-20px, 40px) scale(0.95); }
  75%  { transform: translate(30px, 20px) scale(1.02); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Dot grid overlay */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 10;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  margin: 0 -1rem 2rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.nav-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-brand-dot {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-badge {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(155, 39, 255, 0.15);
  border: 1px solid rgba(155, 39, 255, 0.4);
  border-radius: 20px;
}

/* Hamburger menu (mobile only) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 150ms ease;
}

/* Mobile menu drawer */
.mobile-menu {
  position: fixed;
  top: 57px;
  left: 0;
  right: 0;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 99;
  display: none;
  flex-direction: column;
  padding: 12px 20px;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  height: 44px;
  color: white;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 20px 24px;
  position: relative;
  z-index: 10;
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-accent {
  background: linear-gradient(135deg, #9B27FF, #FF2D78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 15px;
  color: #888;
  max-width: 400px;
  margin: 12px auto 20px;
  line-height: 1.6;
}

.chain-logos-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.chain-logo-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: #1a1a1a;
  transition: transform 150ms ease;
}

.chain-logo-pill:hover {
  transform: translateY(-2px);
}

/* Steps */
.step {
  display: none;
}

.step.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Swap Card */
.swap-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* Inset card */
.inset-card {
  background: var(--inset-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
}

/* Section headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.section-balance {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Pay section */
.pay-section {
  margin-bottom: 1rem;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.amount-input {
  flex: 1;
  font-size: 28px;
  font-weight: 300;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

.amount-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Token selector (combined chain+token) */
.token-selector {
  position: relative;
  flex-shrink: 0;
}

.token-selector-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 14px;
  white-space: nowrap;
}

.token-selector-inner:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.selector-placeholder {
  color: var(--text-secondary);
}

.chain-logo-sm {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a1a;
}

.selector-chain-name {
  font-weight: 500;
  color: var(--text-primary);
}

.selector-sep {
  color: rgba(255, 255, 255, 0.3);
}

.sel-token {
  font-weight: 600;
  color: var(--text-primary);
}

.chevron {
  color: rgba(255, 255, 255, 0.4);
  transition: transform 150ms ease;
}

/* Dropdown */
.token-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background: rgba(17, 17, 17, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}

.token-dropdown::-webkit-scrollbar {
  width: 6px;
}

.token-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.token-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chain-group {
  margin-bottom: 0.5rem;
}

.chain-group:last-child {
  margin-bottom: 0;
}

.chain-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
}

.chain-logo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a1a;
}

.token-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease;
  font-size: 14px;
}

.token-option:hover {
  background: rgba(155, 39, 255, 0.1);
}

.token-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.token-sym {
  font-weight: 600;
  color: var(--text-primary);
}

.token-chain-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.amount-usd {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
}

/* Swap arrow */
.swap-arrow {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
}

.swap-arrow svg {
  width: 32px;
  height: 32px;
  padding: 0.5rem;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
}

/* Receive section */
.receive-section {
  margin-bottom: 1rem;
}

.receive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receive-amount {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
}

.receive-token {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.token-logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.token-name-bold {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.token-chain-label {
  font-size: 11px;
  color: var(--secondary);
}

/* Address section */
.address-section {
  margin-bottom: 1rem;
}

.dest-input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', monospace;
  outline: none;
  transition: border-color 150ms ease;
}

.dest-input:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(155, 39, 255, 0.2);
}

.dest-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Transaction details */
.tx-details {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
  font-size: 13px;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  font-weight: 500;
  color: var(--text-primary);
}

.detail-value.burn {
  color: #ef4444;
  font-weight: 600;
}

.quote-refresh-row {
  border-top: 1px solid var(--card-border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

/* CTA Button */
.cta-btn {
  width: 100%;
  padding: 0.875rem;
  height: 52px;
  background: var(--gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: 'Inter', sans-serif;
}

.cta-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(155, 39, 255, 0.4);
}

.cta-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Powered By Section */
.powered-by {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px 24px;
  margin: 16px auto 0;
  max-width: 460px;
  position: relative;
  z-index: 10;
}

.powered-by-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.powered-logos {
  display: flex;
  flex-direction: row-reverse;
}

.powered-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #000;
  object-fit: cover;
  margin-left: -12px;
  background: #1a1a1a;
  transition: transform 0.15s ease;
}

.powered-logo:hover {
  transform: translateY(-4px) scale(1.1);
  z-index: 10 !important;
}

/* Stats section */
.stats-section {
  margin-top: 1.5rem;
  position: relative;
  z-index: 10;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.stat-icon {
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Deposit step */
.deposit-chain-badge {
  padding: 0.25rem 0.625rem;
  font-size: 10px;
  font-weight: 600;
  background: rgba(155, 39, 255, 0.15);
  border: 1px solid var(--primary);
  border-radius: 100px;
  color: var(--primary);
}

.deposit-instruction {
  margin-bottom: 1rem;
}

.deposit-send-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.deposit-send-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.address-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.deposit-address-text {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: rgba(155, 39, 255, 0.1);
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(155, 39, 255, 0.2);
}

.qr-section {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.qr-code {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  border: 2px solid var(--card-border);
}

.countdown-section {
  margin-bottom: 1rem;
  text-align: center;
}

.countdown-value {
  display: block;
  margin-top: 0.5rem;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.waiting-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* Processing step */
.progress-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 0 0.5rem;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.step-circle {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--card-border);
  transition: all 300ms ease;
}

.step-circle.pending {
  color: rgba(255, 255, 255, 0.3);
  font-size: 15px;
  font-weight: 600;
}

.progress-step.active .step-circle {
  border-color: var(--primary);
  background: rgba(155, 39, 255, 0.1);
}

.progress-step.complete .step-circle {
  border-color: var(--success);
  background: rgba(0, 196, 140, 0.1);
}

.step-spinner {
  color: var(--primary);
  animation: spin 1s linear infinite;
}

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

.step-check {
  color: var(--success);
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.progress-step.active .step-label,
.progress-step.complete .step-label {
  color: var(--text-primary);
}

.step-tx-link {
  font-size: 10px;
  color: var(--primary);
  text-decoration: none;
  margin-top: 0.25rem;
}

.step-tx-link:hover {
  text-decoration: underline;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--card-border);
  margin: 0 0.5rem;
  transition: background 300ms ease;
}

.progress-line.active {
  background: var(--gradient);
}

/* Completion box */
.completion-box {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 1.5rem;
}

.completion-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.completion-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.completion-received {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.completion-received strong {
  color: var(--text-primary);
  font-weight: 700;
}

.burn-note {
  font-size: 13px;
  color: #ef4444;
  margin-bottom: 1.5rem;
}

.burn-note strong {
  font-weight: 700;
}

/* Footer */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 150ms ease;
}

.footer-social:hover {
  background: rgba(155, 39, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.footer-note {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Mobile responsive */
@media (max-width: 767px) {
  .nav-links {
    display: none;
  }
  
  .hamburger {
    display: flex;
  }
  
  .hero-title {
    font-size: 28px;
  }
  
  .hero-sub {
    font-size: 14px;
  }
  
  .swap-card {
    border-radius: 16px;
    margin: 0 12px;
  }
  
  .powered-by {
    margin: 16px 12px 0;
    padding: 14px 20px;
  }
  
  .powered-by-text {
    font-size: 14px;
  }
  
  .powered-logo {
    width: 36px;
    height: 36px;
  }
  
  /* Full screen dropdown on mobile */
  .token-dropdown {
    position: fixed !important;
    top: 57px !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 0 0 16px 16px;
  }
  
  .progress-track {
    padding: 0;
  }
  
  .step-circle {
    width: 40px;
    height: 40px;
  }
  
  .step-label {
    font-size: 10px;
  }
  
  .progress-line {
    margin: 0 0.25rem;
  }
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
  
  .nav-links {
    display: flex;
  }
  
  .mobile-menu {
    display: none !important;
  }
}

/* Focus styles */
button:focus-visible,
input:focus-visible,
.token-selector-inner:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
