/* style.css */

/* Đặt font mặc định, margin/padding = 0 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--color-body-bg); /* #FFFFFF */
  color: var(--color-body-text); /* #fff */
  margin: 0 auto;
  /* Với desktop tối đa 1080px, mobile tối đa 768px */
  max-width: 1080px; 
}

/* Media query cho màn hình nhỏ hơn hoặc bằng 768px */
@media (max-width: 768px) {
  body {
    max-width: 768px;
  }
}

/* Phần nội dung trang */
.content {
  padding: 20px;
  min-height: 100vh;
}

/* Container ghim ở cuối trang */
#ad-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 100%;
  max-width: 768px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 5px;
}

/* Nút "Tắt quảng cáo" */
#close-ad {
  background-color: var(--color-image-item-bg); /* #000 */
  color: var(--color-image-item-h3); /* #fff */
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 5px;
}

/* Khối banner */
#ad-banner {
  width: 100%;
}

/* Ảnh banner */
#ad-banner img {
  display: block;
  width: 100%;
  max-width: 768px;
  height: auto;
}

/* Nút "Xem quảng cáo" */
#show-ad {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background-color: var(--color-image-item-bg);
  color: var(--color-image-item-h3);
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: none;
}

/* Đảm bảo hiển thị tốt trên di động */
@media (max-width: 768px) {
  #ad-container {
    max-width: 100%;
  }
  #ad-banner img {
    max-width: 100%;
  }
}

/* ===== Header ===== */
.header {
  width: 100%;
}

/* Desktop */
@media (min-width: 769px) {
  .header {
    background-color: var(--color-header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
  }
  /* Khối logo không cần set background riêng vì header đã có màu */
}

/* Mobile */
@media (max-width: 768px) {
  .header {
    display: block;
  }
  .header-logo {
    background-color: var(--color-header-bg);
    text-align: center;
    padding: 5px 0;
  }
  .header-auth {
    background-color: var(--color-header-auth-bg);
    text-align: center;
    padding: 5px 0;
  }
}

.btn-orange {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--color-btn-orange-bg);
  color: var(--color-btn-orange-text);
  border: 1px solid #000000;
  border-radius: 25px;
  font-weight: bold;
  font-size: 20px;
  text-decoration: none;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-orange::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(270deg, #5E35B1, #03A9F4, #2E7D32); 
  background-size: 600% 600%;
  z-index: -1;
  border-radius: 28px;
  animation: borderRun 3s linear infinite;
}

@keyframes borderRun {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.btn-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255, 120, 0, 0.6);
}

