/*
 * GalaxySwap — CSS Stylesheet
 * Vanilla CSS implementation matching https://galaxyswap.app/
 */

:root {
  --space-950: #070711;
  --space-900: #0b0b18;
  --space-800: #121225;
  --space-700: #1b1b33;
  --space-600: #262648;
  
  --galaxy-400: #a78bfa;
  --galaxy-500: #8b5cf6;
  --galaxy-600: #7c3aed;
  --nebula-500: #0ea5e9;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --glow-shadow: 0 0 40px -10px rgba(139, 92, 246, 0.45);
}

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

html {
  font-family: var(--font-family);
  background-color: var(--space-950);
  color: #ffffff;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--space-950);
  background-image: 
    radial-gradient(circle at 20% 10%, rgba(139, 92, 246, 0.18), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.14), transparent 35%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Page Layout Container */
.container-page {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 72rem; /* 1152px */
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-page {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-page {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Header & Navigation */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(18, 18, 37, 0.8);
  background-color: rgba(7, 7, 17, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  height: 4rem; /* 64px */
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  user-select: none;
}

.brand-logo-svg {
  display: block;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.brand-title .highlight {
  color: var(--galaxy-400);
}

/* Nav Links */
nav.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  nav.desktop-nav {
    display: flex;
  }
}

.nav-link {
  display: inline-block;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.nav-link:hover {
  background-color: var(--space-800);
  color: #ffffff;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language selector */
.language-selector-wrapper {
  position: relative;
  display: none;
  align-items: center;
}

@media (min-width: 640px) {
  .language-selector-wrapper {
    display: inline-flex;
  }
}

.lang-icon-globe {
  position: absolute;
  left: 0.625rem;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.lang-icon-caret {
  position: absolute;
  right: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  width: 14px;
  height: 14px;
}

select.lang-select {
  height: 2.25rem; /* 36px */
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0.5rem;
  border: 1px solid var(--space-700);
  background-color: rgba(11, 11, 24, 0.6);
  padding-left: 2rem;
  padding-right: 1.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  transition: border-color 0.15s ease;
  font-family: inherit;
}

select.lang-select:focus {
  outline: none;
  border-color: var(--galaxy-400);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.3);
}

select.lang-select:hover {
  border-color: var(--space-600);
}

select.lang-select option {
  background-color: var(--space-900);
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  height: 2.25rem; /* 36px */
  padding: 0 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.75rem;
}

.btn-md {
  height: 3rem; /* 48px */
  padding: 0 1.75rem;
  font-size: 1rem;
  border-radius: 0.75rem;
}

.btn-outline {
  border: 1px solid var(--space-600);
  background: transparent;
  color: #ffffff;
}

.btn-outline:hover {
  background-color: var(--space-800);
  border-color: var(--space-600);
}

.btn-brand-gradient {
  background-image: linear-gradient(135deg, var(--galaxy-500), var(--nebula-500));
  color: #ffffff;
  box-shadow: var(--glow-shadow);
}

.btn-brand-gradient:hover {
  opacity: 0.92;
  box-shadow: 0 0 45px -5px rgba(139, 92, 246, 0.6);
  transform: translateY(-1px);
}

.btn-wallet {
  background-color: #8b5cf6;
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-wallet:hover {
  background-color: #7c3aed;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.hidden-sm {
  display: none;
}

@media (min-width: 640px) {
  .hidden-sm {
    display: inline-flex;
  }
}

.mobile-menu-btn {
  display: inline-flex;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--space-700);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Drawer Navigation */
.mobile-nav-panel {
  display: none;
  flex-direction: column;
  padding: 1rem;
  background-color: var(--space-900);
  border-bottom: 1px solid var(--space-800);
  gap: 0.5rem;
}

.mobile-nav-panel.open {
  display: flex;
}

.mobile-nav-link {
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 1rem;
  border-radius: 0.5rem;
}

.mobile-nav-link:hover {
  background-color: var(--space-800);
  color: #fff;
}

/* Main Content */
main.site-main {
  flex: 1 1 0%;
}

/* Hero Section */
.hero-section {
  padding-top: 5rem;
  padding-bottom: 5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .hero-section {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
}

.hero-content {
  margin-left: auto;
  margin-right: auto;
  max-width: 48rem; /* 768px */
  animation: fadeInUp 0.8s ease-out;
}

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

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem; /* 12px */
  font-weight: 500;
  background-color: rgba(124, 58, 237, 0.2);
  color: var(--galaxy-400);
  border: 1px solid rgba(124, 58, 237, 0.4);
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.hero-heading {
  font-size: 2.25rem; /* 36px */
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-wrap: balance;
}

@media (min-width: 640px) {
  .hero-heading {
    font-size: 3.75rem; /* 60px */
  }
}

.gradient-text {
  background-image: linear-gradient(135deg, #8b5cf6 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
}

.hero-subtext {
  margin-top: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  text-wrap: pretty;
}

.hero-cta-group {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Supported Chains */
.supported-chains-container {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.supported-chains-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.chains-badge-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--space-700);
  background-color: rgba(11, 11, 24, 0.6);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
  cursor: default;
}

.chain-badge:hover {
  border-color: var(--space-600);
  background-color: rgba(18, 18, 37, 0.8);
  transform: translateY(-1px);
}

.chain-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Feature Cards (Swap & Bridge / Liquidity) */
.pillars-section {
  padding-bottom: 2rem;
}

.pillars-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pillar-card-link {
  text-decoration: none;
  display: block;
  height: 100%;
}

.pillar-card {
  border-radius: 1rem;
  border: 1px solid var(--space-700);
  background-color: rgba(11, 11, 24, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 100%;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.pillar-card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: var(--glow-shadow);
  transform: translateY(-2px);
}

.card-inner-swap {
  padding: 1.25rem;
  border-radius: 1rem;
  background-image: linear-gradient(to bottom, rgba(139, 92, 246, 0.2), transparent);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-inner-liquidity {
  padding: 1.25rem;
  border-radius: 1rem;
  background-image: linear-gradient(to bottom, rgba(14, 165, 233, 0.2), transparent);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pillar-title {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  color: #ffffff;
}

.pillar-desc {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  flex-grow: 1;
}

.pillar-action {
  margin-top: 1rem;
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--galaxy-400);
  transition: transform 0.2s ease;
}

.pillar-card:hover .pillar-action {
  transform: translateX(4px);
}

/* Principles (Non-custodial, Multi-chain, Transparent) */
.principles-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.principles-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .principles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.principle-card-link {
  text-decoration: none;
  display: block;
  height: 100%;
  color: inherit;
}

.principle-card {
  border-radius: 1rem;
  border: 1px solid var(--space-700);
  background-color: rgba(11, 11, 24, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.principle-card:hover {
  border-color: rgba(139, 92, 246, 0.6);
  background-color: rgba(18, 18, 37, 0.85);
  box-shadow: 0 0 35px -8px rgba(139, 92, 246, 0.45);
  transform: translateY(-2px);
}

.principle-inner {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.principle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.principle-arrow {
  color: var(--galaxy-400);
  font-size: 1.125rem;
  font-weight: 600;
  transition: transform 0.2s ease, color 0.2s ease;
}

.principle-card:hover .principle-arrow {
  transform: translateX(4px);
  color: #c4b5fd;
}

.principle-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.principle-desc {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid rgba(18, 18, 37, 0.8);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    text-align: left;
  }
}

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.footer-copyright {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Wallet Modal & Swap Modal (Interactive Vanilla JS) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background-color: #1a1b1f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0px 8px 32px rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(224, 232, 255, 0.7);
  cursor: pointer;
  transition: background-color 0.15s;
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.wallet-option-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wallet-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #ffffff;
}

.wallet-option-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateX(2px);
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.wallet-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.wallet-badge-popular {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
  font-weight: 500;
}

/* Interactive Swap Drawer/Modal */
.swap-modal-card {
  max-width: 460px;
}

.swap-input-box {
  background: var(--space-900);
  border: 1px solid var(--space-700);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.swap-input-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}

.swap-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.swap-amount-input {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  outline: none;
  width: 100%;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--space-800);
  border: 1px solid var(--space-600);
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  color: #fff;
  cursor: pointer;
}

.swap-direction-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--space-700);
  background: var(--space-800);
  color: var(--galaxy-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -0.5rem auto 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.swap-direction-btn:hover {
  background: var(--space-700);
  transform: rotate(180deg);
}

.swap-details-box {
  background: rgba(18, 18, 37, 0.4);
  border: 1px solid var(--space-800);
  border-radius: 12px;
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.swap-details-row {
  display: flex;
  justify-content: space-between;
}

/* Toast notifications */
.toast-notice {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--space-900);
  border: 1px solid var(--galaxy-500);
  box-shadow: var(--glow-shadow);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-size: 0.875rem;
  color: #fff;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}
