/* ==========================================================================
   HOCLAIXESG.COM - RESPONSIVE E-LEARNING LMS LAYOUT (v1.0)
   Áp dụng cho mọi trang: index.html, thi.html, on-luyen.html, tai-khoan.html...
   Không phá CSS hiện tại — chỉ thêm các class chuẩn hóa responsive.
   ========================================================================== */

/* ====== 1. CONTAINER CHUẨN ====== */
:root {
  --container-max: 1200px;
  --container-pad: 16px;
}

.container,
.main-content.is-fluid {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ====== 2. SECTION HEADING CHUẨN ====== */
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
}
.section-heading .num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
.section-heading small {
  font-weight: 500;
  color: #64748b;
  font-size: 0.78rem;
  margin-left: auto;
}

/* ====== 3. DESKTOP NAVBAR ====== */
.desktop-nav {
  display: none;
}

@media (min-width: 992px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    margin: 0 18px;
  }
  .desktop-nav a {
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
  }
  .desktop-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }
  .desktop-nav a.active {
    background: rgba(255, 255, 255, 0.95);
    color: #0d47a1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }
  /* ẨN bottom-nav trên desktop */
  nav.bottom-nav {
    display: none !important;
  }
  /* Bỏ padding-bottom dành cho bottom-nav trên desktop */
  body.has-bottom-nav {
    padding-bottom: 0 !important;
  }
}

/* Mobile (<992px): ẩn desktop-nav, hiện bottom-nav */
@media (max-width: 991.98px) {
  .desktop-nav { display: none !important; }
}

/* ====== 4. STATS-ROW NÂNG CẤP ====== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 767.98px) {
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 380px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* Hiệu ứng hover nhấc thẻ (áp dụng cho các .stat-pill, .license-card, .practice-card) */
.stat-pill,
.license-card,
.practice-card,
.featured-b-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

@media (min-width: 992px) {
  .stat-pill:hover,
  .license-card:hover,
  .practice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
  }
  .featured-b-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -5px rgba(21, 101, 192, 0.25);
  }
}

/* ====== 5. HERO & NỘI DUNG CHÍNH TRÊN DESKTOP ====== */
@media (min-width: 992px) {
  .main-content,
  .content-wrap,
  .container.is-narrow {
    max-width: var(--container-max) !important;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
  }

  /* Giãn cách giữa các khối */
  .content-wrapper {
    gap: 18px;
  }

  /* Stats-row thành 3 cột đều, to hơn */
  .stats-row {
    gap: 14px;
  }
  .stat-pill {
    padding: 16px 12px;
  }
  .stat-pill strong { font-size: 1.15rem; }
  .stat-pill span  { font-size: 0.78rem; }

  /* License-grid: 6 cột pill tab trên desktop */
  .license-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  /* Practice grid: 4 cột trên desktop */
  .practice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px;
  }

  /* Hero card lớn hơn */
  .hero-card-title {
    font-size: 2.2rem !important;
  }
  .hero-stat-value {
    font-size: 1.2rem !important;
  }

  /* Intro hero */
  .intro-title {
    font-size: 1.5rem !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  /* Tablet: 3 cột pill, 3 cột practice */
  .license-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .practice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ====== 6. MOBILE: license chips thanh cuộn ngang ====== */
@media (max-width: 767.98px) {
  .license-grid {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
  }
  .license-grid::-webkit-scrollbar { display: none; }
  .license-card {
    flex: 0 0 auto;
    min-width: 130px;
  }
}

/* ====== 7. BOTTOM NAVBAR MOBILE — chuẩn 60px + safe-area ====== */
nav.bottom-nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid #e2e8f0;
  z-index: 1000;
  justify-content: center;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.06);
}
nav.bottom-nav .bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: 600px;
  align-items: center;
}
nav.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0;
  padding: 6px 0;
  min-height: 48px;
  transition: color 0.15s;
}
nav.bottom-nav .nav-item:hover,
nav.bottom-nav .nav-item:active {
  color: #1a73e8;
}
nav.bottom-nav .nav-item.active {
  color: #1a73e8;
}
nav.bottom-nav .nav-item.active .nav-label {
  font-weight: 800;
}
nav.bottom-nav .nav-icon {
  font-size: 19px;
  line-height: 1;
}
nav.bottom-nav .nav-label {
  font-size: 10.5px;
  letter-spacing: 0.2px;
}
nav.bottom-nav .nav-item.primary-nav .nav-icon {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: -10px;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.35);
}

