/* =====================================================
   TRADE PAGE v2 - CRYPTO 2026 PREMIUM DESIGN
   =====================================================
   Ultra-modern, glassmorphism, animated gradient orbs,
   premium aesthetic matching the landing page design.
===================================================== */

/* =====================================================
   TRADE PAGE CONTAINER
===================================================== */

.trade-page-v2 {
  position: relative;
  min-height: calc(100vh - 60px);
  width: 100%;
  overflow: hidden;
  padding: 40px 24px 60px;
}

/* =====================================================
   ANIMATED BACKGROUND - Gradient Orbs & Grid
===================================================== */

.trade-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.trade-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: tradeOrbFloat 25s ease-in-out infinite;
}

.trade-orb-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0.1) 40%, transparent 70%);
  top: -250px;
  right: -150px;
  animation-delay: 0s;
}

.trade-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.3) 0%, rgba(5, 150, 105, 0.05) 50%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -8s;
}

.trade-orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.25) 0%, transparent 60%);
  top: 50%;
  left: 20%;
  animation-delay: -15s;
}

@keyframes tradeOrbFloat {
  0%, 100% { 
    transform: translate(0, 0) scale(1) rotate(0deg); 
  }
  25% { 
    transform: translate(40px, -40px) scale(1.08) rotate(5deg); 
  }
  50% { 
    transform: translate(-30px, 30px) scale(0.95) rotate(-3deg); 
  }
  75% { 
    transform: translate(25px, 15px) scale(1.03) rotate(2deg); 
  }
}

/* Grid Pattern */
.trade-grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(16, 185, 129, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, black 20%, transparent 80%);
}

/* Glow Line - Animated horizontal accent */
.trade-glow-line {
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(16, 185, 129, 0.3) 20%,
    rgba(16, 185, 129, 0.6) 50%,
    rgba(16, 185, 129, 0.3) 80%,
    transparent 100%
  );
  animation: glowLineMove 8s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes glowLineMove {
  0%, 100% { transform: translateY(0); opacity: 0.25; }
  50% { transform: translateY(-24px); opacity: 0.5; }
}

/* =====================================================
   MAIN TRADE CONTAINER - Two Column Layout
===================================================== */

.trade-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 60px;
  align-items: flex-start;
}

/* =====================================================
   LEFT SIDE - Info & Stats Panel
===================================================== */

.trade-info-panel {
  padding-top: 40px;
}

.trade-hero-text {
  margin-bottom: 48px;
}

/* Badge Pill with Pulse */
.trade-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--contrast-green);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--contrast-green);
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* Main Title */
.trade-main-title {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.trade-main-title .gradient-text {
  background: linear-gradient(135deg, var(--contrast-green) 0%, #34D399 50%, #6EE7B7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.trade-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 480px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* =====================================================
   LIVE STATS CARDS
===================================================== */

.trade-live-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.live-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.live-stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--contrast-green);
}

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

.stat-content .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: Inter, sans-serif;
  letter-spacing: -0.01em;
}

.stat-content .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =====================================================
   FEATURES LIST
===================================================== */

.trade-features-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-secondary);
}

.feature-check {
  width: 24px;
  height: 24px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* =====================================================
   SUPPORTED CHAINS
===================================================== */

.supported-chains {
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.chains-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  font-weight: 600;
}

.chains-icons {
  display: flex;
  gap: 12px;
}

.chain-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chain-icon img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.chain-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--contrast-green);
  transform: translateY(-3px);
}

.chain-icon.coming-soon {
  opacity: 0.4;
  cursor: default;
}

.chain-icon.coming-soon:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

/* =====================================================
   RIGHT SIDE - SWAP WIDGET PANEL
===================================================== */

.trade-widget-panel {
  animation: fadeInRight 0.8s ease-out 0.2s both;
}

