/* ==========================================================================
   ERASIGHT ACADEMY — REUSABLE HEADER & FOOTER STYLES
   Bộ giao diện Header & Footer chuẩn dùng chung cho tất cả các trang
   ========================================================================== */

:root {
  --header-height: 76px;
  --hf-font-main: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hf-font-display: 'Bricolage Grotesque', sans-serif;
  --hf-font-mono: 'JetBrains Mono', monospace;
  
  --hf-teal: #0DA096;
  --hf-teal-dark: #07736C;
  --hf-teal-light: #E2F5F3;
  --hf-orange: #E85D04;
  --hf-orange-hover: #cf5003;
  --hf-blue: #2176C7;
  --hf-dark: #0C2A3A;
  --hf-ink: #0C2A3A;
  --hf-slate: #4A6572;
  --hf-line: #E8EFEF;
  --hf-white: #FFFFFF;
}

/* --------------------------------------------------------------------------
   1. SITE HEADER & FLOATING GLASS PILL EFFECT
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #FFFFFF;
  border-bottom: 1px solid var(--hf-line);
  box-shadow: 0 2px 14px rgba(12, 42, 58, 0.04);
  font-family: var(--hf-font-main);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

/* Floating Glass Pill State when Scrolled (cotrain-inspired design) */
.site-header.is-scrolled {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  width: calc(100% - 48px);
  max-width: 1160px;
  margin: 0 auto;
  border-radius: 9999px;
  background: rgba(12, 42, 58, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 1000;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s ease;
}

.site-header.is-scrolled .site-header-inner {
  height: 60px;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .site-header-inner {
    padding: 0 20px;
    height: 70px;
  }
  .site-header.is-scrolled {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    width: calc(100% - 24px);
    border-radius: 18px;
  }
  .site-header.is-scrolled .site-header-inner {
    height: 58px;
    padding: 0 16px;
  }
}

/* Scrolled Elements Overrides */
.site-header.is-scrolled .site-brand img {
  height: 32px;
  filter: brightness(0) invert(1);
}

.site-header.is-scrolled .nav-link {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14.5px;
}

.site-header.is-scrolled .nav-link:hover {
  color: #00E5D4;
}

.site-header.is-scrolled .nav-link.nav-link--active,
.site-header.is-scrolled .nav-link.active,
.site-header.is-scrolled .nav-link.is-current {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 6px 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.site-header.is-scrolled .nav-link-caret {
  color: rgba(255, 255, 255, 0.75);
}

.site-header.is-scrolled .btn-login {
  color: #FFFFFF;
}

.site-header.is-scrolled .btn-login:hover {
  color: #00E5D4;
}

.site-header.is-scrolled .btn-enroll {
  border-radius: 9999px;
  padding: 8px 20px;
  font-size: 13.5px;
  box-shadow: 0 4px 15px rgba(232, 93, 4, 0.35);
}

.site-header.is-scrolled .mobile-toggle-btn span {
  background: #FFFFFF;
}

.site-header.is-scrolled .dropdown-panel {
  top: calc(100% + 14px);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

/* Header Brand / Logo */
.site-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-brand:hover {
  opacity: 0.9;
}

.site-brand img {
  height: 42px;
  width: auto;
  display: block;
}

@media (max-width: 480px) {
  .site-brand img {
    height: 35px;
  }
}

/* Main Navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0 auto; /* Căn giữa nav */
}

@media (max-width: 1060px) {
  .site-nav {
    gap: 22px;
  }
}

.nav-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--hf-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--hf-teal);
}

.nav-link.active {
  color: var(--hf-ink);
  font-weight: 700;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--hf-orange);
  border-radius: 2px;
}

.nav-link-caret {
  width: 10px;
  height: 6px;
  display: inline-block;
  transition: transform 0.25s ease;
  fill: currentColor;
}

/* Dropdown Menu Khoá Học & Resource */
.nav-dropdown {
  position: relative;
  /* Mở rộng nhẹ vùng hover của container */
  padding-bottom: 6px;
  margin-bottom: -6px;
}

.nav-dropdown:hover .nav-link-caret,
.nav-dropdown.is-open .nav-link-caret {
  transform: rotate(180deg);
  color: var(--hf-teal);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #FFFFFF;
  min-width: 330px;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 14px 40px rgba(12, 42, 58, 0.12), 0 2px 6px rgba(12, 42, 58, 0.04);
  border: 1px solid var(--hf-line);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Đóng êm với độ trễ 200ms: tránh bị tắt đột ngột khi di chuột chéo qua khoảng trống */
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
              visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
  z-index: 1010;
}

