/* style/resources.css */

/* Biến CSS cục bộ cho trang tài nguyên */
:root {
  --page-resources-primary-color: #1A1A2E;
  --page-resources-secondary-color: #FFD700;
  --page-resources-text-light: #ffffff;
  --page-resources-text-dark: #333333;
  --page-resources-bg-dark: #0a0a0a; /* Thừa kế từ body, dùng để tính toán tương phản */
}

.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--page-resources-text-light); /* Mặc định cho nền tối của body */
  background-color: var(--page-resources-bg-dark); /* Đảm bảo nền khớp với body */
}

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

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

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

/* Hero Section */
.page-resources__hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  padding: 80px 0; /* Giảm padding-top nếu shared.css đã xử lý body padding */
  color: var(--page-resources-text-light);
  overflow: hidden;
  padding-top: var(--header-offset, 120px); /* Đảm bảo khoảng cách với header */
}

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

.page-resources__hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5); /* Lớp phủ để tăng độ tương phản */
  border-radius: 10px;
}

.page-resources__hero-title {
  font-size: 3.5em;
  color: var(--page-resources-secondary-color);
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.page-resources__hero-description {
  font-size: 1.3em;
  margin-bottom: 30px;
  color: var(--page-resources-text-light);
}

/* CTA Button Base */
.page-resources__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
}

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

.page-resources__btn-primary:hover {
  background-color: #e6c200;
  transform: translateY(-3px);
}

.page-resources__btn-secondary {
  background-color: transparent;
  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);
  transform: translateY(-3px);
}

/* Video Section */
.page-resources__video-section {
  padding: 80px 0;
  background-color: var(--page-resources-primary-color);
  text-align: center;
}

.page-resources__video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  max-width: 1000px;
  margin: 0 auto 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.page-resources__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
}

.page-resources__video-cta {
  margin-top: 30px;
}

/* Categories Section */
.page-resources__categories-section {
  padding: 80px 0;
  background-color: var(--page-resources-text-light);
  color: var(--page-resources-text-dark);
}

.page-resources__categories-section .page-resources__section-title,
.page-resources__categories-section .page-resources__section-description {
  color: var(--page-resources-text-dark);
}

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

.page-resources__card {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--page-resources-text-dark);
}

.page-resources__card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.page-resources__card-title {
  font-size: 1.5em;
  font-weight: bold;
  margin: 20px 20px 10px;
}

.page-resources__card-title a {
  color: var(--page-resources-primary-color);
  text-decoration: none;
}

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

.page-resources__card-description {
  font-size: 1em;
  line-height: 1.5;
  margin: 0 20px 20px;
  flex-grow: 1;
}

.page-resources__card .page-resources__btn-secondary {
  margin: 0 20px 20px;
  align-self: flex-start;
}

/* Other Info Section */
.page-resources__other-info-section {
  padding: 80px 0;
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
  text-align: center;
}

.page-resources__other-info-section .page-resources__section-title {
  color: var(--page-resources-secondary-color);
}

.page-resources__other-info-section .page-resources__section-description {
  color: var(--page-resources-text-light);
}

.page-resources__info-list {
  list-style: none;
  padding: 0;
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.page-resources__info-list li {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 15px 25px;
  font-size: 1.1em;
  transition: background-color 0.3s ease;
}

.page-resources__info-list li:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.page-resources__info-list li a {
  color: var(--page-resources-text-light);
  text-decoration: none;
  font-weight: bold;
}

.page-resources__info-list li a:hover {
  color: var(--page-resources-secondary-color);
}

/* Final CTA Section */
.page-resources__cta-final-section {
  padding: 80px 0;
  background-color: var(--page-resources-text-light);
  color: var(--page-resources-text-dark);
  text-align: center;
}

.page-resources__cta-final-section .page-resources__section-title,
.page-resources__cta-final-section .page-resources__section-description {
  color: var(--page-resources-text-dark);
}

/* FAQ Section */
.page-resources__faq-section {
  padding: 80px 0;
  background-color: var(--page-resources-primary-color);
  color: var(--page-resources-text-light);
}

.page-resources__faq-section .page-resources__section-title {
  color: var(--page-resources-secondary-color);
}

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

.page-resources__faq-item {
  background-color: rgba(255, 255, 255, 0.08);
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  color: var(--page-resources-text-light);
  background-color: rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s ease;
}

.page-resources__faq-question:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.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);
}

.page-resources__faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 25px;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: rgba(255, 255, 255, 0.8);
}

.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 1000px !important; /* Đủ lớn để chứa mọi nội dung */
  padding: 15px 25px;
}

.page-resources__faq-answer p {
  margin: 0;
  padding-bottom: 10px;
}

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

@media (max-width: 768px) {
  .page-resources {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-resources__hero-section {
    padding: 60px 0;
    min-height: 400px;
  }
  .page-resources__hero-title {
    font-size: 2.2em;
  }
  .page-resources__hero-description {
    font-size: 1em;
  }
  .page-resources__cta-button {
    padding: 12px 25px;
    font-size: 1em;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-left: auto;
    margin-right: auto;
  }
  .page-resources__cards-grid {
    grid-template-columns: 1fr;
  }
  .page-resources__card {
    margin: 0 15px;
  }
  .page-resources__card .page-resources__btn-secondary {
    width: calc(100% - 40px); /* Adjust for padding */
    margin: 0 20px 20px;
  }
  .page-resources__info-list {
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
  }
  .page-resources__info-list li {
    width: 100%;
  }
  .page-resources__video-section {
    padding-top: var(--header-offset, 120px) !important; /* Ensure video section has correct offset on mobile */
  }
  .page-resources__video-wrapper {
    margin: 0 15px 30px !important;
    width: calc(100% - 30px) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-resources__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .page-resources__hero-section .page-resources__cta-button {
    max-width: 300px !important; /* Limit hero button width for better appearance */
    width: 100% !important;
  }
  .page-resources__container {
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-resources__section-description {
    padding: 0 10px;
  }
  .page-resources__faq-question,
  .page-resources__faq-answer {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 480px) {
  .page-resources__hero-title {
    font-size: 1.8em;
  }
  .page-resources__section-title {
    font-size: 1.5em;
  }
  .page-resources__hero-section {
    padding: 40px 0;
  }
  .page-resources__faq-question {
    font-size: 1.1em;
  }
  .page-resources__faq-toggle {
    font-size: 1.2em;
  }
}