/* ==== Reset & base ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  /*font-family: 'Poppins', sans-serif;*/
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  color: #0a1f44;
  line-height: 1.6;
}

html {
  scroll-behavior: smooth; /* hiệu ứng cuộn mượt */
  scroll-padding-top: 80px; /* chừa ra khoảng header */
}

a {
  color: inherit;
  text-decoration: none;
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}
h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #0a1f44;
}

/* ==== Top Bar ==== */
.top-bar {
  background: #0a1f44;
  color: #ffffff;
  font-size: 0.9rem;
  padding: 0.5rem 0;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ==== Header + Menu 04/7/2025==== */
body {
  font-family: 'Inter', sans-serif;
}

/* ======= MAIN HEADER ======= */
.main-header {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 999;
}
.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
}

/* ======= LOGO ======= */
.logo img {
  height: 60px;
  width: auto;
}

/* ======= DESKTOP MENU ======= */

.main-nav > ul {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav li {
  position: relative;
  list-style: none;
}

.main-nav li a {
  padding: 12px 16px;
  text-decoration: none;
  color: #0a1f44;
}

.has-sub:hover .sub-menu {
  display: block;
}

.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  min-width: 200px;
  flex-direction: column;
  z-index: 1000;
  padding: 0;
}

.sub-menu li {
  display: block;
  width: 100%;
  list-style: none;
}

.sub-menu li a {
  padding: 10px 16px;
  display: block;
  color: #333;
  white-space: nowrap;
}

/* ========== Hi?u ?ng hover link (underline from left) ========== */
.main-nav li a {
  position: relative;
  padding: 12px 16px;
  text-decoration: none;
  color: #0a1f44;
  font-weight: 500;
  transition: color 0.3s ease;
}

.main-nav li a::after {
  content: '';
  position: absolute;
  left: 16px;
  bottom: 6px;
  width: 0;
  height: 2px;
  background: #0056b3;
  transition: width 0.3s ease;
}

.main-nav li a:hover::after {
  width: calc(100% - 32px); /* Tr? padding tr�i/ph?i */
}

.main-nav li a:hover {
  color: #0056b3;
}

/* ========== Submenu v?i hi?u ?ng fade + slide ========== */
.sub-menu {
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  min-width: 200px;
  padding: 0;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.has-sub:hover .sub-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0px);
}

/* Submenu item */
.sub-menu li a {
  padding: 10px 16px;
  display: block;
  color: #333;
  transition: background 0.3s;
}

.sub-menu li a:hover {
  background: #eef4ff;
  color: #0056b3;
}


/* ======= MOBILE TOGGLE ======= */
.menu-toggle {
  display: none;
  font-size: 24px;
  color: #0a1f44;
  cursor: pointer;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

/* ======= MOBILE NAV ======= */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
  }

  .main-nav ul {
    flex-direction: column;
    background: white;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 0 0 8px 8px;
  }

  .main-nav li {
    border-top: 1px solid #eee;
  }

  .main-nav li a {
    padding: 14px;
    color: #0a1f44;
  }

  .sub-menu {
    position: relative;
    background: #f9f9f9;
    box-shadow: none;
    border-radius: 0;
  }
}

/* Hero đáp ứng chiều cao theo màn nhỏ 14/8/2025 ---*/
/*
.hero-slide { width:100%; height: 70vh; max-height: 680px; position:relative; overflow:hidden; }
@media (max-width: 991px){ .hero-slide { height: 55vh; max-height:520px; } }
@media (max-width: 480px){ .hero-slide { height: 45vh; max-height:440px; } }

.hero-slide .swiper, .hero-slide .swiper-slide { width:100%; height:100%; }
.hero-slide .swiper-slide img { width:100%; height:100%; object-fit: cover; object-position: center; }
.slide-caption h2 { font-size: clamp(20px, 4.5vw, 32px); }
.slide-caption p  { font-size: clamp(14px, 3.5vw, 18px); }
*/

/* Hero đáp ứng chiều cao theo màn nhỏ 14/8/2025 --- */
.hero-slide {
  width: 100%;
  height: min(70vh, 680px);   /* ưu tiên nhỏ hơn giữa 70vh và 680px */
  position: relative;
  overflow: hidden;
}

@media (max-width: 991px) {
  .hero-slide {
    height: min(55vh, 520px);
  }
}

@media (max-width: 480px) {
  .hero-slide {
    height: min(45vh, 440px);
  }
}

.slide-caption h2 {
  font-size: clamp(20px, 4.5vw, 32px);
}

.slide-caption p {
  font-size: clamp(14px, 3.5vw, 18px);
}

.hero-slide { height: min(70vh, 680px); }
.hero-slide .swiper, .hero-slide .swiper-slide { height:100%; }
.hero-slide .swiper-slide img { width:100%; height:100%; object-fit: cover; }

