/* ==========================================================================
   Courses Section - Các chương trình học (Figma Node 1:2459)
   ========================================================================== */

.courses-section {
  background-color: #ffffff; /* Nền trắng sạch sẽ */
  padding: 80px 0;
  position: relative;
  overflow: hidden; /* Ngăn chặn bất kỳ tràn cột/thanh cuộn ngang nào ra ngoài section */
}

/* Thẻ khóa học */
.course-card {
  position: relative;
  width: 100%;
  max-width: 383px; /* Chiều rộng chuẩn Figma */
  height: 510px;    /* Chiều cao chuẩn Figma */
  border-radius: 30px; /* Bo góc tròn lớn 30px chuẩn Figma */
  overflow: hidden;
  margin: 0 auto;   /* Căn giữa cột khi xếp dọc trên mobile */
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 10;
}

/* Hiệu ứng di chuột nổi bật cho cả thẻ */
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0px 12px 30px rgba(0, 0, 0, 0.15);
}

/* --- Ảnh nền khóa học --- */
.course-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.course-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Hiệu ứng phóng nhẹ ảnh nền khi hover */
.course-card:hover .course-img {
  transform: scale(1.06);
}

/* Overlay tối mờ đè lên ảnh nền */
.course-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3); /* Phủ mờ tối 30% từ Figma */
  z-index: 2;
}

/* --- Nút Khám phá nổi bật --- */
.course-discover-btn {
  position: absolute;
  bottom: 127px; /* Tọa độ Figma: Cách dải xanh (banner) đúng 10px */
  left: 11px;
  width: 121px;
  height: 38px;
  border-radius: 10px; /* Bo góc 10px từ Figma */
  background-color: #1b136a; /* Màu xanh đậm từ Figma */
  color: #ffffff;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-main), sans-serif;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.course-discover-btn .btn-arrow {
  font-size: 18px;
  line-height: 1;
}

/* Hiệu ứng di chuột cho nút Khám phá */
.course-discover-btn:hover {
  background-color: #0f0a45;
  transform: scale(1.05);
  color: #ffffff;
}

/* --- Dải màu xanh ở đáy chứa tiêu đề --- */
.course-banner-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 117px; /* Chiều cao dải xanh từ Figma */
  background-color: rgba(0, 174, 239, 0.9); /* Màu xanh dương 90% opacity */
  padding: 20px 24px;
  z-index: 4;
  display: flex;
  align-items: center;
}

.course-card-title {
  font-family: var(--font-main), sans-serif;
  font-weight: 600;
  font-size: 28px; /* Cỡ chữ tiêu đề 28px chuẩn Figma */
  color: #ffffff;
  line-height: 1.25;
  margin: 0;
  text-align: left;
}

.see-more-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.btn-see-more {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background-color: #00AEEF;
  border: 1px solid #007EFF;
  color: #fff;
  border-radius: 15px;
  font-size: 18px;
  font-weight: 600;
  padding: 13px 50px;
}

/* ==========================================================================
   Courses Page Header & Tabs - Tiêu đề & Danh mục bộ lọc khóa học
   ========================================================================== */

/* Cấu trúc tiêu đề phần khóa học để căn giữa nội dung gọn gàng */
.courses-header {
  margin-bottom: 40px;
  text-align: center;
}

/* Tiêu đề trang khóa học sử dụng cỡ chữ 36px dày dặn theo Figma */
.courses-title {
  font-family: var(--font-main), sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-darker);
  margin-bottom: 16px;
  line-height: 1.25;
}

/* Điểm nhấn nổi bật tên thương hiệu HVG Education */
.courses-title .text-highlight {
  color: var(--primary-color);
}

/* Phụ đề mô tả chi tiết khóa học, giới hạn độ rộng để dễ đọc hơn */
.courses-subtitle {
  font-family: var(--font-main), sans-serif;
  font-size: 16px;
  color: #474747; /* Màu xám đậm giảm mỏi mắt cho người dùng */
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

/* Khung chứa các tab lọc thiết lập khoảng cách và hỗ trợ tự động rớt dòng trên di động */
.courses-tabs {
  margin-bottom: 48px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Thẻ nút danh mục thiết kế theo khuôn viên thuốc (capsule) chuẩn kích thước Figma: 163px x 42px */
.course-tab {
  width: 163px;
  height: 42px;
  border-radius: 20px;
  border: 1px solid var(--primary-color);
  background-color: transparent;
  color: var(--primary-color);
  font-family: var(--font-main), sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

/* Trạng thái hoạt động của danh mục: đổ nền đặc xanh và đổ bóng nhẹ */
.course-tab.active {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Trạng thái di chuột nhẹ để cung cấp phản hồi trực quan không quá gắt */
.course-tab:not(.active):hover {
  background-color: rgba(0, 174, 239, 0.08);
  transform: translateY(-1px);
}

/* --- Responsive CSS --- */
@media (max-width: 991px) {
  .courses-section {
    /* Giảm padding trên màn hình tablet */
    padding: 40px 0;
  }

  .courses-title {
    /* Giảm cỡ chữ tiêu đề trên tablet */
    font-size: 30px;
  }

  .courses-subtitle {
    /* Giảm cỡ chữ mô tả trên tablet */
    font-size: 15px;
  }

  .course-tab {
    /* Giảm cỡ chữ tab lọc trên tablet */
    font-size: 15px;
  }

  .course-card-title {
    /* Giảm cỡ chữ tiêu đề card trên tablet */
    font-size: 24px;
  }

  .courses-cards-row {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .courses-cards-row::-webkit-scrollbar {
    display: none;
  }

  .courses-cards-row > div {
    flex: 0 0 auto !important;
    max-width: none !important;
  }

  .course-card {
    margin: 0 auto !important;
    width: 100% !important;
    height: 440px !important; /* Đặt chiều cao đồng nhất cho tablet */
  }

  .see-more-btn-wrapper {
    margin-top: 20px !important;
  }
  
  .course-discover-btn {
    bottom: 127px;
  }
}

@media (max-width: 576px) {
  .courses-section {
    /* Giảm padding trên màn hình di động */
    padding: 25px 0;
  }

  .courses-title {
    /* Giảm thêm cỡ chữ tiêu đề trên di động nhỏ */
    font-size: 26px !important;
  }

  .courses-subtitle {
    /* Giảm thêm cỡ chữ mô tả trên di động nhỏ */
    font-size: 14px !important;
  }

  /* Thu nhỏ các tab lọc phù hợp với Mobile */
  .courses-tabs {
    gap: 10px !important;
    margin-bottom: 30px !important;
  }

  .course-tab {
    width: auto !important;
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 13.5px !important;
    border-radius: 18px !important;
  }

  .courses-cards-row {
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .courses-cards-row > div {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .course-card {
    max-width: 100% !important;
    height: 420px !important;
  }

  .course-card-title {
    /* Giảm thêm cỡ chữ tiêu đề card trên di động nhỏ */
    font-size: 20px !important;
  }

  /* Tối ưu riêng cho các màn hình siêu nhỏ (Mobile S - dưới 360px) */
  @media (max-width: 360px) {
    .courses-tabs {
      gap: 8px !important;
      margin-bottom: 24px !important;
    }

    .course-tab {
      height: 32px !important;
      padding: 0 12px !important;
      font-size: 12px !important;
      border-radius: 16px !important;
    }
  }
}
