/* ===================================================
   Crypto Wallet App — Shared Styles
   =================================================== */

:root {
  --bg-app: #0b1220;
  --bg-panel: #131c2e;
  --bg-panel-2: #182338;
  --bg-pill: #1c2740;
  --border-soft: #232f47;
  --text-primary: #f2f5fa;
  --text-secondary: #8b96ab;
  --text-tertiary: #5d6b83;
  --accent-blue: #2f7bff;
  --accent-blue-soft: #1c4fa8;
  --accent-green: #21c17c;
  --accent-red: #f0506e;
  --accent-orange: #f7a83e;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-full: 999px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #05070c;
  font-family: var(--font-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Phone-shell frame: centers the app on wide screens, full-bleed on mobile */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---------- Status/top bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 8px;
}

.wallet-select {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-pill);
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
}

.wallet-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3ddc97, #1b6ecb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.wallet-select span {
  font-size: 14px;
  font-weight: 600;
}

.top-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
}

/* ---------- Page content scroll area ---------- */
.page-content {
  flex: 1;
  padding-bottom: 96px;
}

/* ---------- Page header (for non-home pages) ---------- */
.page-header {
  padding: 20px 20px 4px;
}

.page-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
}

/* ---------- Floating token icons (home hero) ---------- */
.hero {
  position: relative;
  padding: 26px 30px 30px;
  text-align: center;
}

.float-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.float-icon.i1 { top: 4px; left: 20px; background: #2775ca; }
.float-icon.i2 { top: 18px; right: 22px; background: #26a17b; }
.float-icon.i3 { top: 70px; left: 4px; background: #1e2130; }
.float-icon.i4 { top: 60px; right: 8px; background: #1e2130; }
.float-icon.i5 { top: 128px; left: 28px; background: #14151a; }
.float-icon.i6 { top: 128px; right: 30px; background: #f7931a; }

.hero h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 46px 0 18px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.buy-crypto-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 11px 26px;
  border-radius: var(--radius-full);
  font-size: 14.5px;
  font-weight: 600;
}

/* ---------- Promo banner carousel ---------- */
.banner-row {
  display: flex;
  gap: 12px;
  padding: 4px 20px 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.banner-row::-webkit-scrollbar { display: none; }

.banner-card {
  min-width: 250px;
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.banner-card.cronos {
  background: linear-gradient(135deg, #1f7ea8, #123a56);
}

.banner-card.meme {
  background: linear-gradient(135deg, #2a2f45, #15182a);
  min-width: 180px;
}

.banner-card h3 {
  font-size: 15px;
  margin: 0 0 6px;
  line-height: 1.3;
}

.banner-card p {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 16px;
  line-height: 1.4;
}

.banner-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.banner-cta button {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.banner-cta .link {
  font-size: 12px;
  color: #bcdcff;
}

.meme-tag {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: none;
}

.meme-gain {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 16px;
  margin-top: 6px;
}

/* ---------- Filter pill tabs ---------- */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tabs button {
  background: var(--bg-pill);
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-tabs button.active {
  background: var(--bg-panel-2);
  color: var(--text-primary);
}

/* ---------- Sort/network row ---------- */
.sort-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 20px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sort-row span { display: flex; align-items: center; gap: 4px; }

/* ---------- Token list rows ---------- */
.token-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.token-row:last-child { border-bottom: none; }

.token-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.token-name-block .name {
  font-size: 14.5px;
  font-weight: 600;
}

.token-name-block .sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.token-right { text-align: right; }

.token-right .price {
  font-size: 14.5px;
  font-weight: 600;
}

.token-right .change {
  font-size: 12.5px;
  margin-top: 2px;
  font-weight: 600;
}

.change.up { color: var(--accent-green); }
.change.down { color: var(--accent-red); }

/* ---------- Wallet page ---------- */
.balance-card {
  margin: 10px 20px 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #16223c, #0e1626);
  border: 1px solid var(--border-soft);
}

.balance-card .label {
  font-size: 13px;
  color: var(--text-secondary);
}

.balance-card .amount {
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0 4px;
  letter-spacing: -0.02em;
}

.balance-card .delta {
  font-size: 13px;
  color: var(--accent-green);
  font-weight: 600;
}

.wallet-actions {
  display: flex;
  gap: 10px;
  margin: 18px 20px;
}

.wallet-actions button {
  flex: 1;
  background: var(--bg-panel-2);
  border: none;
  color: var(--text-primary);
  padding: 14px 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.section-title {
  padding: 8px 20px 10px;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Swap page ---------- */
.swap-panel {
  margin: 14px 20px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: 4px;
  border: 1px solid var(--border-soft);
}

.swap-box {
  padding: 16px;
}

.swap-box .row-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

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

.swap-box .amount-row input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 600;
  width: 60%;
  outline: none;
}

.token-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-pill);
  padding: 7px 12px 7px 7px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.swap-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 1px;
  background: var(--border-soft);
  margin: 0 16px;
}

.swap-arrow {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--bg-panel);
}

.swap-rate {
  padding: 14px 16px 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.swap-btn {
  margin: 16px 20px 6px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 15px;
  width: calc(100% - 40px);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Perpetuals page ---------- */
.perp-summary {
  display: flex;
  gap: 10px;
  padding: 10px 20px 18px;
}

.perp-stat {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

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

.perp-stat .value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.position-card {
  margin: 0 20px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.position-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.position-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14.5px;
}

.leverage-tag {
  background: var(--bg-pill);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.side-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.side-tag.long { background: rgba(33,193,124,0.15); color: var(--accent-green); }
.side-tag.short { background: rgba(240,80,110,0.15); color: var(--accent-red); }

.position-grid {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.position-grid > div { flex: 1; }

.position-grid .g-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.position-grid .g-value {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

/* ---------- Browser page ---------- */
.browser-bar {
  margin: 10px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel-2);
  border-radius: var(--radius-full);
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.dapp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 20px;
}

.dapp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: center;
  width: calc(25% - 12px);
}

.dapp-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  background: rgba(11, 18, 32, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  flex: 1;
}

.nav-item.active { color: var(--text-primary); }

.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.center .nav-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-blue);
  border-radius: 50%;
  margin-top: -18px;
  border: 5px solid var(--bg-app);
  color: #fff;
}

.section-empty {
  margin: 30px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
