/* style/resources.css */

/* --- General Page Styling --- */
.page-resources {
  /* Body background is dark (#121212 from shared.css), so text should be light */
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  background-color: #121212; /* Ensure consistency with body background */
}

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

/* --- Fixed Navigation Bar Spacing --- */
/* Ensure content is not hidden by fixed header */
.page-resources__hero-section {
  padding-top: 120px; /* Desktop: Adjust based on shared header height */
  padding-bottom: 60px;
  background-color: #1a1a1a; /* Slightly lighter dark background for hero */
  text-align: center;
}

/* --- Section Titles and Descriptions --- */
.page-resources__section-title {
  font-size: 36px;
  font-weight: bold;
  color: #FFD700; /* Gold for main titles */
  margin-bottom: 20px;
  text-align: center;
}

.page-resources__section-description {
  font-size: 18px;
  color: #f0f0f0;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__section-description a {
  color: #FFD700;
  text-decoration: underline;
}

.page-resources__section-description a:hover {
  color: #fff;
}

/* --- Hero Section --- */
.page-resources__hero-title {
  font-size: 48px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 25px;
  line-height: 1.2;
}

.page-resources__hero-title a,
.page-resources__hero-description a {
  color: #FFD700;
  text-decoration: none;
}

.page-resources__hero-title a:hover,
.page-resources__hero-description a:hover {
  text-decoration: underline;
}

.page-resources__hero-description {
  font-size: 20px;
  color: #e0e0e0;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__hero-cta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* --- Buttons --- */
.page-resources__btn {
  display: inline-block;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text breaking */
}

.page-resources__btn--primary {
  background: #0A2463; /* Primary brand color */
  color: #ffffff;
  border: 2px solid #0A2463;
}

.page-resources__btn--primary:hover {
  background: #071a47; /* Darker shade */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.page-resources__btn--secondary {
  background: #FFD700; /* Secondary brand color */
  color: #000000; /* Black for contrast on gold */
  border: 2px solid #FFD700;
}

.page-resources__btn--secondary:hover {
  background: #e6c200; /* Darker shade */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* --- Guides Section --- */
.page-resources__guides-section {
  padding: 80px 0;
  background-color: #121212;
}

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

.page-resources__guide-card {
  background: rgba(255, 255, 255, 0.08); /* Light transparent background for cards */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

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

.page-resources__guide-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.page-resources__guide-card-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-resources__guide-card-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-resources__guide-card-title a {
  color: #FFD700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__guide-card-title a:hover {
  color: #ffffff;
}

.page-resources__guide-card-excerpt {
  font-size: 16px;
  color: #e0e0e0;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-resources__guide-card-excerpt a {
  color: #FFD700;
  text-decoration: underline;
}

.page-resources__guide-card-excerpt a:hover {
  color: #fff;
}

.page-resources__guide-card-link {
  display: inline-block;
  padding: 10px 20px;
  background: #0A2463;
  color: #ffffff;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  align-self: flex-start;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-resources__guide-card-link:hover {
  background: #071a47;
  transform: translateY(-1px);
}

/* --- FAQ Section --- */
.page-resources__faq-section {
  padding: 80px 0;
  background-color: #1a1a1a; /* Darker background for FAQ section */
}

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

/* FAQ容器样式 */
.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.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 20px; /* Adjusted padding */
  opacity: 0;
  background-color: #2a2a2a; /* Darker background for answer */
  color: #f0f0f0;
}

/* FAQ展开状态 - 🚨 Sử dụng !important và max-height đủ lớn để đảm bảo có thể mở rộng */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 Sử dụng !important để ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
  padding: 20px !important; /* Adjusted padding */
  opacity: 1;
  border-radius: 0 0 5px 5px;
}

/* Question styling */
.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #0A2463; /* Primary brand color for question background */
  border: 1px solid #0A2463;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  color: #ffffff; /* White text for contrast */
}

.page-resources__faq-question:hover {
  background: #071a47; /* Darker shade on hover */
  border-color: #071a47;
}

.page-resources__faq-question:active {
  background: #05102c;
}

