body {
  font-family: "Lato", sans-serif;
  background-color: white;
  color: #333;
  margin: 0;
  padding: 0;
  font-size: 20px;
}
ul {
  list-style: none;
}
header {
  background-color: #4b3b2a;
  color: white;
  padding: 15px 20px;
  text-align: left;
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-family: 'Lato', sans-serif;
  font-weight: bold;
}

/* thanh điều hướng*/
nav {
  background-color: #6b5643;
  width: 100%;
  padding: 10px 0;
  text-align: left;
  position: relative;
}
nav a {
  color: #f3f0e6;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 12px;
  display: block;
}
/* Container căn giữa nội dung */
.nav-container {
  max-width: 1200px;
  margin: 0;
  padding: 0 15px;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: flex-start; /* Căn trái các mục menu */
}

nav li {
  position: relative;
  margin-right: 20px;
}

nav .submenu {
  display: none; /* Ẩn submenu mặc định */
  position: absolute; /* Vị trí tuyệt đối so với thẻ li cha */
  top: 100%; /* Đặt submenu ngay dưới item menu cha */
  left: 0; /* Căn trái với item menu cha */
  background-color: #8a6f5a; /* Màu nâu cho submenu */
  min-width: 200px; /* Độ rộng tối thiểu của submenu */
  z-index: 100; /* Đảm bảo submenu hiển thị trên các phần tử khác */
  padding: 10px 0;
}
/* rê chuột vào khỏi mất submenu */
nav > ul > li:hover::after {
  content: "";
  position: absolute;
  height: 50%;
  width: 100%;
  bottom: -50%;
  left: 0;
}
nav .submenu li {
  display: block; /* Hiển thị mỗi mục submenu theo chiều dọc */
}

nav .submenu a {
  display: block; /* Biến thẻ a thành block để chiếm toàn bộ chiều rộng */
  padding: 10px; /* Tạo khoảng đệm bên trong */
  margin: 0; /* Loại bỏ margin mặc định */
}

nav li:hover .submenu {
  display: block; /* Khi hover vào thẻ li cha, hiển thị submenu */
}
.hero {
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/QuangTrungStatue_Hue.jpg/800px-QuangTrungStatue_Hue.jpg");
  background-size: cover;
  background-position: center;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  font-size: 3em;
  text-shadow: 2px 2px 5px white;
}
.content {
  padding: 40px;
  background-color: #f5f5dc;
}
.section {
  margin-bottom: 40px;
}
.section h2 {
  color: #4b3b2a;
}
footer {
  background-color: #4b3b2a;
  color: white;
  text-align: center;
  padding: 20px;
}
h2 {
  font-size: 30px;
}
p {
  line-height: 1.3; /* Gấp 1.6 lần kích thước chữ hiện tại */
  font-size: 20px;
}
/* viết tắt*/
.tooltip-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  color: #4285f4;
  text-decoration: none; /* Đảm bảo không gạch chân mặc định */
}

.tooltip-content {
  visibility: hidden;
  width: 300px;
  background-color: white;
  color: black;
  text-align: left;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 10;
  top: 100%; /* nằm dưới chữ */
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 15px;
}

.tooltip-container:hover .tooltip-content {
  visibility: visible;
}

.tooltip-container:hover {
  text-decoration: underline;
  /* Hoặc cụ thể hơn: */
  text-decoration-line: underline;
  text-decoration-color: currentColor; /* Màu giống chữ */
  text-decoration-thickness: 1.5px; /* Độ dày nét gạch */
}

.tooltip-content img {
  max-width: 100%;
  margin-top: 8px;
}
/*ảnh bên phải*/
.image-container {
  float: right; /* Hình trôi về bên phải */
  width: 20%; /* Độ rộng hình ảnh */
  margin-left: 20px; /* Khoảng cách bên trái */
  margin-right: 20px; /* Khoảng cách bên phải */
  padding: 7px; /* Tạo khoảng cách giữa hình ảnh và khung */
  border: 1px solid #444; /* Viền khung ảnh */
  text-align: center; /* Căn giữa phụ đề */
}

.image-container img {
  width: 100%; /* Đảm bảo hình không bị méo */
  border: 2px solid #000; /* Đường viền */
  animation: float 4s ease-in-out infinite;
}

