/* =====================================================================
   HVote – giao dien mobile (bau cu / binh chon Web6)
   - 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, .45);
  --glow: rgba(124, 58, 237, .45);
  --gold: #f5c451;
  --cyan: #38bdf8;
  --purple: #9b5cf6;
  --txt: #f3f0ff;
  --muted: #b9aed4;
}

* { 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;
  /* anh nen PNG cho toan bo web (thay public/bg-app.png de doi nen) */
  background: #07050f 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; }

/* ======================= Header: toan bo la 1 anh PNG (khong nut) ======================= */
.header-banner { width: 100%; height: auto; }

/* ===== Ho so cong dan + 2 stat nen chung 1 hang (chieu ngang = chieu ngang 2 banner ben duoi) ===== */
.profile-row {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 16px; padding: 9px 10px;
  background: rgba(20,12,38,.55);
  box-shadow: 0 0 10px var(--glow), inset 0 0 16px rgba(124,58,237,.08);
}
.profile-avatar {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--cyan); box-shadow: 0 0 10px rgba(56,189,248,.5);
}
.profile-info { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.profile-name { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-name strong { font-weight: 800; }
.citizen-tag {
  display: inline-flex; align-items: center; gap: 3px; width: fit-content;
  font-size: 8.5px; font-weight: 700; color: var(--cyan);
  border: 1px solid rgba(56,189,248,.5); border-radius: 99px; padding: 0 6px;
}
.citizen-tag i { font-style: normal; }
.profile-id { font-size: 8.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stat-box {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); border-radius: 11px; padding: 6px 8px;
  background: rgba(10,6,20,.5);
}
.stat-ic {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #34d399, #059669); color: #fff; font-size: 12px; font-weight: 900;
  flex: 0 0 auto;
}
.stat-ic-img { width: 22px; height: 22px; flex: 0 0 auto; }
.stat-box strong { display: block; font-size: 8px; white-space: nowrap; }
.stat-box small { display: block; font-size: 10px; font-weight: 800; color: var(--gold); white-space: nowrap; }

/* ===== 2 the lon: bau cu / binh chon ===== */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.feature-card {
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 5 / 7;
  border: 1.5px solid var(--line);
  box-shadow: 0 0 10px var(--glow);
}
.feature-baucu { border-color: rgba(155,92,246,.55); box-shadow: 0 0 12px rgba(155,92,246,.35); }
.feature-binhchon { border-color: rgba(56,189,248,.55); box-shadow: 0 0 12px rgba(56,189,248,.35); }
.feature-card img { width: 100%; height: 100%; object-fit: cover; }
/* nut TU CODE: khung bo tron, de len duoi anh */
.feature-btn {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  height: 34px; border-radius: 99px;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: rgba(8,4,18,.55); backdrop-filter: blur(3px);
}
.feature-baucu .feature-btn { border: 1.5px solid #c084fc; color: #e9d5ff; box-shadow: 0 0 10px rgba(155,92,246,.6); }
.feature-binhchon .feature-btn { border: 1.5px solid #7dd3fc; color: #e0f2fe; box-shadow: 0 0 10px rgba(56,189,248,.6); }
.feature-btn i { font-style: normal; }

/* ===== hang truot ngang chung ===== */
.hscroll {
  display: flex; gap: 10px; margin-top: 12px;
  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; }

/* ===== hang nhanh: moi icon la 1 anh PNG day du (co san chu + badge) ===== */
.quick-actions { gap: 10px; }
.quick { flex: 0 0 76px; }
.quick img { width: 100%; height: auto; border-radius: 12px; }

/* ===== cuoc bau cu / binh chon dang dien ra ===== */
.ongoing-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.ongoing-head h2 { font-size: 12.5px; font-weight: 800; letter-spacing: .3px; color: var(--txt); }
.see-all { font-size: 11px; color: var(--cyan); }
.ongoing-card {
  flex: 0 0 190px; border: 1.5px solid var(--line); border-radius: 13px; overflow: hidden;
  background: rgba(20,12,38,.55); box-shadow: 0 0 8px var(--glow);
  padding-bottom: 10px;
}
.og-img { position: relative; }
.og-img img { width: 100%; height: 110px; object-fit: cover; }
.og-tag {
  position: absolute; top: 8px; left: 8px; font-size: 9px; font-weight: 800;
  padding: 2px 7px; border-radius: 5px; color: #fff;
}
.og-tag.hot { background: #ef3b3b; box-shadow: 0 0 8px rgba(239,59,59,.7); }
.og-tag.new { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.7); }
.ongoing-card h3 { font-size: 11.5px; font-weight: 700; line-height: 1.3; padding: 8px 10px 4px; min-height: 44px; }
.og-meta { font-size: 9.5px; color: var(--muted); padding: 0 10px; }
.og-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.12); margin: 6px 10px 4px; overflow: hidden; }
.og-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); }
.og-pct { font-size: 10px; font-weight: 800; color: var(--cyan); text-align: right; padding: 0 10px; }

/* ===== cong nghe blockchain luong tu: 1 anh PNG duy nhat ===== */
.tech-banner { width: 100%; height: auto; margin-top: 16px; border-radius: 16px; }

/* ============== BOTTOM NAV (5 muc, port tu hgo) ============== */
.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(18,10,32,.92), rgba(8,5,16,.98));
  border-top: 1px solid #2e2148;
  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: #8a80a8; font-size: 10px;
}
.nav-item img { width: 22px; height: 22px; filter: brightness(1.5) opacity(.65); }
.nav-item.active { color: var(--cyan); }
.nav-item.active img { filter: drop-shadow(0 0 6px rgba(56,189,248,.6)) brightness(1.6); }
.nav-item-badge { position: relative; display: inline-flex; }
.nav-item-badge i {
  position: absolute; top: -10px; right: -10px; font-style: normal;
  min-width: 14px; height: 14px; border-radius: 99px; background: #ef3b3b; color: #fff;
  font-size: 8.5px; font-weight: 800; line-height: 14px; text-align: center;
}
.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(56,189,248,.6);
}
