/* Reset cơ bản */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--site-bg);
  color: var(--site-text);
  padding-top: 60px; /* Để tránh bị che header cố định */
  padding-bottom: 71px; /* Để tránh bị che footer cố định */
}

/* I. Header */
#header {
  width: 100%;
  height: 72px;
  background-color: var(--header-bg);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 10px;
}
.header-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo img {
  height: 100%;
}
.header-img {
  display: flex;
  flex-direction: column; /* Sắp xếp theo cột: icon ở trên, text bên dưới */
  align-items: center;    /* Canh giữa nội dung */
}

.header-img img {
  width: 30px;
  height: 30px;
  object-fit: cover;
}

.header-icon-text {
  margin-top: 2px;       /* Khoảng cách giữa icon và text */
  font-size: 12px;       /* Kích thước chữ có thể điều chỉnh */
  color: var(--secondary-color); /* Hoặc bạn thay bằng màu mong muốn */
}


/* II. Banner */
#banner {
  width: 90%;
  max-width: 800px; /* Giá trị tối đa tuỳ ý */
  margin: 15px auto;
  position: relative;
  overflow: hidden;
  /* Sử dụng aspect-ratio để giữ tỉ lệ 407:120 */
  aspect-ratio: 407 / 120;
}
.slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.slide.active {
  opacity: 1;
}
#banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slider-dots {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  background-color: #ccc;
  border-radius: 50%;
}
.dot.active {
  background-color: var(--primary-color);
}

/* III. Marquee */
#marquee {
  width: 90%;
  max-width: 800px;
  overflow: hidden;
  white-space: nowrap;
  margin: 8px auto;
  background-color: transparent;
  padding: 3px;
}
.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 20s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* IV. Quảng cáo thu hút (Advertisement) */
#ad {
  width: 90%;
  max-width: 800px;
  margin: 10px auto;
  /* Giữ tỉ lệ 407:94 */
  aspect-ratio: 407 / 94;
  background-image: url('qc1.avif'); /* Thay bằng ảnh nền thực tế */
  background-size: cover;
  background-position: center;
  position: relative; /* Để có thể định vị phần counter tuyệt đối bên trong */
  overflow: hidden;
}

/* Phần số đếm (counter) với các biến để tùy chỉnh kích thước, màu sắc và vị trí */
#ad #counter {
  position: absolute;
  /* Vị trí có thể điều chỉnh qua biến CSS, mặc định nằm ở giữa */
  top: var(--counter-top, 90%);
  left: var(--counter-left, 50%);
  transform: translate(-50%, -50%);
  
  /* Kích thước và màu sắc */
  font-size: var(--counter-font-size, 20px);
  font-weight: var(--counter-font-weight, bold);
  color: var(--counter-color, var(--secondary-color));
}

/* V. Phần hiển thị các nút */
#buttons-section {
  width: 90%;
  max-width: 800px;
  margin: 10px auto;
  display: flex;
}
.btn-left {
  width: 33.33%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.btn-left .action-btn {
  width: 80%;
  max-width: 80px; /* có thể điều chỉnh */
  height: 29px;
  font-size: 16px;
  margin: 2px 0;
  background-color: var(--btn-bg, #ffcc00);  /* Màu nền mặc định, có thể tùy chỉnh */
  border-radius: var(--btn-radius, 15px);     /* Độ bo tròn mặc định, có thể tùy chỉnh */
  color: var(--btn-text-color, #fff);         /* Màu chữ mặc định */
  border: none;                               /* Loại bỏ border mặc định */
  cursor: pointer;                            /* Thêm pointer khi hover */
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-right {
  width: 66.66%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.btn-right .icon-item {
  text-align: center;
}
.btn-right .icon-item img {
  width: 33px;
  height: 30px;
  object-fit: cover;
}
.btn-right .icon-item span {
  display: block;
  font-size: 15px;
  margin-top: 2px;
}

/* VI. Phần hiển thị ảnh */
#image-section {
  width: 90%;
  max-width: 800px;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.square-img {
  width: 100%;
  /* Để giữ tỷ lệ vuông, sử dụng padding-top hoặc thuộc tính aspect-ratio */
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* VII. Thông tin trang */
#page-info {
  width: 90%;
  max-width: 800px;
  margin: 10px auto;
  font-size: 14px;
  line-height: 1.5;
  text-align: justify;
}

/* VIII. Footer */
#footer {
  width: 100%;
  height: 65px;
  background-color: var(--footer-bg);
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
/* Các mục trong Footer */
.footer-item {
  display: flex;
  flex-direction: column; /* Sắp xếp theo cột: icon ở trên, text bên dưới */
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
}

.footer-item img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  margin-bottom: 2px; /* Khoảng cách giữa icon và text */
}

/* Popup */

/* Banner */
#fixed-banner-container {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 768px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Căn nút về bên phải */
}

#fixed-banner {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  margin-top: 5px; /* Để nút Close Ads nằm trên banner */
}

#fixed-banner video {
  width: 100%;
  height: auto;
  display: block;
}

#close-banner {
  background-color: #000;
  color: #fff;
  border: none;
  padding: 2px 2px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 5px;
}

#view-ads {
  position: fixed;
  bottom: 70px;
  right: 10px; /* Chuyển nút View Ads ra góc phải */
  background-color: #000;
  color: #fff;
  border: none;
  padding: 2px 2px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  z-index: 9999;
}
