/* ============================================
   InfinitSwap — Main Stylesheet
   ============================================ */

/* === RESET & VARIABLES === */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0b14;
  --card: rgba(14, 15, 28, 0.9);
  --border: #1e1f35;
  --border2: #2a2b42;
  --text: #e8e9f0;
  --muted: #8b8da3;
  --dim: #5c5e78;
  --dark: #14152a;
  --accent: #FF6B2C;
  --accent2: #e85d20;
  --accent3: #FFB347;
  --green: #4ade80;
  --red: #ef4444;
  --purple: rgba(153, 69, 255, 0.06);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === ANIMATIONS === */
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(-10px) translateX(-5px); }
  75% { transform: translateY(-30px) translateX(5px); }
}
@keyframes pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes glow {
  0%, 100% { opacity: .3; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === GLOBAL HELPERS === */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2b42; border-radius: 3px; }

.bg-glow {
  position: fixed; top: -30%; right: -20%; width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(255,107,44,.08) 0%, transparent 70%);
  animation: glow 8s ease-in-out infinite; pointer-events: none; z-index: 0;
}
.bg-glow2 {
  position: fixed; bottom: -20%; left: -15%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(153,69,255,.06) 0%, transparent 70%);
  animation: glow 12s ease-in-out infinite; pointer-events: none; z-index: 0;
}
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}

