/* =====================================================================
   HWallet – giao dien mobile (vi dien tu Web10 Quantum Blockchain)
   - Toan trang BI KHOA truot ngang + doc (rubber-band)
   - Chi vung .screen duoc cuon doc ben trong
   - Anh trong /public giu nguyen ten, chi can thay file
   ===================================================================== */

:root {
  --maxw: 440px;
  --line: rgba(155, 92, 246, .35);
  --glow: rgba(56, 189, 248, .30);
  --gold: #f5c451;
  --cyan: #38bdf8;
  --purple: #9b5cf6;
  --green: #34d399;
  --red: #f87171;
  --txt: #eef3ff;
  --muted: #9aa0c8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  color: var(--txt);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  touch-action: none;
  background: #05060f url("public/bg-app.png") center top / cover no-repeat;
}

a { text-decoration: none; color: inherit; }
button { border: 0; font: inherit; color: inherit; cursor: pointer; background: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.app {
  position: relative;
  width: min(100vw, var(--maxw));
  height: 100%;
  margin: 0 auto;
}

.screen {
  position: relative;
  height: 100%;
  padding: 12px 14px calc(86px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.screen::-webkit-scrollbar { width: 0; height: 0; }

/* ===== Banner hero: 1 anh PNG, chuong TU CODE de len tren ===== */
.hero-wrap { position: relative; margin-top: -12px; margin-left: -14px; margin-right: -14px; }
.hero-banner { width: 100%; height: auto; display: block; }
.bell-btn { position: absolute; right: 16px; top: 16px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; }
.bell-btn svg { width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.5)); }
.bell-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: #ef3b3b; box-shadow: 0 0 8px rgba(239,59,59,.8);
}

/* ===== The tong tai san ===== */
.asset-card {
  position: relative; margin-top: 12px; border-radius: 16px; padding: 14px;
  border: 1.5px solid var(--line); background: rgba(12,10,28,.6); box-shadow: 0 0 12px var(--glow);
  display: flex; align-items: center; gap: 10px;
}
.asset-left { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.asset-label { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.eye { width: 14px; height: 9px; border: 1.5px solid var(--muted); border-radius: 50%; display: inline-block; position: relative; }
.eye::after { content: ""; position: absolute; inset: 2px 4px; border-radius: 50%; background: var(--muted); }
.asset-value { font-size: 20px; font-weight: 900; }
.asset-sub { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.asset-change { color: var(--green); font-weight: 800; background: rgba(52,211,153,.15); border-radius: 99px; padding: 1px 7px; font-size: 9.5px; }
.asset-donut { flex: 0 0 auto; width: 62px; height: 62px; }
.asset-legend { flex: 0 0 auto; display: grid; gap: 4px; font-size: 9.5px; }
.asset-legend div { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.asset-legend i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.asset-legend span { color: var(--muted); margin-left: auto; }
.asset-go { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }

/* ===== Luoi 10 icon thao tac ===== */
.action-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.aicon {
  display: grid; justify-items: center; gap: 5px; text-align: center;
  border: 1.5px solid var(--btn-border, var(--line)); border-radius: 12px; padding: 12px 2px;
  background: rgba(12, 10, 28, 0.6);
  box-shadow: var(--btn-glow, 0 0 6px var(--glow));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.aicon:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-glow-hover, 0 0 12px var(--glow));
  background: rgba(16, 14, 36, 0.7);
}
.aic {
  width: 28px;
  height: 28px;
  color: var(--btn-color, var(--cyan));
  filter: drop-shadow(0 0 5px var(--btn-color, var(--cyan)));
  display: flex;
  align-items: center;
  justify-content: center;
}
.aic svg {
  width: 100%;
  height: 100%;
}
.aicon span:last-child { font-size: 8px; font-weight: 700; color: var(--txt); white-space: nowrap; }

/* Themes cho tung button */
.aicon.theme-cyan {
  --btn-color: #00f0ff;
  --btn-border: rgba(0, 240, 255, 0.35);
  --btn-glow: 0 0 8px rgba(0, 240, 255, 0.2), inset 0 0 4px rgba(0, 240, 255, 0.08);
  --btn-glow-hover: 0 0 14px rgba(0, 240, 255, 0.4), inset 0 0 6px rgba(0, 240, 255, 0.15);
}
.aicon.theme-purple {
  --btn-color: #d946ef;
  --btn-border: rgba(217, 70, 239, 0.35);
  --btn-glow: 0 0 8px rgba(217, 70, 239, 0.2), inset 0 0 4px rgba(217, 70, 239, 0.08);
  --btn-glow-hover: 0 0 14px rgba(217, 70, 239, 0.4), inset 0 0 6px rgba(217, 70, 239, 0.15);
}
.aicon.theme-blue {
  --btn-color: #2d6ef7;
  --btn-border: rgba(45, 110, 247, 0.35);
  --btn-glow: 0 0 8px rgba(45, 110, 247, 0.2), inset 0 0 4px rgba(45, 110, 247, 0.08);
  --btn-glow-hover: 0 0 14px rgba(45, 110, 247, 0.4), inset 0 0 6px rgba(45, 110, 247, 0.15);
}
.aicon.theme-yellow {
  --btn-color: #fbbf24;
  --btn-border: rgba(251, 191, 36, 0.35);
  --btn-glow: 0 0 8px rgba(251, 191, 36, 0.2), inset 0 0 4px rgba(251, 191, 36, 0.08);
  --btn-glow-hover: 0 0 14px rgba(251, 191, 36, 0.4), inset 0 0 6px rgba(251, 191, 36, 0.15);
}
.aicon.theme-teal {
  --btn-color: #2dd4bf;
  --btn-border: rgba(45, 212, 191, 0.35);
  --btn-glow: 0 0 8px rgba(45, 212, 191, 0.2), inset 0 0 4px rgba(45, 212, 191, 0.08);
  --btn-glow-hover: 0 0 14px rgba(45, 212, 191, 0.4), inset 0 0 6px rgba(45, 212, 191, 0.15);
}

/* ===== Da chuoi ===== */
.chain-card {
  margin-top: 14px; border-radius: 14px; padding: 12px;
  border: 1.5px solid var(--line); background: rgba(12,10,28,.5); box-shadow: 0 0 8px var(--glow);
}
.chain-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chain-head-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--muted);
}
.chain-manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  color: var(--txt);
  background: rgba(12, 10, 28, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 4px 10px;
  border-radius: 99px;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}
.chain-manage-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}
.chain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.chain-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}
.chain-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(155, 92, 246, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chain-item:hover .chain-img {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(155, 92, 246, 0.4);
}
.chain-label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 8px;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  margin-top: 5px;
}
.chain-check-badge {
  width: 10px;
  height: 10px;
  color: var(--green);
  flex-shrink: 0;
  filter: drop-shadow(0 0 2px var(--green));
}
.chain-item.add .chain-label {
  color: var(--muted);
}

