/* hlx-base.css — fonts + shell + footer + chrome */

/* Be Vietnam Pro */
:root {
  --font-base: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html, body, button, input, textarea, select {
  font-family: var(--font-base);
  -webkit-font-smoothing: antialiased;
}
code, kbd, samp, pre, .mono, .timer, .countdown, .exam-timer, .question-counter {
  font-family: var(--font-mono);
}


/* Cùng khung với phần dưới trang chủ: giữa màn hình, không dạt trái/phải */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: border-box; }

body.has-bottom-nav {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
}

.app-header,
.app-header .header-top {
  width: 100%;
  max-width: 100%;
}

.page-shell,
.main-content,
.auth-wrap {
  width: 100% !important;
  max-width: 600px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 16px 16px 28px !important;
  box-sizing: border-box !important;
}

/* Khối con không cộng padding lần 2 */
.history-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media (min-width: 768px) {
  .page-shell,
  .main-content,
  .auth-wrap {
    max-width: 720px !important;
    padding: 20px 20px 32px !important;
  }
}
@media (min-width: 992px) {
  .page-shell,
  .main-content,
  .auth-wrap {
    max-width: 960px !important;
    padding: 24px 24px 36px !important;
  }
}

.history-card,
.leaderboard-card,
.auth-card,
.empty-history {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.history-card table,
.leaderboard-card table {
  width: 100%;
  table-layout: auto;
}
.history-card th,
.history-card td,
.leaderboard-card th,
.leaderboard-card td {
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Bảng vàng: mobile không vỡ cột / không dựng đứng tên */
.leaderboard-card {
  overflow-x: visible;
}
.lb-name {
  display: inline !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: break-word !important;
  line-height: 1.35 !important;
}
.lb-tag-vip,
.lb-tag-tuDo {
  writing-mode: horizontal-tb !important;
  display: inline-block !important;
  vertical-align: middle;
}
@media (max-width: 720px) {
  .leaderboard-card table thead {
    display: none !important;
  }
  .leaderboard-card table,
  .leaderboard-card table tbody {
    display: block;
    width: 100%;
  }
  .leaderboard-card table tr {
    display: grid !important;
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "rank name"
      "rank score"
      "rank time";
    align-items: start;
    gap: 2px 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #F1F5F9;
    box-sizing: border-box;
  }
  .leaderboard-card table td {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
  }
  .leaderboard-card table td:nth-child(1) { grid-area: rank; }
  .leaderboard-card table td:nth-child(2) { grid-area: name; }
  .leaderboard-card table td:nth-child(3) { display: none !important; } /* Hạng GPLX */
  .leaderboard-card table td:nth-child(4) { grid-area: score; }
  .leaderboard-card table td:nth-child(5) { grid-area: time; }
}

/* Nav đáy — 5 cột đều, full width như trang chủ */
nav.bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  background: #fff !important;
  z-index: 1000 !important;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08) !important;
}
nav.bottom-nav .bottom-nav-inner {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  height: 56px !important;
  padding: 0 !important;
}
@media (min-width: 768px) {
  nav.bottom-nav .bottom-nav-inner { max-width: 720px !important; }
}
nav.bottom-nav .nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 2px;
}
nav.bottom-nav .nav-label {
  font-size: 10px !important;
  line-height: 1.1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}


/* ==========================================================================
   HOCLAIXESG - FOOTER CHÍNH (v1.0)
   Áp dụng cho toàn bộ thư mục /thithu: index, thi, on-luyen, tai-khoan, thanh-tich
   - Grid 3 cột desktop, 1 cột mobile.
   - System Font Stack chuẩn.
   ========================================================================== */

.hlxs-footer {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 60%, #1976d2 100%);
  color: #e2e8f0;
  margin-top: 36px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hlxs-footer *,
.hlxs-footer *::before,
.hlxs-footer *::after { box-sizing: border-box; }

/* Container */
.hlxs-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 22px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

/* Desktop: 3 cột */
@media (min-width: 992px) {
  .hlxs-footer-inner {
    grid-template-columns: 1.3fr 1fr 1.1fr;
    gap: 36px;
    padding: 48px 24px 28px;
  }
}

/* Cột */
.hlxs-footer-col h4 {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: 0.2px;
}
.hlxs-footer-col p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #cbd5e1;
}