/* === NAV === */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,11,20,.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid #1a1b2e;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.logo-icon { font-size: 28px; }
.logo-text {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px;
  background: linear-gradient(135deg, #FF6B2C, #FFB347);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 8px; }
.nav-link {
  background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 8px 16px; cursor: pointer; border-radius: 8px; transition: color .2s;
  font-family: 'Inter', sans-serif;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.chain-sel {
  display: flex; align-items: center; gap: 6px; background: var(--dark);
  border: 1px solid var(--border); color: var(--text); border-radius: 12px;
  padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.wallet-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #FF6B2C, #e85d20); border: none; color: #fff;
  border-radius: 12px; padding: 8px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s;
}
.wallet-btn-connected {
  display: flex; align-items: center; gap: 8px; background: var(--dark);
  border: 1px solid var(--border2); color: var(--text); border-radius: 12px;
  padding: 8px 18px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--dark); border: 1px solid var(--border2);
  color: var(--muted); border-radius: 10px; cursor: pointer; transition: all .2s;
}
.mobile-menu-btn {
  display: none; background: none; border: none; color: var(--text);
  cursor: pointer; padding: 4px;
}
.mobile-nav {
  padding: 16px 24px; display: none; flex-direction: column; gap: 8px;
  border-top: 1px solid #1a1b2e;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  background: none; border: none; color: var(--muted); font-size: 16px; font-weight: 500;
  padding: 12px 0; cursor: pointer; text-align: left; font-family: 'Inter', sans-serif;
}

/* === HERO === */
.hero {
  position: relative; z-index: 1; max-width: 1200px; margin: 0 auto;
  padding: 100px 24px 60px; text-align: center;
}
.hero-content { animation: slideUp .8s ease-out; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,107,44,.1); border: 1px solid rgba(255,107,44,.2);
  border-radius: 100px; padding: 6px 18px; font-size: 13px; font-weight: 500;
  color: var(--accent); margin-bottom: 28px;
}
.hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(36px, 6vw, 72px);
  font-weight: 700; line-height: 1.1; color: var(--text); margin-bottom: 24px;
  letter-spacing: -.02em;
}
.hero-accent {
  background: linear-gradient(135deg, #FF6B2C, #FFB347);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 600px;
  margin: 0 auto 40px; line-height: 1.6;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-btn {
  background: linear-gradient(135deg, #FF6B2C, #e85d20); border: none; color: #fff;
  border-radius: 14px; padding: 14px 36px; font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: all .25s;
  box-shadow: 0 4px 24px rgba(255,107,44,.3);
}
.hero-btn-outline {
  background: transparent; border: 1px solid var(--border2); color: var(--text);
  border-radius: 14px; padding: 14px 36px; font-size: 16px; font-weight: 500;
  cursor: pointer; font-family: 'Space Grotesk', sans-serif;
  display: flex; align-items: center; gap: 8px; transition: all .25s;
}

/* === STATS === */
.stats-strip {
  display: flex; justify-content: center; align-items: center; gap: 40px;
  margin-top: 80px; padding: 32px 24px; background: rgba(20,21,42,.5);
  border-radius: 20px; border: 1px solid var(--border); flex-wrap: wrap;
  animation: slideUp 1s ease-out;
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* === SWAP === */
.swap-section {
  position: relative; z-index: 1; padding: 60px 24px 80px;
  display: flex; justify-content: center;
}
.swap-container {
  width: 100%; max-width: 480px; background: var(--card);
  border: 1px solid var(--border); border-radius: 24px; padding: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 80px rgba(255,107,44,.05);
}
.connected-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; margin-bottom: 14px; background: var(--dark);
  border: 1px solid var(--border); border-radius: 14px;
}
.connected-info { display: flex; align-items: center; gap: 8px; }
.connected-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px rgba(74,222,128,.4);
}
.disconnect-btn {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.15);
  color: var(--red); font-size: 12px; font-weight: 600; padding: 6px 14px;
  border-radius: 8px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s;
}
.disconnect-btn:hover { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: #f87171; }
.swap-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.swap-tabs { display: flex; gap: 4px; background: var(--dark); border-radius: 12px; padding: 4px; }
.swap-tab {
  background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all .2s;
}
.swap-tab.active { background: var(--border); color: var(--text); }
.settings-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 10px; transition: all .2s; }

.input-card {
  background: var(--dark); border-radius: 16px; padding: 16px;
  border: 1px solid var(--border); transition: border-color .2s;
}
.input-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.input-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input-balance { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.max-btn {
  background: rgba(255,107,44,.15); border: none; color: var(--accent);
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  cursor: pointer; font-family: 'Inter', sans-serif;
}
.input-row { display: flex; align-items: center; gap: 10px; }
.amount-input {
  flex: 1; background: none; border: none; color: var(--text); font-size: 28px;
  font-weight: 600; font-family: 'Space Grotesk', sans-serif; outline: none;
  width: 100%; min-width: 0;
}
.token-selector {
  display: flex; align-items: center; gap: 8px; background: var(--border);
  border: 1px solid var(--border2); border-radius: 14px; padding: 8px 14px;
  color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; white-space: nowrap; transition: all .2s;
}
.input-usd { font-size: 12px; color: var(--dim); margin-top: 8px; }
.swap-btn-wrapper { display: flex; justify-content: center; margin: -6px 0; position: relative; z-index: 2; }
.swap-direction-btn {
  width: 40px; height: 40px; border-radius: 12px; background: #1a1b2e;
  border: 3px solid var(--border2); color: var(--text); display: flex;
  align-items: center; justify-content: center; cursor: pointer; transition: all .3s ease;
}
.swap-direction-btn:hover { transform: rotate(180deg); background: var(--accent); border-color: var(--accent); }

.rate-info {
  background: var(--dark); border-radius: 14px; padding: 14px; margin-top: 12px;
  border: 1px solid var(--border);
}
.rate-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.rate-label { font-size: 13px; color: var(--dim); }
.rate-value { font-size: 13px; color: var(--muted); font-weight: 500; }

.action-btn {
  width: 100%; background: linear-gradient(135deg, #FF6B2C, #e85d20); border: none;
  color: #fff; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 700;
  cursor: pointer; font-family: 'Space Grotesk', sans-serif; margin-top: 14px;
  transition: all .2s; box-shadow: 0 4px 24px rgba(255,107,44,.25);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.action-btn-disabled {
  width: 100%; background: var(--border); border: none; color: var(--dim);
  border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 700;
  cursor: not-allowed; font-family: 'Space Grotesk', sans-serif; margin-top: 14px;
}

/* === SETTINGS PANEL === */
.settings-panel {
  background: var(--dark); border-radius: 16px; padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--border); display: none;
}
.settings-panel.open { display: block; }
.settings-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; color: var(--text); font-size: 14px;
}
.settings-group { margin-bottom: 16px; }
.settings-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: block; font-weight: 500; }
.slippage-row { display: flex; gap: 8px; align-items: center; }
.slippage-btn {
  background: var(--border); border: 1px solid var(--border2); color: var(--muted);
  border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .2s;
}
.slippage-btn.active { background: rgba(255,107,44,.15); border-color: var(--accent); color: var(--accent); }

/* === FEATURES === */
.features { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 80px 24px; }
.section-title {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(28px, 4vw, 40px);
  font-weight: 700; text-align: center; margin-bottom: 56px; color: var(--text);
}
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.feature-card {
  background: rgba(14,15,28,.8); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px; transition: all .3s ease; cursor: default;
}
.feature-card:hover { border-color: rgba(255,107,44,.27); transform: translateY(-4px); }
.feature-icon { font-size: 32px; display: block; margin-bottom: 16px; }
.feature-title { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.feature-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* === CHAINS === */
.chains-section { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 40px 24px 80px; }
.chains-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.chain-card {
  background: rgba(14,15,28,.6); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center;
  gap: 10px; transition: all .3s ease; cursor: default;
}
.chain-card:hover { transform: translateY(-2px); }

/* === CTA === */
.cta-section { position: relative; z-index: 1; padding: 0 24px 80px; }
.cta-inner {
  max-width: 800px; margin: 0 auto; text-align: center;
  background: linear-gradient(135deg, rgba(255,107,44,.1), rgba(255,107,44,.02));
  border: 1px solid rgba(255,107,44,.15); border-radius: 28px; padding: 60px 40px;
}

/* === FOOTER === */
footer { position: relative; z-index: 1; border-top: 1px solid #1a1b2e; background: rgba(10,11,20,.9); }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px;
  display: flex; gap: 60px; flex-wrap: wrap;
}
.footer-brand { flex: 1 1 300px; max-width: 320px; }
.footer-desc { font-size: 14px; color: var(--dim); line-height: 1.6; margin: 16px 0 20px; }
.social-links { display: flex; gap: 10px; }
.social-btn {
  width: 36px; height: 36px; border-radius: 10px; background: var(--dark);
  border: 1px solid var(--border); color: var(--muted); display: flex;
  align-items: center; justify-content: center; cursor: pointer; font-size: 16px;
  transition: all .2s;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); }
.footer-links { flex: 1; display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.footer-col-title { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.footer-link { font-size: 13px; color: var(--dim); text-decoration: none; cursor: pointer; }
.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px; border-top: 1px solid #1a1b2e;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #3a3c52; flex-wrap: wrap; gap: 12px;
}

/* === MODALS === */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #0e0f1c; border: 1px solid var(--border); border-radius: 24px;
  width: 100%; max-width: 420px; max-height: 70vh; overflow: hidden;
  display: flex; flex-direction: column; animation: slideUp .3s ease-out;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; color: var(--text); }
.modal-close { background: none; border: none; color: var(--dim); font-size: 18px; cursor: pointer; padding: 4px; }
.modal-search {
  margin: 12px 16px; background: var(--dark); border: 1px solid var(--border2);
  border-radius: 12px; padding: 12px 16px; color: var(--text); font-size: 14px;
  outline: none; font-family: 'Inter', sans-serif; display: block; width: calc(100% - 32px);
}
.modal-body { padding: 20px 24px; overflow: auto; flex: 1; }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.token-list { overflow: auto; padding: 0 8px 8px; flex: 1; }
.token-row {
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px;
  cursor: pointer; background: transparent; border: none; width: 100%; text-align: left;
  transition: background .15s; font-family: 'Inter', sans-serif;
}
.token-row:hover { background: rgba(255,107,44,.1); }
.token-info { display: flex; flex-direction: column; flex: 1; }
.token-symbol { font-weight: 600; color: var(--text); font-size: 15px; }
.token-name { font-size: 12px; color: var(--dim); }
.token-balance-display { font-size: 13px; color: var(--muted); font-weight: 500; }
.coin-logo { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.coin-icon { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.wallet-option {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px;
  background: transparent; border: none; border-radius: 12px; cursor: pointer;
  transition: background .15s; font-family: 'Inter', sans-serif;
}
.wallet-option:hover { background: rgba(255,107,44,.1); }

/* === AUTH — CONNECT WALLET (Feedback Form) === */
.auth-page {
  min-height: 100vh; background: var(--bg); display: none; align-items: center;
  justify-content: center; position: relative; overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
}
.auth-page.open { display: flex; }
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px; backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,.4); animation: slideUp .5s ease-out;
  width: 100%; max-width: 480px;
}
.feedback-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 700;
  color: var(--text); margin-bottom: 6px; text-align: center;
}
.feedback-sub {
  font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; text-align: center;
  line-height: 1.5;
}
.feedback-textarea {
  width: 100%; height: 140px; border: 2px solid var(--border2); border-radius: 8px;
  padding: 14px; font-size: 0.95rem; font-family: inherit; resize: vertical;
  transition: border-color 0.2s; outline: none;
  background: var(--dark); color: var(--text);
}
.feedback-textarea::placeholder { color: var(--dim); }
.feedback-textarea:focus { border-color: var(--accent); }
.feedback-btn {
  margin-top: 16px; width: 100%; padding: 12px;
  background: linear-gradient(135deg, #FF6B2C, #e85d20); color: #fff; border: none;
  border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; transition: background 0.2s;
  box-shadow: 0 4px 24px rgba(255,107,44,.25);
}
.feedback-btn:hover { background: linear-gradient(135deg, #e85d20, #d14e15); }
.feedback-btn:disabled { opacity: .5; cursor: not-allowed; }
.feedback-status {
  margin-top: 14px; text-align: center; font-size: 0.9rem; min-height: 1.2em;
}
.feedback-status.success { color: var(--green); }
.feedback-status.error { color: var(--red); }

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  .nav-links { display: none !important; }
  .chain-sel { display: none !important; }
  .mobile-menu-btn { display: block !important; }
  .hero { padding: 60px 16px 40px; }
  .hero-title { font-size: 32px; }
  .stats-strip { gap: 20px; padding: 24px 16px; }
  .stat-value { font-size: 24px; }
  .stat-divider { display: none; }
  .swap-section { padding: 30px 16px 60px; }
  .swap-container { padding: 16px; }
  .amount-input { font-size: 22px; }
  .features { padding: 40px 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .chains-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
  .footer-inner { padding: 40px 16px 24px; gap: 30px; }
  .footer-links { gap: 24px; }
  .cta-inner { padding: 40px 24px; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .hero-btn, .hero-btn-outline { width: 100%; text-align: center; justify-content: center; }
  .wallet-btn span:last-child { display: none; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; }
  .swap-container { padding: 12px; border-radius: 18px; }
  .auth-card { padding: 24px 16px; margin: 0 12px; }
  .token-selector { padding: 6px 10px; font-size: 13px; }
}
