body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  color: #333;
}

header,
footer {
  background-color: #0868b4;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header {
  padding: 5px 15px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 15px;
}

nav a {
  color: white;
  text-decoration: none;
}

input[type="search"] {
  padding: 8px;
  margin-left: 30px;
  border: none;
  border-radius: 5px;
  width: calc(100% - 450px - 160px);
  min-width: 140px;
  max-width: 500px;
}

.banner img {
  width: 100%;
  height: auto;
  display: none;
}

.banner img.active {
  display: block;
}

main {
  padding: 20px;
  min-height: calc(100vh - 65px - 84px);
}

.courses {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.course {
  flex: 1 1 calc(25% - 30px);
  /* 4 items per row with spacing */
  box-sizing: border-box;
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  background-color: white;
}

.course img {
  width: 100%;
  height: auto;
}

button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 10px;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 5px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 15px;
}

@media (max-width: 1024px) {
  .course {
    flex: 1 1 calc(50% - 30px);
    /* Hiển thị 2 khóa học mỗi hàng */
  }
}

@media (max-width: 600px) {
  .course {
    flex: 1 1 100%;
    /* Hiển thị 1 khóa học mỗi hàng */
  }
}

.course-detail {
  padding: 20px;
  background-color: #f9f9f9;
}

.detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background-color: white;
  padding: 20px;
  border: 1px solid #ccc;
}

.detail-container img {
  width: 100%;
  max-width: 400px;
  object-fit: cover;
  border-radius: 8px;
}

.detail-info {
  flex: 1;
}

.detail-info h2 {
  color: #0868b4;
}

.price,
.teacher {
  font-weight: bold;
  margin: 10px 0;
}

.content-list {
  margin: 15px 0;
  padding-left: 20px;
}

.content-list li {
  margin-bottom: 5px;
}

button,
.btn {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  text-decoration: none;
  display: inline-block;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 14px;
}

.lesson-section {
  margin: 30px 20px;
}

.accordion-btn {
  background-color: #0868b4;
  color: white;
  padding: 12px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  border-radius: 4px;
}

.accordion-btn:hover {
  background-color: #074d86;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background-color: #f0f8ff;
  padding: 0 12px;
  border-radius: 4px;
}

.accordion-content p {
  margin: 10px 0;
}

.course-page {
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  background-color: #f5f5f5;
}

.sidebar {
  flex: 1 1 250px;
  max-width: 250px;
  padding: 20px;
  background-color: white;
  border: 1px solid #ccc;
  margin-right: 20px;
  border-radius: 8px;
}



.filter-group {
  margin-bottom: 20px;
}

.filter-group h4 {
  margin-bottom: 10px;
  color: #0868b4;
}

.course-list {
  flex: 3;
}

.courses {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.course {
  flex: 1 1 calc(25% - 30px);
  box-sizing: border-box;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: white;
  text-align: center;
  border-radius: 8px;
  max-width: calc(25% - 30px);
}

.course img {
  width: 100%;
  border-radius: 6px;
}

button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .course {
    flex: 1 1 calc(50% - 30px);
  }

  .sidebar {
    flex: 1 1 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }
}

@media (max-width: 600px) {
  .course {
    flex: 1 1 100%;
  }
}

.sidebar {
  flex: 1 1 250px;
  max-width: 250px;
  padding: 25px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  margin-right: 20px;
  font-size: 15px;
}

.sidebar h3 {
  color: #0868b4;
  margin-bottom: 20px;
  font-size: 20px;
  border-bottom: 2px solid #0868b4;
  padding-bottom: 8px;
}

.search-bar {
  padding: 10px;
  width: calc(100% - 22px);
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.filter-group {
  margin-bottom: 25px;
}

.filter-group h4 {
  margin-bottom: 10px;
  font-size: 16px;
  color: #444;
  border-left: 4px solid #0868b4;
  padding-left: 8px;
}

.filter-group label {
  display: block;
  margin: 6px 0;
  cursor: pointer;
}

.filter-group input[type="checkbox"] {
  margin-right: 6px;
  accent-color: #0868b4;
}

.filter-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  font-size: 14px;
  border-radius: 6px;
  background-color: #fff;
}

