/*
 * Homepage — matches reference localhost:8080
 * ————————————————————————
 */

/* ——— Background glow ——— */
.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-glow .g1 {
  position: absolute; top: -20%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  animation: float1 20s ease-in-out infinite;
}
.bg-glow .g2 {
  position: absolute; bottom: -20%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
  animation: float2 25s ease-in-out infinite;
}
@keyframes float1 { 0%,100%{transform:translate(0,0)scale(1)} 50%{transform:translate(50px,50px)scale(1.1)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)scale(1)} 50%{transform:translate(-50px,-50px)scale(1.1)} }

/* ——— Container ——— */
.container {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 40px 20px; min-height: 100vh; display: flex; flex-direction: column;
}

/* ——— Header ——— */
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 40px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.logo-text {
  font-size: 22px; font-weight: 600;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ——— Search panel ——— */
.home-search {
  max-width: 700px; margin: 0 auto 0; text-align: center;
}
.home-search h1 {
  font-size: 32px; font-weight: 600; margin-bottom: 12px;
  background: linear-gradient(135deg, #fff, #c7d2fe);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.home-search p {
  font-size: 16px; color: rgba(255,255,255,0.5);
  margin-bottom: 32px;
}
.search-box {
  display: flex; gap: 12px;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
}
.search-input {
  flex: 1;
  padding: 16px 24px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  font-size: 16px; color: #fff; outline: none;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.search-input::placeholder { color: rgba(255,255,255,0.3); font-family: -apple-system, sans-serif; }
.search-input:focus { border-color: rgba(99,102,241,0.5); }
.search-btn {
  padding: 16px 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 600;
  color: #fff; cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; gap: 8px;
}
.search-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99,102,241,0.4); }
.search-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.search-error { color: #f87171; font-size: 14px; margin-top: 12px; min-height: 20px; }

/* ——— Price bar ——— */
.price-bar {
  display: flex; justify-content: center;
  gap: 32px; margin-top: 32px; margin-bottom: 40px;
}
.price-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.price-item .icon {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.price-item .icon.usdt { background: #26a17b; }
.price-item .icon.btc { background: #f7931a; }
.price-item .icon.trx { background: #ff0013; }
.price-item .name { color: rgba(255,255,255,0.5); }
.price-item .value { color: #fff; font-weight: 500; font-family: 'SF Mono', monospace; }

/* ——— Body states ——— */

/* ——— Feature teasers ——— */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; max-width: 720px; margin: 0 auto; opacity: 0.35;
}
.feature-grid .feat-item {
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; text-align: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.feature-grid .feat-icon { font-size: 22px; margin-bottom: 8px; }
.feature-grid .feat-label { font-size: 12px; color: rgba(255,255,255,0.3); }

/* ——— Glass card ——— */
.glass-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px; padding: 28px; margin-bottom: 24px;
}

/* ——— Address header ——— */
.address-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.address-info { flex: 1; min-width: 0; }
.address-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.address-row h2 { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.5); margin: 0; }
.address-actions { display: flex; gap: 6px; }
.action-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 12px; transition: all 0.2s;
}
.action-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.address-row-text { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.address-hash { font-size: 16px; font-family: 'SF Mono', 'Menlo', monospace; color: #fff; cursor: pointer; word-break: break-all; font-weight: 500; }
.address-hash:hover { opacity: 0.8; }
.copy-tip { font-size: 12px; color: #34d399; margin-left: 10px; opacity: 0; transition: opacity 0.3s; }
.copy-tip.show { opacity: 1; }

.back-btn {
  padding: 10px 20px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
  color: #fff; font-size: 14px; cursor: pointer;
}
.back-btn:hover { background: rgba(255,255,255,0.15); }

/* ——— Card search ——— */
.card-search { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.card-search-input {
  flex: 1; padding: 10px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 14px; color: #fff; outline: none;
  font-family: 'SF Mono', monospace;
}
.card-search-input::placeholder { color: rgba(255,255,255,0.3); font-family: -apple-system, sans-serif; }
.card-search-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 8px; color: #fff; cursor: pointer; font-size: 16px;
}

/* ——— Balance grid ——— */
.balance-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.balance-item { padding: 14px 12px; background: rgba(0,0,0,0.2); border-radius: 12px; text-align: center; }
.balance-label { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.balance-value { font-size: 16px; font-weight: 600; font-family: 'SF Mono', monospace; }
.balance-value.trx { color: #f87171; }
.balance-value.usdt { color: #34d399; }
.balance-value.energy { color: #fbbf24; }
.balance-value.cny { color: #60a5fa; }
.balance-value.btc { color: #f7931a; }
.balance-value.receive { color: #34d399; }
.balance-value.send { color: #f87171; }

/* ——— Tabs ——— */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  padding: 10px 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 14px; color: rgba(255,255,255,0.6);
  cursor: pointer; transition: all 0.2s;
}
.tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent; color: #fff;
}

/* ——— Responsive ——— */
@media (max-width: 640px) {
  .container { padding: 20px 16px; }
  .header { margin-bottom: 24px; }
  .logo-text { font-size: 18px; }
  .home-search h1 { font-size: 24px; }
  .search-box { flex-direction: column; }
  .search-btn { justify-content: center; }
  .balance-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .bg-glow .g1, .bg-glow .g2 { display: none; }
}

/* ——— Body states ——— */
body.has-address .home-page { display: none; }
body.has-address .address-page { display: block; }
body.has-address .home-bottom { display: none; }

/* ——— Address page ——— */
.address-page { display: none; }
.address-page.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ——— TRX stats ——— */
.trx-stats {
  display: flex; gap: 16px;
  margin-top: 12px; padding: 14px 20px;
  background: rgba(0,0,0,0.15); border-radius: 12px;
}
.trx-stat-item { display: flex; align-items: center; gap: 8px; }
.trx-stat-label { font-size: 13px; color: rgba(255,255,255,0.5); }
.trx-stat-value { font-size: 15px; font-weight: 600; font-family: 'SF Mono', monospace; }
.trx-stat-item.receive .trx-stat-value { color: #34d399; }
.trx-stat-item.send .trx-stat-value { color: #f87171; }

/* ——— Filter bar ——— */
.filter-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filter-group { display: flex; gap: 8px; }
.filter-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 13px; color: rgba(255,255,255,0.6); cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.filter-btn.active { background: rgba(99,102,241,0.2); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.stats-text { font-size: 13px; color: rgba(255,255,255,0.4); }

/* ——— Tx list ——— */
.tx-list {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px; overflow: hidden;
}
.tx-header {
  display: grid;
  grid-template-columns: 140px 1fr 80px 130px 62px;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.tx-item {
  display: grid;
  grid-template-columns: 140px 1fr 80px 130px 62px;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
}

.col-time { font-size: 15px; color: rgba(255,255,255,0.5); line-height: 1; }
.col-addr-wrap { position: relative; min-width: 0; line-height: 1; }
.col-addr {
  font-size: 15px; font-family: 'SF Mono', monospace;
  cursor: pointer; word-break: break-all;
}
.col-addr.to { color: #34d399; }
.col-addr.from { color: #f87171; }
.tx-copy-tip { font-size: 12px; color: #34d399; display: none; }
.tx-copy-tip.show { display: inline; }

.col-token {
  font-size: 15px; font-family: 'SF Mono', monospace;
  color: rgba(255,255,255,0.5); line-height: 1;
  display: inline-block; justify-self: start;
}
.col-amount {
  font-size: 15px; font-weight: 600; font-family: 'SF Mono', monospace;
  line-height: 1; color: #fff;
  padding: 4px 10px; border-radius: 6px;
  width: fit-content; text-align: left;
}
.col-amount.receive { background: #1a7a4c; }
.col-amount.send { background: #9b2c2c; }

.col-status { text-align: center; 
  font-size: 14px; line-height: 1;
  padding: 3px 0; text-align: center;
}
.col-status.success { color: #34d399; }
.col-status.pending { color: #fbbf24; }
.col-status.error { color: #f87171; }

.empty-state { text-align: center; padding: 60px 20px; color: rgba(255,255,255,0.5); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

.card-search-clear {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.5); cursor: pointer; font-size: 12px;
  flex-shrink: 0;
}
.card-search-clear:hover { background: rgba(255,255,255,0.2); color: #fff; }

.address-page.fading-out { animation: fadeOut 0.25s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }

.tg-link {
  display: inline-block;
  color: rgba(255,255,255,0.5); text-decoration: none;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 16px; border-radius: 8px;
  font-size: 14px; transition: all 0.2s;
}
.tg-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.price-item .icon.eth { background: #627eea; }
.tab-group { display: flex; gap: 8px; }