/* ===== hang truot ngang chung ===== */
.hscroll {
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.hscroll::-webkit-scrollbar { height: 0; }

/* ===== Banner khuyen mai: 1 anh PNG ===== */
.promo-banner { width: 100%; height: auto; margin-top: 14px; border-radius: 16px; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.25); }
.dots span.active { background: #fff; width: 16px; border-radius: 99px; }

/* ===== Giao dich gan day (Card) ===== */
.tx-card {
  margin-top: 16px;
  border-radius: 16px;
  padding: 14px;
  border: 1.5px solid var(--line);
  background: rgba(12, 10, 28, 0.6);
  box-shadow: 0 0 12px var(--glow);
}
.tx-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tx-card-head h2 {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--muted);
}
.see-all {
  font-size: 10px;
  color: var(--purple);
  font-weight: 700;
}
.tx-list {
  display: grid;
}
.tx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid rgba(155, 92, 246, 0.12);
  transition: background 0.2s ease;
}
.tx-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
.tx-row:first-child {
  padding-top: 4px;
}
.tx-row:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}
.tx-ic {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.tx-ic svg {
  width: 18px;
  height: 18px;
}
.tx-ic.green {
  border: 1.5px solid rgba(52, 211, 153, 0.35);
  color: var(--green);
  background: rgba(52, 211, 153, 0.08);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.15);
}
.tx-ic.purple {
  border: 1.5px solid rgba(155, 92, 246, 0.35);
  color: var(--purple);
  background: rgba(155, 92, 246, 0.08);
  box-shadow: 0 0 8px rgba(155, 92, 246, 0.15);
}
.tx-ic.gold {
  border: 1.5px solid rgba(245, 196, 81, 0.35);
  color: var(--gold);
  background: rgba(245, 196, 81, 0.08);
  box-shadow: 0 0 8px rgba(245, 196, 81, 0.15);
}
.tx-info {
  flex: 1 1 auto;
  min-width: 0;
}
.tx-info strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
}
.tx-info small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 1px;
}
.tx-amt {
  flex: 0 0 auto;
  text-align: right;
  margin-right: 4px;
}
.tx-amt strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
}
.tx-amt strong.up {
  color: var(--green);
}
.tx-amt strong.down {
  color: var(--red);
}
.tx-amt small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 1px;
}
.tx-status {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--green);
}

/* ============== BOTTOM NAV (5 muc) ============== */
.bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: linear-gradient(180deg, rgba(10,8,24,.92), rgba(4,4,10,.98));
  border-top: 1px solid #241c40;
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: #7d76a0; font-size: 10px;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--cyan); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(56,189,248,.6)); }
.nav-center { position: relative; }
.nav-center-circle {
  width: 58px; height: 58px;
  margin-top: -24px;
  border-radius: 50%;
  background-image: url("public/nav-center-btn.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 16px rgba(155,92,246,.6);
}