@media (min-width: 992px) {
  nav.bottom-nav { display: none !important; }
}

/* ====== 8. FAB LIÊN HỆ (Zalo + Hotline) - BỘ 3D ĐỒNG BỘ ====== */
/* Vị trí: mobile bottom: 80px right: 20px | desktop bottom: 30px right: 24px */
.floating-action-menu {
  position: fixed;
  bottom: 80px;          /* mobile: trên bottom-nav */
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}
@media (min-width: 992px) {
  .floating-action-menu {
    bottom: 30px;        /* desktop: dưới cùng */
    right: 24px;
  }
}

.floating-action-menu .fab-3d-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  transition: transform 0.2s ease;
}
.floating-action-menu .fab-3d-btn:active { transform: scale(0.92); }

/* Nút Zalo bóng kính 3D */
.floating-action-menu .fab-3d-zalo {
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #e0f2fe 50%, #bae6fd 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35), inset 0 3px 6px rgba(255, 255, 255, 0.9), inset 0 -4px 6px rgba(2, 132, 199, 0.2);
}
.floating-action-menu .fab-3d-zalo span {
  font-size: 0.9rem;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* Nút Hotline 3D bóng kính màu xanh ngọc / lá cây theo mẫu */
.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, 0.6);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.45), inset 0 3px 6px rgba(255, 255, 255, 0.5), inset 0 -4px 6px rgba(20, 83, 45, 0.4);
  animation: hv-pulse-green 2s infinite;
}
.floating-action-menu .fab-3d-phone svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

@keyframes hv-pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5), 0 8px 20px rgba(22, 163, 74, 0.45), inset 0 3px 6px rgba(255, 255, 255, 0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0), 0 8px 20px rgba(22, 163, 74, 0.45), inset 0 3px 6px rgba(255, 255, 255, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 8px 20px rgba(22, 163, 74, 0.45), inset 0 3px 6px rgba(255, 255, 255, 0.5); }
}

/* Ẩn FAB khi đang trong bài thi hoặc đang xem kết quả (tránh che modal) */
body.exam-active .floating-action-menu,
body.exam-result .floating-action-menu {
  display: none !important;
}

/* Fade-in nhẹ khi load */
.floating-action-menu { animation: hv-fadein 0.4s ease-out; }
@keyframes hv-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== 9. HEADER-ACTIONS desktop ====== */
@media (min-width: 992px) {
  .header-top {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .header-top .app-logo-text {
    font-size: 1.25rem;
  }
}

/* ====== 10. KHOẢNG TRỐNG TRÊN DESKTOP ====== */
@media (min-width: 992px) {
  /* Sticky header cao hơn, padding trên cùng đủ thoáng */
  body {
    padding-top: 0;
  }
  .intro-hero {
    padding-top: 24px;
    padding-bottom: 18px;
  }
  .intro-title {
    font-size: 1.6rem;
  }
  .intro-sub {
    font-size: 0.95rem;
  }
}

/* ====== 11. UTILITY ====== */
.hide-mobile { display: block; }
.hide-desktop { display: none; }
@media (max-width: 991.98px) {
  .hide-mobile  { display: none !important; }
  .hide-desktop { display: block !important; }
}

/* ====== 12. SCROLL SMOOTH CHO THANH HẠNG MOBILE ====== */
@media (max-width: 767.98px) {
  .license-selector {
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

/* ====== 13. KHẮC PHỤC OVERFLOW NGANG TRÊN MOBILE ====== */
html, body {
  overflow-x: hidden;
}

/* ====== 14. BOTTOM-NAV PADDING BOTTOM CHO BODY ====== */
body.has-bottom-nav {
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

/* ====== 15. SYSTEM FONT DEFAULTS (bổ sung - đề phòng trang chưa load fonts.css) ====== */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font-family: inherit; }
