:root {
  --color-lavender-bg: #f8f7ff;
  --color-primary-purple: #5e35b1;
  --color-text-dark: #1a1a2e;
  --color-text-light: #9b8dbe;
  --color-white: #ffffff;
  --color-success: #00d632;
  --color-error: #ef4444;
  --color-border: #e6e8ea;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: var(--color-lavender-bg);
  color: var(--color-text-dark);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  animation: float 25s ease-in-out infinite;
}

.orb-1 {
  width: 700px;
  height: 700px;
  background: var(--color-primary-purple);
  top: -250px;
  right: -250px;
  animation-delay: 0s;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: #8b5cf6;
  bottom: -200px;
  left: -200px;
  animation-delay: 7s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, -40px) scale(1.15);
  }
  66% {
    transform: translate(-30px, 30px) scale(0.9);
  }
}

/* Header */
header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 50px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary-purple);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
}

.wallet-button {
  padding: 12px 28px;
  background: var(--color-primary-purple);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(94, 53, 177, 0.25);
}

.wallet-button:hover {
  background: #4c2b95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(94, 53, 177, 0.35);
}

.wallet-button:active {
  transform: scale(0.98);
}

.wallet-button.connected {
  background: var(--color-white);
  color: var(--color-primary-purple);
  border: 2px solid var(--color-primary-purple);
}

/* Main Container */
.container {
  position: relative;
  z-index: 5;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 50px 80px;
}

.hero {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeInUp 0.8s ease;
}

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

.hero h1 {
  font-size: 68px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  line-height: 1.1;
  color: var(--color-text-dark);
}

.hero p {
  font-size: 20px;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Swap Interface */
.swap-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
  animation: fadeInUp 1s ease 0.2s backwards;
}

.swap-card {
  background: var(--color-white);
  border: 2px solid rgba(94, 53, 177, 0.15);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(94, 53, 177, 0.08);
  transition: all 0.4s ease;
}

.swap-card:hover {
  box-shadow: 0 12px 48px rgba(94, 53, 177, 0.15);
  transform: translateY(-4px);
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: -0.02em;
  color: var(--color-text-dark);
}

.token-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
}

.token-option {
  flex: 1;
  padding: 16px;
  background: var(--color-lavender-bg);
  border: 2px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--color-text-dark);
}

.token-option.active {
  background: var(--color-white);
  border-color: var(--color-primary-purple);
  box-shadow: 0 4px 20px rgba(94, 53, 177, 0.15);
  color: var(--color-primary-purple);
}

.input-group {
  margin-bottom: 24px;
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 500;
}

.input-wrapper {
  position: relative;
}

.token-input {
  width: 100%;
  padding: 20px 140px 20px 20px;
  font-size: 32px;
  font-weight: 700;
  border: 2px solid rgba(94, 53, 177, 0.15);
  border-radius: 20px;
  background: var(--color-lavender-bg);
  transition: all 0.3s ease;
  letter-spacing: -0.01em;
  color: var(--color-text-dark);
}

.token-input:focus {
  outline: none;
  border-color: var(--color-primary-purple);
  background: var(--color-white);
  box-shadow: 0 0 0 4px rgba(94, 53, 177, 0.1);
}

.token-badge {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 18px;
  background: var(--color-white);
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  border: 2px solid rgba(94, 53, 177, 0.15);
  color: var(--color-text-dark);
}

.swap-direction {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.swap-arrow {
  background: var(--color-primary-purple);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 4px solid var(--color-lavender-bg);
  box-shadow: 0 4px 20px rgba(94, 53, 177, 0.25);
}

.swap-arrow:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 6px 30px rgba(94, 53, 177, 0.4);
  background: #4c2b95;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid rgba(94, 53, 177, 0.1);
  font-size: 15px;
}

.info-label {
  color: var(--color-text-light);
}

.info-value {
  font-weight: 600;
  color: var(--color-text-dark);
}

.swap-button {
  width: 100%;
  padding: 18px;
  background: var(--color-primary-purple);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 24px;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 20px rgba(94, 53, 177, 0.3);
}

.swap-button:hover:not(:disabled) {
  background: #4c2b95;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(94, 53, 177, 0.4);
}

.swap-button:active:not(:disabled) {
  transform: scale(0.98);
}

.swap-button:disabled {
  background: var(--color-border);
  color: var(--color-text-light);
  cursor: not-allowed;
  box-shadow: none;
}

/* Stats Panel */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-card {
  background: var(--color-white);
  border: 2px solid rgba(94, 53, 177, 0.15);
  border-radius: 24px;
  padding: 28px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 8px 32px rgba(94, 53, 177, 0.12);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-dark);
}

.stat-subvalue {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* Status Messages */
.status-message {
  padding: 16px 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

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

.status-message.success {
  background: rgba(0, 214, 50, 0.1);
  border: 2px solid rgba(0, 214, 50, 0.3);
  color: #059669;
}

.status-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.status-message.show {
  display: flex;
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(94, 53, 177, 0.2);
  border-top-color: var(--color-primary-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
  .swap-container {
    grid-template-columns: 1fr 350px;
    gap: 30px;
  }
}

@media (max-width: 992px) {
  .swap-container {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 52px;
  }

  .container {
    padding: 30px 40px;
  }

  header {
    padding: 20px 40px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 20px 25px;
  }

  .logo {
    font-size: 28px;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .wallet-button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .container {
    padding: 20px 25px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero p {
    font-size: 18px;
  }

  .swap-card {
    padding: 30px 25px;
  }

  .card-title {
    font-size: 24px;
  }

  .token-input {
    font-size: 28px;
    padding: 18px 130px 18px 18px;
  }

  .token-badge {
    font-size: 14px;
    padding: 8px 14px;
    right: 18px;
  }

  .stat-value {
    font-size: 32px;
  }
}

@media (max-width: 600px) {
  header {
    padding: 15px 20px;
  }

  .logo {
    font-size: 24px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .wallet-button {
    padding: 8px 16px;
    font-size: 13px;
  }

  .container {
    padding: 20px 20px;
  }

  .hero {
    margin-bottom: 40px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 16px;
  }

  .swap-card {
    padding: 25px 20px;
  }

  .card-title {
    font-size: 22px;
    margin-bottom: 24px;
  }

  .token-selector {
    gap: 10px;
  }

  .token-option {
    padding: 14px;
    font-size: 16px;
  }

  .token-input {
    font-size: 24px;
    padding: 16px 110px 16px 16px;
  }

  .token-badge {
    font-size: 13px;
    padding: 7px 12px;
  }

  .swap-arrow {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .swap-button {
    padding: 16px;
    font-size: 16px;
  }

  .stat-card {
    padding: 24px;
  }

  .stat-value {
    font-size: 28px;
  }

  .info-row {
    font-size: 14px;
  }

  .status-message {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 32px;
  }

  .token-input {
    font-size: 22px;
    padding: 14px 100px 14px 14px;
  }

  .stat-value {
    font-size: 24px;
  }
}
