/* style/resources.css */

/* Biến CSS cục bộ cho màu sắc */
:root {
  --page-resources-primary-color: #26A9E0;
  --page-resources-secondary-color: #FFFFFF;
  --page-resources-text-dark: #333333;
  --page-resources-text-light: #ffffff;
  --page-resources-button-login: #EA7C07;
  --page-resources-background-white: #FFFFFF;
  --page-resources-black: #000000;
}

.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--page-resources-text-dark); /* Mặc định chữ tối trên nền sáng */
  background-color: var(--page-resources-background-white);
}

.page-resources__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-resources__hero-section {
  position: relative;
  padding: 100px 0 60px; /* Điều chỉnh padding để không bị header che */
  color: var(--page-resources-text-light);
  text-align: center;
  overflow: hidden;
  padding-top: var(--header-offset, 120px); /* Đảm bảo khoảng cách với header cố định */
}

.page-resources__hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(38, 169, 224, 0.8); /* Lớp phủ màu chính */
  z-index: 1;
}

.page-resources__hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.page-resources__hero-section .page-resources__container {
  position: relative;
  z-index: 2;
}

.page-resources__hero-title {
  font-size: 3.2em;
  margin-bottom: 20px;
  color: var(--page-resources-text-light);
  line-height: 1.2;
}

.page-resources__hero-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--page-resources-text-light);
}

.page-resources__section-title {
  font-size: 2.5em;
  text-align: center;
  margin-bottom: 40px;
  color: var(--page-resources-primary-color);
}

.page-resources__section {
  padding: 60px 0;
}

.page-resources__text-block {
  margin-bottom: 20px;
  font-size: 1.1em;
  color: var(--page-resources-text-dark);
}

.page-resources__text-block strong {
  color: var(--page-resources-primary-color);
}

.page-resources__text-block a {
  color: var(--page-resources-primary-color);
  text-decoration: underline;
}

/* Các loại tài nguyên */
.page-resources__categories-section {
  background-color: var(--page-resources-background-white);
}

.page-resources__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-resources__card {
  background: var(--page-resources-secondary-color);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: var(--page-resources-text-dark);
}

.page-resources__card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.page-resources__card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  margin-bottom: 20px;
}

.page-resources__card-title {
  font-size: 1.4em;
  margin: 0 20px 15px;
  color: var(--page-resources-primary-color);
  flex-grow: 1;
}

.page-resources__card-title a {
  color: inherit;
  text-decoration: none;
}

.page-resources__card-title a:hover {
  text-decoration: underline;
}

.page-resources__card-description {
  font-size: 1em;
  color: var(--page-resources-text-dark);
  padding: 0 20px;
  margin-bottom: 20px;
}

/* Video section */
.page-resources__video-section {
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
  text-align: center;
}

.page-resources__video-section .page-resources__section-title {
  color: var(--page-resources-text-light);
}

.page-resources__video-section .page-resources__text-block {
  color: var(--page-resources-text-light);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  border-radius: 10px;
  margin-top: 30px;
  margin-bottom: 20px;
}

.page-resources__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer; /* Thêm con trỏ dạng bàn tay */
}

.page-resources__video-caption {
  font-style: italic;
  font-size: 0.9em;
  opacity: 0.9;
}

/* FAQ Section */
.page-resources__faq-section {
  background-color: var(--page-resources-background-white);
}

.page-resources__faq-list {
  max-width: 900px;
  margin: 0 auto;
}

.page-resources__faq-item {
  background: var(--page-resources-secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  color: var(--page-resources-primary-color);
  background-color: #f9f9f9;
  transition: background-color 0.3s ease;
}

.page-resources__faq-question:hover {
  background-color: #f0f0f0;
}

.page-resources__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  transform: rotate(45deg); /* Chuyển thành dấu 'x' hoặc '-' */
}

.page-resources__faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 25px; /* Giữ padding ngang khi đóng */
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--page-resources-text-dark);
}

.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 1000px !important; /* Đủ lớn để chứa mọi nội dung, sử dụng !important */
  padding: 15px 25px; /* Thêm padding dọc khi mở */
}