/* Vùng đệm vô hình (Hover Bridge) lấp đầy khoảng hở giữa nút trigger và panel menu */
.dropdown-panel::after {
  content: '';
  position: absolute;
  top: -16px;
  left: -20px;
  right: -20px;
  height: 20px;
  background: transparent;
  pointer-events: auto;
}

/* Tam giác chỉ dropdown */
.dropdown-panel::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-left: 1px solid var(--hf-line);
  border-top: 1px solid var(--hf-line);
  z-index: 2;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel,
.nav-dropdown.is-open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  /* Mở tức thì khi rê chuột vào */
  transition-delay: 0s;
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.dropdown-item:hover {
  background: #F4FAF9;
}

.dropdown-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--hf-font-mono);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  margin-top: 2px;
}

.dropdown-badge.badge-orange {
  background: #FDE7D6;
  color: var(--hf-orange);
}

.dropdown-badge.badge-blue {
  background: #E9F2FB;
  color: var(--hf-blue);
}

.dropdown-badge.badge-teal {
  background: var(--hf-teal-light);
  color: var(--hf-teal-dark);
}

/* Mục dropdown / mobile ứng với trang đang xem */
.dropdown-item.is-current {
  background: #F4FAF9;
  box-shadow: inset 3px 0 0 var(--hf-orange);
}

.dropdown-item.is-current .dropdown-title,
.mobile-nav-sublink.is-current {
  color: var(--hf-teal-dark);
  font-weight: 700;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dropdown-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--hf-ink);
  line-height: 1.3;
}

.dropdown-item:hover .dropdown-title {
  color: var(--hf-teal);
}

.dropdown-desc {
  font-size: 12.5px;
  color: var(--hf-slate);
  line-height: 1.4;
}

.dropdown-footer {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--hf-line);
  text-align: center;
}

.dropdown-footer-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--hf-teal-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.dropdown-footer-link:hover {
  color: var(--hf-orange);
}

/* Header Right Actions */
.site-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.btn-login {
  font-size: 15px;
  font-weight: 600;
  color: var(--hf-ink);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-login:hover {
  color: var(--hf-teal);
  background: rgba(13, 160, 150, 0.06);
}

.btn-enroll {
  background: var(--hf-orange);
  color: #FFFFFF !important;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(232, 93, 4, 0.22);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-enroll:hover {
  background: var(--hf-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 93, 4, 0.32);
}

.btn-enroll:active {
  transform: translateY(0);
}

/* Mobile Toggle Hamburger */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  z-index: 1020;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--hf-ink);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.mobile-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-toggle.is-active span:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer Overlay & Panel */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 42, 58, 0.45);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-bottom: 2px solid var(--hf-line);
  box-shadow: 0 16px 36px rgba(12, 42, 58, 0.12);
  padding: 24px 20px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 999;
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.25s ease;
}