/* ==== Section chung ==== */
.section {
  padding: 60px 0;
}
.grid-3, .grid-4 {
  display: grid;
  gap: 2rem;
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ?? Section Gi?i thi?u */
.about {
  padding: 60px 0;
  background-color: #fff;
}

.about .section-title {
  text-align: center;
  color: #0a1f44;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 40px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.about-box {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.about-box:hover {
  border-bottom: 2px solid #0a1f44;
}

.about-box h4 {
  color: #0a1f44;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-box i {
  color: #ffc107;
  font-size: 1.1rem;
}

/*-----------end c?p nh?t 25/6/2025 ------*/

/* ==== Course Cards ==== */
.course-card {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.course-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.course-card h4 {
  font-size: 1.2rem;
  padding: 1rem 1rem 0.5rem;
}
.course-card p {
  padding: 0 1rem 1rem;
}
.course-card .btn {
  display: block;
  margin: 0 1rem 1rem;
  text-align: center;
  background: #ffc107;
  color: #0a1f44;
  padding: 0.5rem;
  border-radius: 4px;
  font-weight: bold;
}

.khoa-hoc-section {
  padding: 40px 20px;
  background: #f9f9f9;
  text-align: center;
}

.khoa-hoc-section .title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.slider-wrapper {
  position: relative;
  overflow: hidden;
}

.khoa-hoc-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 10px;
  justify-content: flex-start;
}

.khoa-hoc-slider::-webkit-scrollbar {
  display: none;
}
.khoa-hoc-slider {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.khoa-hoc-box {
  flex: 0 0 280px;
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  scroll-snap-align: start;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.khoa-hoc-box:hover {
  transform: translateY(-5px);
}

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: crimson;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 8px;
}

.tag.hot { background: #e60000; }
.tag.new { background: #007bff; }
.tag.discount { background: #28a745; }

.khoa-hoc-img {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 15px;
  position: relative;
}

.btn-dangky {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #004080;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #00264d;
  transition: all 0.2s ease;
}

.btn-dangky:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 5px rgba(0,0,0,0.3);
}




/* N�t di?u hu?ng tr�i ph?i */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #004080;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  z-index: 10;
  font-size: 20px;
  transition: 0.3s;
}

.slider-btn:hover {
  background: #00264d;
}

.prev-btn {
  left: 0;
}

.next-btn {
  right: 0;
}

/* Responsive mobile */
@media (max-width: 600px) 
{
  .khoa-hoc-box {
    flex: 0 0 220px;
  }
}
 
.slider-wrapper {
  display: flex;
  justify-content: center;
}

.khoa-hoc-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 10px;
  max-width: 100%;
}

/* Can gi?a n?i dung khi kh�ng c?n scroll */
.khoa-hoc-slider:has(.khoa-hoc-box:nth-child(4)) {
  justify-content: flex-start;
}


/* ==== Benefits ==== */
.loi-ich-section {
  padding: 60px 20px;
  background: url('../img/bg_loiich.jpg') center center / cover no-repeat fixed;
  position: relative;
  color: #001f3f;
}

.loi-ich-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65); /* l?p ph? l�m m? ?nh */
  backdrop-filter: blur(2px);
  z-index: 0;
}

.loi-ich-section .title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
  color: #001f3f;
}

.loi-ich-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.loi-ich-box {
  width: 220px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.loi-ich-box:hover {
  transform: translateY(-5px);
}

.icon {
  font-size: 32px;
  color: #ffc107;
  margin-bottom: 10px;
  display: block;
}

.hoc-phi-section {
  background: url('../img/bg_hp2.jpg') center center / cover no-repeat fixed;
  position: relative;
  padding: 60px 20px;
}

.hoc-phi-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65); /* l?p ph? l�m m? ?nh */
  backdrop-filter: blur(2px);
  z-index: 0;
}

.hoc-phi-overlay {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  border-bottom: 1px solid navy;
  box-shadow: 0 15px 20px rgba(0,0,0,0.12);
  padding: 40px;
  max-width: 1200px;
  margin: auto;
  color: #0a214f;
}

.hoc-phi-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hoc-phi-left {
  flex: 1;
  min-width: 300px;
}

.hoc-phi-left h3 {
  font-size: 18px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}

.hoc-phi-left h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 15px;
}

.hoc-phi-left h2 span {
  color: #ffc107;
}

.hoc-phi-left p {
  font-size: 16px;
  line-height: 1.6;
}

.hoc-phi-right {
  flex: 0 0 300px;
  text-align: center;
}

.price {
  font-size: 18px;
  margin-bottom: 15px;
}

.price strong {
  font-size: 28px;
  font-weight: bold;
  color: #ffc107;
}

.btn-cta {
  background: #ffc107;
  color: #0a214f;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
  box-shadow: 0 4px 0 #d4ae00;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .hoc-phi-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .hoc-phi-right {
    width: 100%;
    text-align: left;
  }
}

/* ==== Feedback ==== */
.feedback-section {
  text-align: center;
  padding: 60px 20px;
  background: transparent;
}

.feedback-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: #003366;
  margin-bottom: 40px;
}

.feedback-carousel {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  height: 250px;
  overflow: hidden;
}