.page-resources__faq-answer p {
  margin-bottom: 1em;
}

/* Responsible Gaming Section */
.page-resources__responsible-gaming-section {
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
  text-align: center;
}

.page-resources__responsible-gaming-section .page-resources__section-title,
.page-resources__responsible-gaming-section .page-resources__text-block {
  color: var(--page-resources-text-light);
}

/* Contact Section */
.page-resources__contact-section {
  background-color: var(--page-resources-background-white);
  text-align: center;
}

.page-resources__contact-section .page-resources__text-block {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.page-resources__btn-primary,
.page-resources__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  margin: 10px;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__btn-primary {
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
  border: 2px solid var(--page-resources-primary-color);
}

.page-resources__btn-primary:hover {
  background-color: darken(var(--page-resources-primary-color), 10%);
  border-color: darken(var(--page-resources-primary-color), 10%);
}

.page-resources__btn-secondary {
  background-color: var(--page-resources-secondary-color);
  color: var(--page-resources-primary-color);
  border: 2px solid var(--page-resources-primary-color);
}

.page-resources__btn-secondary:hover {
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
}

.page-resources__button-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Cho phép xuống dòng trên màn hình nhỏ */
  margin-top: 30px;
}

/* Màu sắc đặc biệt */
.page-resources__btn-login {
  background-color: var(--page-resources-button-login);
  border-color: var(--page-resources-button-login);
  color: var(--page-resources-text-light);
}

.page-resources__btn-login:hover {
  background-color: darken(var(--page-resources-button-login), 10%);
  border-color: darken(var(--page-resources-button-login), 10%);
}

/* Đảm bảo độ tương phản */
.page-resources__dark-section {
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
}

.page-resources__dark-section h1, .page-resources__dark-section h2, .page-resources__dark-section h3, .page-resources__dark-section p {
  color: var(--page-resources-text-light);
}

.page-resources__light-bg {
  background-color: var(--page-resources-background-white);
  color: var(--page-resources-text-dark);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-resources__hero-title {
    font-size: 2.8em;
  }
  .page-resources__section-title {
    font-size: 2em;
  }
  .page-resources__card-image {
    height: 200px;
  }
}

@media (max-width: 768px) {
  .page-resources__hero-section {
    padding: 80px 0 40px;
    padding-top: var(--header-offset, 120px) !important; /* Đảm bảo khoảng cách với header cố định trên mobile */
  }
  .page-resources__hero-title {
    font-size: 2.2em;
    margin-bottom: 15px;
  }
  .page-resources__hero-description {
    font-size: 1em;
    margin-bottom: 30px;
  }
  .page-resources__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }
  .page-resources__section {
    padding: 40px 0;
  }
  .page-resources__text-block {
    font-size: 1em;
  }
  .page-resources__grid {
    grid-template-columns: 1fr;
  }
  .page-resources__card-image {
    height: 180px;
  }
  .page-resources__card-title {
    font-size: 1.2em;
    margin: 0 15px 10px;
  }
  .page-resources__card-description {
    padding: 0 15px;
  }

  /* Responsive images */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .page-resources__hero-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Responsive videos */
  .page-resources video,
  .page-resources__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .page-resources__video-section,
  .page-resources__video-container,
  .page-resources__video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }
  .page-resources__video-wrapper {
    padding-bottom: 56.25% !important; /* 16:9 Aspect Ratio */
  }
  
  /* Responsive buttons */
  .page-resources__btn-primary,
  .page-resources__btn-secondary,
  .page-resources a[class*="button"],
  .page-resources a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
    margin: 5px 0; /* Giảm margin giữa các nút trên mobile */
  }
  .page-resources__button-group {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-direction: column !important; /* Xếp chồng nút trên mobile */
    gap: 10px; /* Khoảng cách giữa các nút */
  }

  .page-resources__container {
    padding: 0 15px;
  }

  .page-resources__faq-question {
    padding: 15px 20px;
    font-size: 1.1em;
  }

  .page-resources__faq-answer {
    padding: 0 20px;
  }

  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 10px 20px;
  }
}