.btn-orange:active {
  transform: scale(0.97);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}
    .btn2-orange {      position: relative;      display: inline-block;      padding: 10px 20px;      background-color: var(--color-btn2-orange-bg);      color: var(--color-btn2-orange-text);      border: 1px solid #000;      border-radius: 25px;      font-weight: bold;      font-size: 20px;      text-decoration: none;      overflow: hidden;      z-index: 1;      transition: transform 0.3s ease, box-shadow 0.3s ease;    }    .btn2-orange::after {      content: "";      position: absolute;      top: 0;      left: -75%;      width: 50%;      height: 100%;      background: linear-gradient(        120deg,        rgba(255, 255, 255, 0) 0%,        rgba(255, 255, 255, 0.9) 50%,        rgba(255, 255, 255, 0) 100%      );      transform: skewX(-25deg);      z-index: 3;      pointer-events: none;    }    .btn2-orange:hover::after {      animation: shine 0.8s ease-in-out forwards;    }    @keyframes shine {      0% {        left: -75%;      }      100% {        left: 130%;      }    }.btn2-orange:hover {  transform: translateY(-2px);  box-shadow: 0 0 12px rgba(255, 120, 0, 0.6);}.btn2-orange:active {  transform: scale(0.97);  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);}
/* Main Content */
.main-content {
  padding: 10px;
}
hr.separator {
  border: none;
  border-top: 2px solid var(--divider-color); /* Lấy màu từ color.css */
  margin: 20px 0; /* Khoảng cách trên-dưới đường kẻ */
}


/* Tiêu đề h2 */
.main-content h2 {
  margin: 3px 0 0px;
  font-size: 24px;
  color: var(--color-h2);
}

/* Image grid */
.image-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

/* Grid 3 cột */
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Grid 2 cột */
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.image-item {
  background-color: var(--color-image-item-bg);
  padding: 10px;
  text-align: center;
  border-radius: 8px;
}

.image-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-item h3 {
  margin: 10px 0 5px;
  font-size: 16px;
  color: var(--color-image-item-h3);
}

.image-item p {
  font-size: 14px;
  color: var(--color-image-item-p);
}

/* Ảnh lớn chính giữa */
.center-image {
  text-align: center;
  margin: 20px 0;
}

.center-image img {
  max-width: 100%;
  height: auto;
  border: 3px solid var(--color-center-image-border);
}

/* Dòng text tùy chỉnh */
.custom-text {
  margin-top: 10px;
  font-size: 16px;
  text-align: center;
}

/* Footer */
.footer {
  background-color: var(--color-header-bg);
  text-align: center;
  padding: 10px 0;
  margin-top: 20px;
  height: 130px;
}

.footer p {
  color: var(--color-footer-text);
  font-size: 14px;
}

h1, h2, h3, h4, h5, h6 {
  text-align: center;
}

img.aspect-ratio {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
h1 {
  color: var(--color-h1);
}
h2 a {
  color: var(--color-h2); /* Sử dụng màu của h2 (hoặc bạn có thể định nghĩa biến mới cho link) */
  text-decoration: none;  /* Loại bỏ gạch chân nếu cần */
}

h2 a:hover {
  text-decoration: underline; /* Hiệu ứng gạch chân khi hover */
}
/* Popup overlay: bao phủ toàn bộ màn hình, trung tâm popup */
#popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* overlay mờ */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* Nội dung popup */
#popup-content {
  position: relative;
  /* Giới hạn độ rộng để popup không tràn ra sát lề màn hình */
  max-width: 300px;      /* Bạn có thể tăng/giảm tùy ý, ví dụ 400px, 600px... */
  margin: 0 20px;        /* Tạo khoảng trống hai bên trái-phải 20px */
  background: #fff;      /* Nền trắng để phân biệt với overlay */
  border-radius: 8px;    /* Bo góc nhẹ cho đẹp */
  padding: 10px;         /* Tạo khoảng trống bên trong */
}

/* Nút đóng popup */
#popup-close {
  position: absolute;
  top: -8px;              /* Đặt nút X thấp hơn một chút nếu có padding */
  right: -8px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-weight: bold;
}

/* Đảm bảo ảnh co giãn đúng trong popup */
#popup-content img {
  display: block;
  max-width: 100%;
  height: auto;
}#popup-content video {  display: block;  max-width: 100%;  height: auto;  margin: 0 auto;}
h1 {
  color: var(--color-h1);
  font-size: 1.6em;
}
.auth-buttons a {
  margin-right: 1px;
}

.auth-buttons a:last-child {
  margin-right: 0;
}
/* Header cố định */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background-color: var(--color-header-bg);
}

/* Main content: chừa khoảng trống phía trên để header không che */
.main-content {
  margin-top: 130px; /* Điều chỉnh giá trị này theo chiều cao của header */
}
/* --- Quy định mới cho phần video chính --- */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  /* Dùng aspect-ratio để duy trì tỷ lệ 720x1080 */
  aspect-ratio: 720 / 1080;
}

#main-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--video-overlay-bg);
  padding: 70px 20px 0 20px; /* giảm padding-top xuống 5px */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center; /* căn giữa theo chiều ngang */
  justify-content: flex-start; /* đẩy nội dung lên phía trên */
}

.video-overlay h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  padding-bottom: 5px;
}

.video-overlay h2 {
  margin: 10px 0 0 0;
  width: 100%;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: #f0f0f0;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}