.feedback-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.feedback-slide.active {
  opacity: 1;
  position: relative;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.feedback-text {
  font-style: italic;
  padding: 0 20px;
  color: #333;
}

.student-name {
  font-weight: bold;
  color: #003366;
  margin-top: 10px;
}

.register-section {
  padding: 60px 20px;
  background-color: #f9fbff;
  text-align: center;
}

.registration-form {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.registration-form .form-group {
  margin-bottom: 20px;
}

.registration-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #003366;
}

.registration-form input,
.registration-form select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.registration-form input:focus,
.registration-form select:focus {
  border-color: #0055aa;
  box-shadow: 0 0 0 2px rgba(0, 85, 170, 0.2);
  outline: none;
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  background-color: #0055aa;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: #003f80;
}

/* 2 c?t layout cho form */
.registration-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.registration-form .form-group {
  display: flex;
  flex-direction: column;
}

/* N�t submit can gi?a */
.registration-form .submit-btn {
  grid-column: span 2;
}

/* Responsive: v? 1 c?t tr�n m�n h�nh nh? */
@media (max-width: 768px) {
  .registration-form {
    grid-template-columns: 1fr;
  }

  .registration-form .submit-btn {
    grid-column: span 1;
  }
}

/* ==== Footer ==== */
.main-footer {
  background: #0a1f44;
  color: #ffffff;
  padding: 3rem 0;
}
.main-footer .grid-4 {
  display: grid;
  gap: 2rem;
}
.footer-box h4 {
  margin-bottom: 1rem;
}
.footer-box ul {
  list-style: none;
}
.footer-box a {
  color: #ffc107;
}
.social-icons a {
  font-size: 1.2rem;
  margin-right: 1rem;
  color: #ffc107;
}

#registrationTable td {    
    padding: 0px 4px !important;  /*0px: trên dưới, 4px: trái phải*/
    vertical-align: middle;
}

/* === Responsive fixes (2025-08-14) === */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
img, video { max-width: 100%; height: auto; display: block; }
body { overflow-x: hidden; }

/* Ensure container doesn't overflow */
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* Mobile nav open state */
@media (max-width: 768px) {
  .main-nav.is-open { display: block; }
  .main-nav ul { display: flex; flex-direction: column; }
  .main-nav .submenu { display: none; }
  .main-nav .has-sub.is-open > .sub-menu { display: block; }
}

/* === NAV mobile final (ưu tiên cao, tránh xung đột) === */
@media (max-width: 991px) {
  .menu-toggle { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; }

  /* Ẩn mặc định */
  nav.main-nav { display:none; }

  /* Mở menu khi body có .nav-open hoặc button aria-expanded=true */
  body.nav-open nav.main-nav,
  #menu-toggle[aria-expanded="true"] + nav.main-nav { display:block; }

  /* Menu dạng overlay dưới header */
  nav.main-nav {
    position: fixed;
    inset: calc(var(--nav-h, 56px)) 0 auto 0;
    background:#fff;
    border-top:1px solid #e5e7eb;
    padding:12px 16px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    z-index: 1000;
  }
  nav.main-nav > ul { display:flex; flex-direction:column; gap:6px; }
  nav.main-nav li > a { padding:12px 10px; border-radius:10px; }

  /* Submenu kiểu accordion */
  nav.main-nav .sub-menu { display:none; position:static; background:#f8fafc; box-shadow:none; border-radius:10px; margin:6px 0 10px; padding:6px 8px; }
  nav.main-nav .has-sub.is-open > .sub-menu { display:block; }
}

/* Đảm bảo icon bars hiển thị đẹp */
.menu-toggle { border:1px solid #cbd5e1; border-radius:12px; background:#fff; }

/* ==== Courses (Swiper) – override các rule cũ cố định width ==== */
.khoa-hoc-section { padding: 40px 16px; background:#f9f9f9; }
.khoa-hoc-section .title { font-size: clamp(22px, 5vw, 32px); margin-bottom: 16px; }

/* Slide & box: theo slidesPerView của Swiper */
.khoa-hoc-swiper .swiper-slide { height: auto; display: flex; }
.khoa-hoc-box {
  width: 100%;            /* bỏ width:260px */
  flex: 1 1 auto;         /* không khóa chiều rộng */
  background:#fff; border-radius:16px; padding:16px;
  box-shadow:0 4px 10px rgba(0,0,0,.08);
  display:flex; flex-direction:column;
}
.khoa-hoc-img {
  width:100%;
  aspect-ratio: 16/9;     /* ảnh luôn đúng tỉ lệ */
  background-size: cover;
  background-position: center;
  border-radius:12px;
  margin-bottom:12px;
  position: relative;
}
.tag { position:absolute; top:8px; left:8px; padding:6px 10px; border-radius:8px; font-size:12px; color:#fff; }
.tag.hot { background:#e60000; } .tag.new { background:#007bff; } .tag.discount { background:#28a745; }

.btn-dangky { margin-top:auto; padding:10px 16px; border-radius:8px; font-weight:600; }

.khoa-hoc-prev, .khoa-hoc-next {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.06);
}
.khoa-hoc-prev::after, .khoa-hoc-next::after { font-size: 16px; color:#0a1f44; }

/* Khoảng cách dưới cho chấm */
.khoa-hoc-pagination { position: relative; margin-top: 12px; }