.caption {
  font-style: italic; /* Chữ in nghiêng */
  font-size: 14px; /* Cỡ chữ nhỏ */
  text-align: center; /* Căn giữa */
  color: #555; /* Màu chữ nhẹ */
}
@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}
footer {
  font-family: "Lato", sans-serif;
}
/* Responsive cho màn hình lớn (Desktop) */
@media screen and (max-width: 1200px) {
  .video-layout {
    gap: 10px;
  }

  .fullscreen-video {
    width: 800px;
  }

  .side-video {
    width: 200px;
  }
}

/* Responsive cho màn hình tablet */
@media screen and (max-width: 992px) {
  .nav-container ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-container li {
    margin: 5px 10px;
  }

  .video-layout {
    flex-direction: column;
    align-items: center;
  }

  .side-videos {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .fullscreen-video {
    width: 90%;
    max-width: 800px;
  }

  .side-video {
    width: 45%;
    max-width: 300px;
  }

  .submenu {
    position: static;
    width: 100%;
  }
}

/* Responsive cho màn hình điện thoại */
@media screen and (max-width: 768px) {
  header {
    padding: 10px;
  }
  header h1 {
    font-size: 20px;
  }
  .nav-container ul {
    font-size: 18px;
  }

  .side-videos {
    flex-direction: column;
  }

  .side-video {
    width: 90%;
    max-width: none;
    margin: 5px auto;
  }

  .user-info {
    top: 5px;
    right: 10px;
  }

  .user-dropdown {
    padding: 3px 8px;
  }

  .dropdown-content {
    right: -10px;
  }
}

/* Responsive cho màn hình điện thoại nhỏ */
@media screen and (max-width: 480px) {
  .nav-container {
    padding: 0 10px;
  }

  .nav-container ul {
    font-size: 16px;
  }

  .submenu {
    font-size: 14px;
  }

  footer {
    padding: 10px;
    font-size: 14px;
  }

  #soundToggle {
    padding: 5px;
  }

  #soundIcon {
    font-size: 14px;
  }
}

/* Menu Responsive */
@media screen and (max-width: 992px) {
  .nav-container {
    position: relative;
  }

  nav ul {
    flex-direction: column;
    /* Thay đổi từ center sang flex-start để căn trái */
    align-items: flex-start;
    padding: 10px 0;
  }

  nav li {
    width: 100%;
    /* Điều chỉnh căn lề văn bản để phù hợp với căn trái của ul */
    text-align: left; /* Đổi từ center sang left */
    margin: 5px 0;
  }

  nav a {
    /* Đảm bảo nội dung link cũng căn trái */
    justify-content: flex-start; /* Đổi từ center sang flex-start */
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
  }

  .submenu {
    position: static;
    width: 90%;
    /* Điều chỉnh margin để sub-menu căn trái theo menu chính */
    margin: 5px 0 5px auto; /* Điều chỉnh margin để căn trái (hoặc bỏ auto nếu muốn sát lề) */
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    box-shadow: none;
  }

  .submenu li {
    margin: 0;
  }

  .submenu a {
    padding: 10px;
    font-size: 0.95em;
  }
}

@media screen and (max-width: 768px) {
  nav {
    padding: 5px 0;
  }

  nav ul {
    gap: 8px;
  }

  nav a {
    font-size: 16px;
    padding: 10px 15px;
  }

  nav a i {
    font-size: 14px;
  }

  .submenu {
    width: 95%;
  }

  .submenu a {
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  .nav-container {
    padding: 0 10px;
  }

  nav a {
    font-size: 14px;
    padding: 8px 12px;
  }

  nav a i {
    font-size: 12px;
  }

  .submenu {
    width: 100%;
  }
}

@media screen and (max-width: 576px) {
  header {
    padding: 10px;
  }
  header h1 {
    font-size: 20px;
  }
}

/* ĐẢM BẢO HIỆU ỨNG HOVER LUÔN ĐƯỢC ƯU TIÊN */
nav a:hover {
  background-color: white !important;
  color: black !important;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
}
nav .submenu a:hover {
  background-color: #4b3b2a !important;
  color: white !important;
  z-index: 2;
}
