/* style/resources.css */
:root {
  --primary-color: #1A2A44;
  --secondary-color: #FFCC00;
  --text-light: #ffffff;
  --text-dark: #333333;
  --bg-light: #f8f9fa;
  --bg-dark-card: rgba(255, 255, 255, 0.1);
  --border-color: #e0e0e0;
}

/* 🚨 Cần điều chỉnh padding-top cho main content để tránh bị che bởi header cố định */
.page-resources {
  padding-top: 0; /* Đặt lại về 0, padding-top sẽ được áp dụng cho section đầu tiên */
  color: var(--text-light);
}

/* 🚨 HERO主图区域的padding-top必须在非媒体查询的基础样式中设置 */
.page-resources__introduction-section {
  position: relative;
  width: 100%;
  padding: 80px 20px;
  padding-top: 180px; /* 桌面端：根据导航栏实际高度调整，通常为120-200px */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-resources__dark-bg {
  background: var(--primary-color);
  color: var(--text-light);
}

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

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

.page-resources__main-title {
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--text-light);
}

.page-resources__description-text {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-light);
}

.page-resources__cta-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-resources__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

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

.page-resources__btn-primary:hover {
  background: #e6b800;
  border-color: #e6b800;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-secondary {
  background: transparent;
  color: var(--text-light);
  border-color: var(--text-light);
}

.page-resources__btn-secondary:hover {
  background: var(--text-light);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Section Titles */
.page-resources__section-title {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
  color: inherit;
}

.page-resources__section-subtitle {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
  text-align: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: inherit;
}

/* Resource Types Section */
.page-resources__types-section {
  padding: 80px 0;
  color: var(--text-dark);
}

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

.page-resources__resource-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-resources__resource-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-resources__card-image {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-resources__card-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-resources__card-text {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-resources__card-link {
  color: var(--secondary-color);
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.page-resources__card-link .page-resources__arrow {
  transition: transform 0.3s ease;
}

.page-resources__resource-card:hover .page-resources__arrow {
  transform: translateX(5px);
}

/* Promotions Section */
.page-resources__promotions-section {
  padding: 80px 0;
  color: var(--text-light);
}

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

.page-resources__promo-card {
  background: var(--bg-dark-card);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-resources__promo-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
}

.page-resources__promo-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.page-resources__promo-text {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 25px;
  flex-grow: 1;
}

.page-resources__promo-button {
  background: var(--secondary-color);
  color: var(--primary-color);
  padding: 12px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-resources__promo-button:hover {
  background: #e6b800;
  transform: translateY(-2px);
}

/* Latest Articles Section */
.page-resources__latest-articles-section {
  padding: 80px 0;
  color: var(--text-dark);
}

.page-resources__article-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.page-resources__article-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-resources__article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-resources__article-image {
  width: 300px;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.page-resources__article-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.page-resources__article-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
}

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

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

.page-resources__article-excerpt {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 15px;
  color: #555555;
  flex-grow: 1;
}

.page-resources__article-date {
  font-size: 14px;
  color: #777777;
  margin-bottom: 15px;
}

.page-resources__read-more-button {
  display: inline-block;
  color: var(--secondary-color);
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__read-more-button:hover {
  color: #e6b800;
}

.page-resources__view-all-button-container {
  text-align: center;
  margin-top: 50px;
}

.page-resources__view-all-button {
  background: var(--primary-color);
  color: var(--text-light);
  padding: 15px 40px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-resources__view-all-button:hover {
  background: #0f1c2d;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

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

.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

.page-resources__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* Đảm bảo đủ cao để hiển thị mọi nội dung */
  padding: 20px 15px !important;
  opacity: 1;
  background: var(--bg-dark-card);
  border-radius: 0 0 5px 5px;
}

.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--bg-dark-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-resources__faq-question:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--secondary-color);
}

.page-resources__faq-question:active {
  background: rgba(255, 255, 255, 0.2);
}

.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none;
  color: var(--text-light);
}

.page-resources__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--secondary-color);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: var(--text-light);
  transform: rotate(45deg); /* Để '+' thành 'X' hoặc một dấu khác */
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .page-resources__main-title {
    font-size: 38px;
  }

  .page-resources__section-title {
    font-size: 32px;
  }

  .page-resources__article-image {
    width: 250px;
    height: 180px;
  }

  .page-resources__article-title {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  /* 🚨 移动端必须重新设置padding-top，覆盖桌面端样式 */
  .page-resources__introduction-section {
    padding-top: 160px !important; /* 移动端：根据移动端导航栏实际高度调整 */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-resources__main-title {
    font-size: 32px;
  }

  .page-resources__description-text {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-resources__cta-group {
    flex-direction: column;
    gap: 15px;
  }

  .page-resources__cta-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
  }

  .page-resources__section-title {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .page-resources__section-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-resources__types-section,
  .page-resources__promotions-section,
  .page-resources__latest-articles-section,
  .page-resources__faq-section {
    padding: 50px 0;
  }

  .page-resources__resource-grid,
  .page-resources__promo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-resources__resource-card,
  .page-resources__promo-card {
    padding: 20px;
  }

  .page-resources__card-image {
    height: 180px;
  }

  .page-resources__card-title {
    font-size: 20px;
  }

  .page-resources__article-card {
    flex-direction: column;
  }

  .page-resources__article-image {
    width: 100%;
    height: 200px;
    border-radius: 8px 8px 0 0;
  }

  .page-resources__article-content {
    padding: 20px;
  }

  .page-resources__article-title {
    font-size: 18px;
  }

  .page-resources__article-excerpt {
    font-size: 15px;
  }

  .page-resources__view-all-button {
    padding: 12px 30px;
    font-size: 16px;
  }

  .page-resources__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-resources__faq-question h3 {
    font-size: 16px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-resources__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
  
  .page-resources__faq-answer {
    padding: 0 15px;
  }
  
  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px !important;
  }

  /* 🚨 移动端图片强制适配 */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-resources__section,
  .page-resources__card,
  .page-resources__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 480px) {
  .page-resources__main-title {
    font-size: 28px;
  }

  .page-resources__section-title {
    font-size: 24px;
  }

  .page-resources__description-text,
  .page-resources__section-subtitle,
  .page-resources__card-text,
  .page-resources__promo-text,
  .page-resources__article-excerpt {
    font-size: 14px;
  }

  .page-resources__card-title,
  .page-resources__promo-title,
  .page-resources__article-title {
    font-size: 18px;
  }

  .page-resources__article-image {
    height: 160px;
  }
}