@keyframes fadeInRight {
  from { 
    opacity: 0; 
    transform: translateX(40px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

#swap-widget {
  min-height: 380px;
}

#swap-widget .swap-container,
#swap-widget .swap-card-v8 {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Glassmorphism Swap Widget Container */
.swap-widget-glass {
  background: linear-gradient(
    145deg, 
    rgba(30, 30, 33, 0.9) 0%, 
    rgba(17, 17, 19, 0.95) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 6px;
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 80px rgba(16, 185, 129, 0.08);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all 0.4s ease;
}

.swap-widget-glass:hover {
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 
    0 50px 100px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 100px rgba(16, 185, 129, 0.12);
}

/* Widget Header Bar with Tabs */
.widget-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.widget-tabs {
  display: flex;
  gap: 6px;
}

.widget-tab {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.widget-tab:hover:not(:disabled) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.widget-tab.active {
  color: var(--text-primary);
  background: rgba(16, 185, 129, 0.12);
}

.widget-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.widget-settings {
  display: flex;
  gap: 8px;
}

.settings-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Inner Widget Container */
.swap-widget-inner {
  padding: 4px;
  min-height: 400px;
}

/* Loading State */
.widget-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  gap: 16px;
  color: var(--text-muted);
}

.loading-pulse {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--contrast-green);
  border-radius: 50%;
  animation: loadingSpin 1s linear infinite;
}

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

.widget-loading-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* =====================================================
   QUICK INFO CARDS - Below Widget
===================================================== */

.trade-quick-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.quick-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.quick-info-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(16, 185, 129, 0.2);
}

.quick-info-card i {
  font-size: 18px;
  color: var(--contrast-green);
  width: 24px;
  text-align: center;
}

.quick-info-card div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-info-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-info-card span {
  font-size: 11px;
  color: var(--text-muted);
}

/* =====================================================
   POWERED BY SECTION
===================================================== */

.trade-powered-by {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 80px auto 0;
  text-align: center;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.trade-powered-by > span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 16px;
}

.powered-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.powered-logo {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.powered-logo:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

/* =====================================================
   ANIMATIONS
===================================================== */

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

/* =====================================================
   RESPONSIVE DESIGN
===================================================== */

@media (max-width: 1200px) {
  .trade-container {
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 600px;
  }

  .trade-info-panel {
    padding-top: 0;
    text-align: center;
  }

  .trade-hero-text {
    margin-bottom: 36px;
  }

  .trade-main-title {
    font-size: 44px;
  }

  .trade-subtitle {
    max-width: none;
    margin: 0 auto;
  }

  .trade-live-stats {
    justify-content: center;
  }

  .trade-features-list {
    align-items: center;
  }

  .supported-chains {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .chains-icons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .trade-page-v2 {
    padding: 24px 16px 40px;
  }

  .trade-main-title {
    font-size: 36px;
  }

  .trade-subtitle {
    font-size: 16px;
  }

  .trade-live-stats {
    flex-direction: column;
    gap: 12px;
  }

  .live-stat-card {
    padding: 16px;
  }

  .stat-content .stat-value {
    font-size: 20px;
  }

  .trade-quick-info {
    grid-template-columns: 1fr;
  }

  .swap-widget-glass {
    border-radius: 20px;
  }

  .widget-header-bar {
    padding: 14px 16px 10px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .widget-tabs {
    width: 100%;
    order: 2;
  }

  .widget-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
  }

  .powered-logos {
    gap: 12px;
  }

  .powered-logo {
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .trade-main-title {
    font-size: 30px;
  }

  .trade-badge-pill {
    font-size: 12px;
    padding: 8px 14px;
  }

  .feature-item {
    font-size: 14px;
  }

  .chains-icons {
    gap: 8px;
  }

  .chain-icon {
    width: 38px;
    height: 38px;
  }

  .chain-icon img {
    width: 22px;
    height: 22px;
  }
}

/* =====================================================
   SWAP WIDGET INNER STYLES - Enhanced for v2
===================================================== */

/* Override existing swap-card-v8 for premium look */
#swap-widget .swap-container,
.swap-widget-inner .swap-container {
  max-width: 100%;
}

#swap-widget .swap-card-v8,
.swap-widget-inner .swap-card-v8 {
  background: transparent;
  border: none;
  padding: 16px;
  border-radius: 0;
}

#swap-widget .swap-card-body {
  gap: 14px;
}

#swap-widget .swap-input-box,
.swap-widget-inner .swap-input-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 18px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 0;
}

#swap-widget .swap-input-box:focus-within,
.swap-widget-inner .swap-input-box:focus-within {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

#swap-widget .swap-flip-row {
  margin: 0;
  min-height: 42px;
}

#swap-widget .flip-btn {
  position: relative;
  top: auto;
}

.swap-widget-inner .swap-amount-input {
  font-size: 32px;
  font-weight: 600;
}

.swap-widget-inner .token-select-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
}

.swap-widget-inner .token-select-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.swap-widget-inner .quick-amount-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.swap-widget-inner .quick-amount-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--contrast-green);
}

.swap-widget-inner .flip-btn {
  background: var(--bg-card);
  border: 3px solid rgba(0, 0, 0, 0.5);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.swap-widget-inner .flip-btn:hover {
  background: var(--contrast-green);
  color: white;
  transform: rotate(180deg);
}

#swap-widget .swap-execute-btn,
.swap-widget-inner .swap-execute-btn {
  border-radius: 14px;
  padding: 18px;
  font-size: 17px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
  transition: all 0.3s ease;
}

#swap-widget .swap-execute-btn.disabled {
  background: rgba(16, 185, 129, 0.18);
  color: #ECFDF5;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: none;
}

.swap-widget-inner .swap-execute-btn.ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.35);
}

.swap-widget-inner .swap-details-header {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.swap-widget-inner .swap-details-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

/* Token Modal Premium Style */
.token-modal-overlay {
  backdrop-filter: blur(8px);
}

.token-modal {
  background: linear-gradient(
    145deg,
    rgba(30, 30, 33, 0.98) 0%,
    rgba(17, 17, 19, 0.99) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  border-radius: 24px;
}

.token-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.token-modal-search input {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.token-modal-search input:focus {
  border-color: var(--contrast-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.modal-chain-filter {
  border-radius: 12px;
}

.modal-chain-filter.active {
  background: linear-gradient(135deg, var(--contrast-green) 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.token-option {
  border-radius: 14px;
  margin: 4px 0;
}

.token-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.token-option.has-balance {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.token-option.has-balance:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}