/* Question title styling */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Slightly larger font */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
  color: #ffffff; /* Ensure white text */
}

/* Toggle icon */
.page-resources__faq-toggle {
  font-size: 28px; /* Larger icon */
  font-weight: bold;
  line-height: 1;
  color: #FFD700; /* Gold for toggle icon */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: #ffffff; /* White when active */
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

.page-resources__faq-answer p a {
  color: #FFD700;
  text-decoration: underline;
}

.page-resources__faq-answer p a:hover {
  color: #ffffff;
}

/* --- News Section --- */
.page-resources__news-section {
  padding: 80px 0;
  background-color: #121212;
}

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

.page-resources__news-card {
  background: rgba(255, 255, 255, 0.08); /* Light transparent background for cards */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

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

.page-resources__news-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-resources__news-card-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-resources__news-card-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-resources__news-card-title a {
  color: #FFD700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__news-card-title a:hover {
  color: #ffffff;
}

.page-resources__news-card-excerpt {
  font-size: 16px;
  color: #e0e0e0;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-resources__news-card-excerpt a {
  color: #FFD700;
  text-decoration: underline;
}

.page-resources__news-card-excerpt a:hover {
  color: #fff;
}

.page-resources__news-card-link {
  display: inline-block;
  padding: 10px 20px;
  background: #0A2463;
  color: #ffffff;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  align-self: flex-start;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-resources__news-card-link:hover {
  background: #071a47;
  transform: translateY(-1px);
}

/* --- Contact Section --- */
.page-resources__contact-section {
  padding: 80px 0;
  background-color: #0A2463; /* Primary brand color background */
  text-align: center;
  color: #ffffff;
}

.page-resources__contact-section .page-resources__section-title {
  color: #FFD700; /* Gold title on primary background */
}

.page-resources__contact-section .page-resources__section-description {
  color: #ffffff;
}

.page-resources__contact-section .page-resources__section-description a {
  color: #FFD700;
}

.page-resources__contact-section .page-resources__section-description a:hover {
  color: #fff;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-resources__hero-title {
    font-size: 40px;
  }
  .page-resources__section-title {
    font-size: 32px;
  }
  .page-resources__guide-card-title,
  .page-resources__news-card-title {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  /* --- Fixed Navigation Bar Spacing (Mobile) --- */
  .page-resources__hero-section {
    padding-top: 100px !important; /* Mobile: Adjust based on shared header height */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }

  .page-resources__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-resources__hero-title {
    font-size: 32px;
    margin-bottom: 20px;
  }

  .page-resources__hero-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-resources__hero-cta {
    flex-direction: column;
    gap: 15px;
  }

  /* --- Buttons Responsive --- */
  .page-resources__btn {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 25px !important;
    font-size: 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* --- Sections Responsive --- */
  .page-resources__guides-section,
  .page-resources__faq-section,
  .page-resources__news-section,
  .page-resources__contact-section {
    padding: 50px 0;
  }

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

  .page-resources__section-description {
    font-size: 16px;
    margin-bottom: 30px;
    padding: 0 10px;
  }

  /* --- Guide Grid Responsive --- */
  .page-resources__guide-grid,
  .page-resources__news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-resources__guide-card-image,
  .page-resources__news-card-image {
    height: 180px;
  }

  .page-resources__guide-card-content,
  .page-resources__news-card-content {
    padding: 20px;
  }

  .page-resources__guide-card-title,
  .page-resources__news-card-title {
    font-size: 18px;
  }

  .page-resources__guide-card-excerpt,
  .page-resources__news-card-excerpt {
    font-size: 15px;
  }

  /* --- FAQ Responsive --- */
  .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;
  }

  /* --- Image Responsive (General) --- */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    box-sizing: border-box !important;
  }
  
  .page-resources__section,
  .page-resources__card,
  .page-resources__container,
  .page-resources__hero-section,
  .page-resources__guides-section,
  .page-resources__faq-section,
  .page-resources__news-section,
  .page-resources__contact-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Ensure no overflow */
  }
}

/* --- Color Contrast Fixes (if needed) --- */
.page-resources__contrast-fix {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

.page-resources__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}