/* Logo */
.hlxs-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.hlxs-footer-brand .hlxs-footer-logo {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #e3f2fd 55%, #bbdefb 100%);
  color: #0d47a1;
  font-weight: 900;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  letter-spacing: -0.4px;
  border: 1px solid rgba(255,255,255,.8);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.95),
    inset 0 -3px 0 rgba(13,71,161,.12),
    0 4px 0 #0a3a86,
    0 8px 16px rgba(0,0,0,.28);
}
.hlxs-footer-brand .hlxs-footer-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}
.hlxs-footer-brand .hlxs-footer-name small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Liên kết nhanh */
.hlxs-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hlxs-footer-links li { margin-bottom: 8px; }
.hlxs-footer-links a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, transform 0.15s;
  padding: 2px 0;
}
.hlxs-footer-links a::before {
  content: "›";
  color: #90caf9;
  font-weight: 700;
  margin-right: 2px;
}
.hlxs-footer-links a:hover {
  color: #ffffff;
  transform: translateX(2px);
}

/* Liên hệ */
.hlxs-footer-contact {
  font-size: 0.92rem;
}
.hlxs-footer-contact .hlxs-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  color: #cbd5e1;
}
.hlxs-footer-contact .hlxs-contact-row strong {
  color: #ffffff;
  font-weight: 700;
}
.hlxs-footer-contact .hlxs-hotline {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.hlxs-footer-contact .hlxs-hotline:hover { color: #ffe082; }

.hlxs-3d-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #e2e8f0;
  text-decoration: none;
}
.hlxs-3d-row strong { display: block; color: #fff; font-size: 1.05rem; }
.hlxs-3d-row small { display: block; color: #cbd5e1; font-size: 0.78rem; margin-top: 1px; }
.hlxs-3d-ico {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 900; font-size: 0.95rem; color: #fff;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.35),
    inset 0 -3px 0 rgba(0,0,0,.18),
    0 4px 0 rgba(0,0,0,.22),
    0 8px 14px rgba(0,0,0,.22);
}
.hlxs-3d-ico.phone { background: linear-gradient(180deg, #4ade80, #16a34a 58%, #15803d); }
.hlxs-3d-ico.zalo { background: linear-gradient(180deg, #7dd3fc, #0284c7 58%, #0369a1); }
.hlxs-3d-ico.fb { background: linear-gradient(180deg, #60a5fa, #2563eb 58%, #1d4ed8); font-size: 1.2rem; }
.hlxs-3d-ico.tt { background: linear-gradient(180deg, #67e8f9, #111827 58%, #000); }
.hlxs-3d-ico.clock {
  background: linear-gradient(180deg, #fdba74, #f97316 58%, #c2410c);
  font-size: 1rem;
}

/* Huy hiệu */
.hlxs-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.hlxs-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
  color: #cbd5e1;
  text-decoration: none;
  white-space: nowrap;
}
.hlxs-footer-badge:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.hlxs-footer-badge .icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.65rem;
  font-weight: 800;
}

/* Đáy */
.hlxs-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.12);
}
body.has-bottom-nav .hlxs-footer-bottom {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.hlxs-footer-bottom a {
  color: #ffe082;
  text-decoration: none;
  font-weight: 600;
}
.hlxs-footer-bottom a:hover { text-decoration: underline; }


/* HocLaiXeSG — header + dock toàn màn hình dùng chung
   Áp dụng: index, on-luyen, thanh-tich, tai-khoan. KHÔNG đụng thi.html khi đang thi. */

:root {
  --ry-red: #c75b4e;
  --ry-red-dark: #b14a3f;
  --primary-dark: #b14a3f;
  --primary-gradient: linear-gradient(180deg, #d9897e 0%, #c75b4e 100%);
}

.app-header {
  background: var(--primary-gradient);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(177, 74, 63, 0.22);
}
.app-header a { text-decoration: none; color: inherit; }
.app-header .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  min-height: 64px;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.app-logo-icon {
  background: #fff;
  color: var(--ry-red-dark);
  font-weight: 900;
  font-size: 0.72rem;
  padding: 5px 8px;
  border-radius: 8px;
  letter-spacing: 0.4px;
}
.app-logo-text {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.15;
}
.app-logo-text small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255,255,255,.86);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.header-btn {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.05rem;
}
.header-btn:hover { background: rgba(255,255,255,.28); }

.desktop-nav {
  display: none;
}
@media (min-width: 992px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
  }
  .desktop-nav a {
    color: rgba(255,255,255,.92) !important;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none !important;
    white-space: nowrap;
  }
  .desktop-nav a:hover {
    background: rgba(255,255,255,.16);
    color: #fff !important;
  }
  .desktop-nav a.active {
    background: #fff;
    color: var(--ry-red-dark) !important;
  }
  nav.bottom-nav { display: none !important; }

  /* Ôn luyện: bỏ header mobile (mũi tên + chữ dính) */
  .ol-header { display: none !important; }

  .ol-search-bar {
    width: 100% !important;
    max-width: 960px !important;
    margin: 14px auto 0 !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
  }
  .ol-search-input {
    width: 100% !important;
  }
  .ol-hang-bar {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
  .ol-main {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 991.98px) {
  .desktop-nav { display: none !important; }
  body.has-hlx-chrome .ol-header { display: none !important; }
}

body.has-hlx-chrome .ol-header { display: none !important; }

/* Ẩn nút đen cũ "Toàn màn hình" */
.fs-btn { display: none !important; }

/* Dock: Trang chủ xanh + nút icon — hover hiện chữ */
.hlx-fs-dock {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hlx-fs-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  background: #16a34a;
  color: #fff !important;
  font-weight: 800;
  font-size: 15px;
  border-radius: 12px;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(22,163,74,.28);
}
.hlx-fs-home:hover { background: #15803d; color: #fff !important; }

.hlx-fs-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(15,23,42,.12);
  color: #111;
}
.hlx-fs-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}
.hlx-fs-tip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}
.hlx-fs-btn:hover .hlx-fs-tip,
.hlx-fs-btn:focus .hlx-fs-tip {
  opacity: 1;
  transform: translateY(0);
}

body.exam-active .hlx-fs-dock,
body.practice-active .hlx-fs-dock,
.ol-practice-screen.active ~ .hlx-fs-dock {
  display: none !important;
}

/* FAB Zalo + gọi — style nằm ở đây vì index/thanh-tich không load responsive.css.
   SVG không có width thì phình full viewport (lỗi 26/09). */
.floating-action-menu {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 56px;
  max-width: 56px;
  overflow: visible;
  pointer-events: none;
}
.floating-action-menu .fab-3d-btn {
  pointer-events: auto;
  box-sizing: border-box;
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  flex: 0 0 52px;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden !important;
}
.floating-action-menu .fab-3d-btn svg,
.floating-action-menu .fab-3d-phone svg,
.floating-action-menu .fab-3d-btn img {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  flex: 0 0 22px;
  display: block;
}
.floating-action-menu .fab-3d-zalo {
  background: radial-gradient(circle at 30% 30%, #fff 0%, #e0f2fe 50%, #bae6fd 100%);
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 8px 20px rgba(14,165,233,.35), inset 0 3px 6px rgba(255,255,255,.9);
}
.floating-action-menu .fab-3d-zalo span {
  font-size: 11px;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: -.3px;
  line-height: 1;
}
.floating-action-menu .fab-3d-phone {
  background: radial-gradient(circle at 35% 35%, #4ade80 0%, #16a34a 50%, #15803d 100%);
  border: 2px solid rgba(255,255,255,.6);
  box-shadow: 0 8px 20px rgba(22,163,74,.45), inset 0 3px 6px rgba(255,255,255,.5);
  color: #fff;
}
.floating-action-menu .fab-3d-phone svg { fill: #fff; color: #fff; }
@media (max-width: 768px) {
  .floating-action-menu { bottom: 78px; right: 14px; }
}

/* Trang chủ: không hiện nút Trang chủ. Desktop ẩn FAB Zalo/gọi. */
body.page-index .hlx-fs-home { display: none !important; }

@media (min-width: 992px) {
  .floating-action-menu,
  .fab-3d-btn,
  .hv-fab,
  #button-widget,
  .zalo-chat-widget,
  iframe[src*="zalo"] {
    display: none !important;
  }

  .hlx-fs-dock {
    right: 20px;
    bottom: 24px;
    z-index: 60;
  }

  body.page-index .main-content,
  body.page-index .content-wrapper {
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

html:fullscreen body.page-index .main-content,
html:fullscreen body.page-index .content-wrapper,
:-webkit-full-screen body.page-index .main-content {
  max-width: 1180px !important;
}
html:fullscreen .floating-action-menu,
:-webkit-full-screen .floating-action-menu {
  display: none !important;
}