.mobile-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-item {
  font-size: 16px;
  font-weight: 600;
  color: var(--hf-ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.mobile-nav-sublist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 6px 14px;
  border-left: 2px solid var(--hf-teal-light);
  margin-top: -6px;
}

.mobile-nav-sublink {
  font-size: 14.5px;
  color: var(--hf-slate);
  text-decoration: none;
  font-weight: 500;
}

.mobile-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--hf-line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-actions .btn-login {
  text-align: center;
  padding: 12px;
  border: 1px solid var(--hf-line);
}

.mobile-actions .btn-enroll {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

@media (max-width: 960px) {
  .site-nav,
  .site-actions {
    display: none;
  }
  .mobile-toggle {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   2. MODERN SITE FOOTER (TECH NEWSLETTER BANNER + NOTCH + 5-COLUMN GRID)
   Được thiết kế đồng bộ theo layout hiện đại chuẩn EdTech
   -------------------------------------------------------------------------- */
footer,
.site-footer {
  padding: 0 !important;
  margin: 0 !important;
  background: #06111A;
  color: #8E9CA4;
  font-family: var(--hf-font-main);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

/* 2.1 Newsletter Banner */
.footer-newsletter-wrap {
  position: relative;
  background-color: #063732;
  background-image: 
    radial-gradient(ellipse at 50% 30%, #0d5f57 0%, rgba(6, 45, 41, 0.95) 75%),
    radial-gradient(rgba(255, 255, 255, 0.22) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 14px 14px;
  padding: 68px 24px 64px;
  text-align: center;
  color: #FFFFFF;
}

.footer-newsletter-inner {
  max-width: 820px;
  margin: 0 auto;
}

.footer-newsletter-title {
  font-family: var(--hf-font-display);
  font-style: italic;
  font-size: 38px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .footer-newsletter-title {
    font-size: 27px;
  }
}

.footer-newsletter-desc {
  font-style: italic;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto 30px;
}

.footer-newsletter-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

@media (max-width: 520px) {
  .footer-newsletter-form {
    flex-direction: column;
    width: 100%;
  }
}

.footer-newsletter-input {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 13px 20px;
  font-size: 15px;
  color: #0C2A3A;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.footer-newsletter-input:focus {
  border-color: #00E5D4;
  box-shadow: 0 0 0 3px rgba(0, 229, 212, 0.25);
}

.footer-newsletter-btn {
  background: #FFFFFF;
  color: #0C2A3A;
  border: none;
  border-radius: 8px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.footer-newsletter-btn:hover {
  background: #00E5D4;
  color: #06111A;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 229, 212, 0.35);
}

/* 2.2 Modern Notch Ribbon Bar with Cyan Outline (Centered & Balanced) */
.footer-notch-wrap {
  position: relative;
  width: 100%;
  background: #06111A;
  margin-top: -1px;
}

.footer-notch-bar {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  height: 54px;
  padding: 0 40px;
}

/* Logo di dời theo hướng mũi tên và căn chính giữa cánh trái (lấy center) */
.footer-notch-brand {
  width: calc(50% - 430px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transform: translateY(2px);
}

.footer-notch-brand img {
  height: 28px;
  width: auto;
  display: block;
}

/* Phần màu xanh kéo dài (600px) căn giữa hoàn hảo */
.footer-notch-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  height: 54px;
  width: 600px;
  max-width: calc(100% - 48px);
  z-index: 1;
  pointer-events: none;
}

.footer-notch-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Cụm theo dõi di dời theo hướng mũi tên và căn chính giữa cánh phải (lấy center) */
.footer-notch-social {
  width: calc(50% - 430px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 3;
  transform: translateY(2px);
}

.footer-notch-social-title {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
}

.footer-notch-social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icon-btn:hover {
  background: #00E5D4;
  color: #06111A;
  transform: translateY(-2px);
}

@media (max-width: 1060px) {
  .footer-notch-brand,
  .footer-notch-social {
    width: auto;
  }
  .footer-notch-social-title {
    display: none;
  }
  .footer-notch-bar {
    padding: 0 20px;
  }
}

@media (max-width: 860px) {
  .footer-notch-bar {
    height: auto;
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    align-items: center;
  }
  .footer-notch-center {
    display: none;
  }
  .footer-notch-brand {
    width: auto;
    justify-content: center;
  }
  .footer-notch-social {
    width: auto;
    justify-content: center;
  }
  .footer-notch-social-title {
    display: inline-block;
  }
}

/* 2.3 5-Column Modern Footer Grid (Centered & Balanced Spacing, No Empty Margins) */
.footer-body {
  padding: 52px 0 44px;
  background: #06111A;
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 40px;
}

.footer-grid-5col {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.3fr auto;
  gap: 52px;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

.footer-col:last-child {
  justify-self: end;
}

@media (max-width: 1080px) {
  .footer-grid-5col {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 36px;
  }
}

@media (max-width: 768px) {
  .footer-grid-5col {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-col h4 {
  font-family: var(--hf-font-display);
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-col a {
  color: #8E9CA4;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  display: inline-block;
}

.footer-col a:hover {
  color: #FFFFFF;
}

.footer-company-info {
  font-size: 13px;
  color: #7B8B95;
  line-height: 1.7;
}

.footer-company-info p {
  margin-bottom: 7px;
}

/* 2.4 Bottom Copyright Bar */
.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #5F6F79;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

.footer-mono-badge {
  font-family: var(--hf-font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* 2.5 Floating Zalo Consultation Widget */
.floating-zalo-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0068FF;
  box-shadow: 0 8px 24px rgba(0, 104, 255, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
}

.floating-zalo-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 104, 255, 0.55);
}

.floating-zalo-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #FF3B30;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

/* Mục đang xem trong menu mobile (dùng chung cho mọi trang) */
.mobile-nav-item--active {
  color: var(--hf-teal, #0DA096) !important;
  font-weight: 700;
}