main>h2 {
  text-align: center;
}

.learning-page {
  display: flex;
  flex-wrap: wrap;
  background-color: #f9f9f9;
  padding: 20px;
}

.learning-sidebar {
  flex: 1 1 250px;
  max-width: 250px;
  background-color: white;
  padding: 20px;
  margin-right: 20px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.course-info img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 10px;
}

.course-info h3 {
  font-size: 16px;
  color: #0868b4;
  margin-bottom: 15px;
}

.lesson-nav {
  list-style: none;
  padding: 0;
}

.lesson-nav li {
  padding: 10px;
  margin-bottom: 6px;
  background-color: #eaeaea;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;

  /* Rút gọn nếu quá dài */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.lesson-nav li:hover {
  background-color: #d5e5f7;
}

.lesson-nav li.active {
  background-color: #0868b4;
  color: white;
}

.lesson-content {
  flex: 3;
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.lesson-content h2 {
  color: #0868b4;
  margin-bottom: 20px;
}

.video-wrapper iframe {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.lesson-description p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.video-ratio {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 ratio = 9/16 = 0.5625 = 56.25% */
}

.video-ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: none;
}

.register-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  background-color: #b0d7ff;
}

.register-container {
  width: 100%;
  max-width: 400px;
  background-color: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.register-container h2 {
  margin-bottom: 25px;
  color: #0868b4;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.register-form label {
  text-align: left;
  font-weight: bold;
  color: #333;
}

.register-form input {
  padding: 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.register-form button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.register-form button:hover {
  background-color: #064d87;
}

.menu-toggle {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-left: auto;
  margin-top: 0;
}

@media (max-width: 768px) {
  nav#main-menu {
    display: none;
    width: 100%;
  }

  nav#main-menu.active {
    display: block;
    background-color: #0868b4;
  }

  nav#main-menu ul {
    flex-direction: column;
    padding: 10px 0;
  }

  nav#main-menu li {
    margin: 10px 0;
    text-align: center;
  }

  .menu-toggle {
    display: block;
  }

  header {
    flex-wrap: wrap;
  }
}

.profile-page {
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  background-color: #b0d7ff;
}

.profile-sidebar {
  flex: 1 1 200px;
  max-width: 200px;
  background-color: white;
  padding: 20px;
  margin-right: 20px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.profile-menu {
  list-style: none;
  padding: 0;
}

.profile-menu a {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  background-color: #eee;
  transition: background-color 0.3s;
}

.profile-menu li:hover a {
  background-color: #d5e9ff;
}

.profile-menu li.active a {
  background-color: #0868b4;
  font-weight: bold;
}

.profile-menu li a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.profile-menu li.active a {
  color: white;
}

.profile-content {
  flex: 4;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.profile-content h2 {
  margin-bottom: 20px;
  color: #0868b4;
}

/* Hiển thị 4 khóa học mỗi dòng dùng flex */
.courses {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.course {
  flex: 1 1 calc(25% - 30px);
  box-sizing: border-box;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.course img {
  width: 100%;
  border-radius: 6px;
}

.course button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .course {
    flex: 1 1 calc(50% - 30px);
  }
}

@media (max-width: 600px) {
  .profile-page {
    flex-direction: column;
  }

  .profile-sidebar {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .course {
    flex: 1 1 100%;
  }
}

.personal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 500px;
  margin-top: 20px;
}

.personal-form label {
  font-weight: bold;
  color: #333;
}

.personal-form input {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fdfdfd;
}

.personal-form button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.personal-form button:hover {
  background-color: #064d87;
}

.change-password-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 500px;
  margin-top: 20px;
}

.change-password-form label {
  font-weight: bold;
  color: #333;
}

.change-password-form input {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fdfdfd;
}

.change-password-form button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.change-password-form button:hover {
  background-color: #064d87;
}

.dashboard-page {
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  background-color: #b0d7ff;
}

.dashboard-sidebar {
  flex: 1 1 200px;
  max-width: 200px;
  background-color: white;
  padding: 20px;
  margin-right: 20px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.dashboard-menu {
  list-style: none;
  padding: 0;
}

.dashboard-menu a {
  padding: 12px;
  margin-bottom: 10px;
  background-color: #eee;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dashboard-menu li:hover a {
  background-color: #d5e9ff;
}

.dashboard-menu li.active a {
  background-color: #0868b4;
  color: white;
  font-weight: bold;
}

.dashboard-menu li a {
  text-decoration: none;
  color: inherit;
  display: block
}

.dashboard-menu li.active a {
  color: #FFF
}

.dashboard-content {
  flex: 4;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.dashboard-content h2 {
  color: #0868b4;
  margin-bottom: 20px;
}

.stats {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-box {
  flex: 1;
  background-color: #eaf4ff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #d0e3f3;
}

.stat-box h3 {
  color: #0868b4;
  margin-bottom: 10px;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.student-table th,
.student-table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

.student-table th {
  background-color: #0868b4;
  color: white;
}

.student-table tr:nth-child(even) {
  background-color: #f2f9ff;
}

.dashboard-content {
  flex: 4;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.dashboard-content h2 {
  color: #0868b4;
  margin-bottom: 15px;
}

.create-course-btn {
  background-color: #0868b4;
  color: white;
  padding: 10px 14px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  margin-bottom: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.create-course-btn:hover {
  background-color: #064d87;
}

.course-table {
  width: 100%;
  border-collapse: collapse;
}

.course-table th,
.course-table td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: left;
}

.course-table th {
  background-color: #0868b4;
  color: white;
}

.course-table td button {
  background-color: #eee;
  border: none;
  padding: 6px 10px;
  margin-right: 6px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}

.course-table td button:hover {
  background-color: #d5eaff;
}

.course-table tr:nth-child(even) {
  background-color: #f9fcff;
}

.d-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.justify-content-between {
  justify-content: space-between
}

.align-items-center {
  align-items: center;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  background-color: #eee;
  color: #333;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.page-btn:hover {
  background-color: #d5eaff;
}

.page-btn.active {
  background-color: #0868b4;
  color: white;
  font-weight: bold;
}

.page-btn:disabled {
  background-color: #ddd;
  color: #888;
  cursor: not-allowed;
  opacity: 0.6;
}

.create-course-form {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 20px;
}

.form-column {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.create-course-form label {
  font-weight: bold;
  color: #333;
}

.create-course-form input,
.create-course-form select,
.create-course-form textarea {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fdfdfd;
}

.create-course-form textarea {
  resize: vertical;
}

.create-course-form button {
  margin-top: 25px;
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.create-course-form button:hover {
  background-color: #064d87;
}

.add-lesson-btn {
  margin: 15px 0;
  padding: 10px 14px;
  font-size: 14px;
  background-color: #0868b4;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.add-lesson-btn:hover {
  background-color: #064d87;
}

.lesson-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.lesson-table th,
.lesson-table td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: left;
}

.lesson-table th {
  background-color: #0868b4;
  color: white;
}

.lesson-table tr:nth-child(even) {
  background-color: #f2f9ff;
}

.lesson-table td button {
  background-color: #eee;
  border: none;
  padding: 6px 10px;
  margin-right: 6px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}

.lesson-table td button:hover {
  background-color: #d5eaff;
}

.add-lesson-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  margin-top: 20px;
}

.add-lesson-form label {
  font-weight: bold;
  color: #333;
}

.add-lesson-form input,
.add-lesson-form textarea {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fdfdfd;
}

.add-lesson-form textarea {
  resize: vertical;
}

.add-lesson-form button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.add-lesson-form button:hover {
  background-color: #064d87;
}

.edit-lesson-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  margin-top: 20px;
}

.edit-lesson-form label {
  font-weight: bold;
  color: #333;
}

.edit-lesson-form input,
.edit-lesson-form textarea {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fdfdfd;
}

.edit-lesson-form textarea {
  resize: vertical;
}

.edit-lesson-form button {
  background-color: #0868b4;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.edit-lesson-form button:hover {
  background-color: #064d87;
}